首页 > 其他 > 详细

推送保存消息

时间:2015-09-18 13:24:58      阅读:298      评论:0      收藏:0      [点我收藏+]

远程推送,在前台和后台时进入时 方法为  -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{

在完全退出时走得方法为  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  //推送
    
    if (launchOptions) {
        NSDictionary *userInfo = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
        NSInteger type = [userInfo[@"type"] integerValue];
        NSString *notiContent = userInfo[@"aps"][@"alert"];
        NotifiCationDao *dao = [NotifiCationDao new];
        [dao addNotiWithContent:notiContent type:type];
        [[NSNotificationCenter defaultCenter]postNotificationName:kDidReceiveRemoteNotificationKey object:userInfo];
        
    }

推送保存消息

原文:http://www.cnblogs.com/huoxingdeguoguo/p/4818738.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!