码迷,mamicode.com
首页 > 其他好文 > 详细

cocos2dx 加本地推送通知

时间:2015-04-14 14:14:20      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:

SystemHelper::createLocalNotification(someTask.seconds, SystemHelper::getLocalizedText("Task_Finish"));

void SystemHelper::createLocalNotification(unsigned long time,const char *msg)

{

    UILocalNotification* notif = [[UILocalNotification alloc] init];

    if(nil != notif){

        NSDate* now = [NSDate new] ;

        notif.fireDate= [now dateByAddingTimeInterval:time];

        notif.repeatInterval=0;

        notif.timeZone=[NSTimeZone defaultTimeZone];

        notif.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber] + 1;

        notif.soundName= UILocalNotificationDefaultSoundName;

        notif.alertBody= [NSString stringWithUTF8String:msg];

//        notif.hasAction = NO;

        [[UIApplication sharedApplication] scheduleLocalNotification:notif];

    }

}

cocos2dx 加本地推送通知

标签:

原文地址:http://www.cnblogs.com/niwococo/p/4424564.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!