首页 > 其他 > 详细

cocos2dx 加本地推送通知

时间:2015-04-14 14:13:33      阅读:191      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!