注册

不走 didReceiveRemoteNotification

不走 didReceiveRemoteNotification  这个方法。    我中途换了一个 推送证书, 原来的证书是可以的。 能走这个方法, 现在不可以了。  现在的情况如下: 
 在后台发送消息, IOS客户端 会打印日志如下, 
2015-12-01 17:42:44:422 EyeshieldAssistant[664:7a1f] RECV: {"from":"admin","to":"yb_today","bodies":[{"type":"txt","msg":"我是一个斌"}]}

2015-12-01 17:42:44:429 EyeshieldAssistant[664:f07] SEND:

2015-12-01 17:42:44:429 EyeshieldAssistant[664:4d23] begin insert message to chatter::admin, messageId::134854069150810588

2015-12-01 17:42:44:456 EyeshieldAssistant[664:4d23] end insert message with account::yb_today, to chatter::admin, messageId::134854069150810588, result::YES
 
 
已邀请:
我看了其他回复, 在代码中,加入  下面代码就可以了。    在vviewdidload中加入就   [self registerNotifications]; 这个就可以了 。


-(void)registerNotifications

{

    [self unregisterNotifications];

    

    [[EaseMob sharedInstance].chatManager addDelegate:self delegateQueue:nil];

    [[EaseMob sharedInstance].callManager addDelegate:self delegateQueue:nil];

}




-(void)unregisterNotifications

{

    [[EaseMob sharedInstance].chatManager removeDelegate:self];

    [[EaseMob sharedInstance].callManager removeDelegate:self];

}




-(void)didReceiveMessage:(EMMessage *)message{




    NSLog(@"%@",message);

}
可以收到apns吗?
可以收到  服务端那边  发过来的数据
该方法是点击离线推送横幅通知进入app后执行的方法。
你这个好了么?我的也是,能正常收到远程通知,但是就是不调用 -(void)didReceiveRemoteNotification:(NSDictionary *)userInfo方法
在didFinishLaunchingWithOptions中调用了下面的方法了吗?
if (launchOptions) {
        NSDictionary*userInfo = [launchOptions objectForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"];
        if(userInfo)
        {
            [self didReceiveRemoteNotification:userInfo];
        }
    }

要回复问题请先登录注册