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

推送保存消息

时间:2015-09-18 13:28:07      阅读:243      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!