收不到推送通知,链接状态显示未连接

ios
标签: #<Tag:0x00007fb83f3f5760>

(aiqunyou) #1
2017-05-19 11:48:45.863071 PushTest[1793:899219]  | JIGUANG | I - [JIGUANGService] 
--------------------------- JPush Log ----------------------------
--------------------JPush SDK Version:3.0.5--build:36----------
--------------------JCore Lib Version:1.1.3--build:21----------
-----------------AppKey:dbc40c233d6e68a083b675ee----------------
----------------------------------------------------------------
2017-05-19 11:48:45.874330 PushTest[1793:899220]  | JIGUANG | I - [JIGUANGClientController] Action - jpush setup
2017-05-19 11:48:45.891839 PushTest[1793:899221]  | JIGUANG | I - [JIGUANGClientController] Action - setup
2017-05-19 11:48:46.271063 PushTest[1793:899188] did Fail To Register For Remote Notifications With Error: Error Domain=NSCocoaErrorDomain Code=3000 "未找到应用程序的“aps-environment”的授权字符串" UserInfo={NSLocalizedDescription=未找到应用程序的“aps-environment”的授权字符串}

出现这个错误的原因是什么啊?是跟证书有关么?


(aiqunyou) #2

好了,Demo测试没问题了!


#3

(aiqunyou) #4

彻底懵逼了,在Demo上边啥事儿都没有,弄到工程里面就有问题而且下面这几个方法都没走啊!求解答,求解答!困扰好长时间了!

- (void)networkDidSetup:(NSNotification *)notification {
    NSLog(@"已连接");
}

- (void)networkDidClose:(NSNotification *)notification {
    NSLog(@"未连接");
}

- (void)networkDidRegister:(NSNotification *)notification {
    NSLog(@"%@", [notification userInfo]);
    NSLog(@"已注册");
}

- (void)networkDidLogin:(NSNotification *)notification {
    
    NSLog(@"已登录");
}
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    //  注册APNs成功并上报DeviceToken
    /// Required - 注册 DeviceToken
    [JPUSHService registerDeviceToken:deviceToken];
}
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
    //Optional
    //注册APNs失败接口
    NSLog(@"did Fail To Register For Remote Notifications With Error: %@", error);
}

#5

额,前面三个监听不应该写在注册的方法之后吗?

参考demo去写呀

如有什么报错把报错贴出来


#6

(aiqunyou) #7

有没有QQ号啊!求加号!我按照Demo的写了也没有走这些个方法!不知道原因啊!错误倒是没有啥错误,就是在设置标签的方法那里iResCode这个值是6002


(aiqunyou) #8
[JPUSHService registrationIDCompletionHandler:^(int resCode, NSString *registrationID) {
        if(resCode == 0){
            NSLog(@"registrationID 获取成功:%@",registrationID);
            
        }
        else{
            NSLog(@"registrationID 获取失败,code:%d",resCode);
        }
    }];

这个方法也走了没啥问题啊!registrationID也有别的就真不知道哪里有问题了!纠结啊!


#9

1、额,你根据集成文档
2、获取到完整点的日志
3、设置别名需要在 集成成功之后


(aiqunyou) #10

可问题是没走这个监听方法啊!