最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]JPUSHClientController Not get deviceToken yet

iOS crifan 5498浏览 0评论

JPush出错:

2016-03-11 16:21:51.553 JianDao[257:7635] Unknown class _TtC7JianDao14ViewController in Interface Builder file.

didFinishLaunchingWithOptions

2016-03-11 16:21:58.946 | JPUSH | I – [JPUSHService]

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<————————- JPush Log —————————-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<——————JPush SDK Version:2.1.0–build:346———-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<—————AppKey:3a1a8d7c1caa422ee5548da3—————-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<————————————————————–

2016-03-11 16:21:58.980 | JPUSH | I – [JPUSHClientController] Action – setup

prevStoredUser=nil

prevStotedPassword=nil

didRegisterUserNotificationSettings

notificationSettings=<UIUserNotificationSettings: 0x12e6ab330; types: (UIUserNotificationTypeAlert UIUserNotificationTypeBadge UIUserNotificationTypeSound);>

didRegisterForRemoteNotificationsWithDeviceToken

deviceToken=<77366f0d c4a4f2f4 74fe24de 5db46132 c725ee1a 8e41b1fc a9a511bc 832c0113>

didRegisterUserNotificationSettings

notificationSettings=<UIUserNotificationSettings: 0x12e6529a0; types: (UIUserNotificationTypeAlert UIUserNotificationTypeBadge UIUserNotificationTypeSound);>

2016-03-11 16:22:05.110 | JPUSH | W – [JPUSHClientController] Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed?  or there is no APNs register code? Please refer to JPush docs.

2016-03-11 16:22:05.113 | JPUSH | I – [JPUSHSessionController] sis is not on protect

2016-03-11 16:22:05.116 | JPUSH | I – [JPUSHAddressController] Action – sendSisRequest

搜:

JPUSHClientController Not get deviceToken yet

apns证书已经生成并上传,但报错Not get deviceToken yet – 极光推送问答

iOS 常见问题 – 极光推送开发 – JPush 开发文档

“1.确认你的app配置了apns权限,如果未配置apns权限,则应该会出现此错误提示。”

去确认一下,好像是没有配置?

再去试试,问题依旧:

2016-03-11 16:28:46.394 JianDao[272:9833] Unknown class _TtC7JianDao14ViewController in Interface Builder file.

didFinishLaunchingWithOptions

2016-03-11 16:28:49.598 | JPUSH | I – [JPUSHService]

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<————————- JPush Log —————————-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<——————JPush SDK Version:2.1.0–build:346———-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<—————AppKey:3a1a8d7c1caa422ee5548da3—————-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<————————————————————–

2016-03-11 16:28:49.612 | JPUSH | I – [JPUSHClientController] Action – setup

prevStoredUser=nil

prevStotedPassword=nil

didRegisterUserNotificationSettings

notificationSettings=<UIUserNotificationSettings: 0x14458f440; types: (UIUserNotificationTypeAlert UIUserNotificationTypeBadge UIUserNotificationTypeSound);>

didRegisterForRemoteNotificationsWithDeviceToken

deviceToken=<77366f0d c4a4f2f4 74fe24de 5db46132 c725ee1a 8e41b1fc a9a511bc 832c0113>

didRegisterUserNotificationSettings

notificationSettings=<UIUserNotificationSettings: 0x144676f00; types: (UIUserNotificationTypeAlert UIUserNotificationTypeBadge UIUserNotificationTypeSound);>

2016-03-11 16:28:53.212 | JPUSH | W – [JPUSHClientController] Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed?  or there is no APNs register code? Please refer to JPush docs.

2016-03-11 16:28:53.218 | JPUSH | I – [JPUSHSessionController] sis is not on protect

2016-03-11 16:28:53.234 | JPUSH | I – [JPUSHAddressController] Action – sendSisRequest

但是稍等之后,就看到了:

  2016-03-11 16:29:02.234 | JPUSH | I – [JPUSHDeviceTokenReport] upload device token success

难道可以了?

重现运行试试

2016-03-11 16:30:50.067 JianDao[281:10960] Unknown class _TtC7JianDao14ViewController in Interface Builder file.

didFinishLaunchingWithOptions

2016-03-11 16:30:52.499 | JPUSH | I – [JPUSHService]

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<————————- JPush Log —————————-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<——————JPush SDK Version:2.1.0–build:346———-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<—————AppKey:3a1a8d7c1caa422ee5548da3—————-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<————————————————————–

2016-03-11 16:30:52.523 | JPUSH | I – [JPUSHClientController] Action – setup

prevStoredUser=nil

prevStotedPassword=nil

didRegisterForRemoteNotificationsWithDeviceToken

deviceToken=<77366f0d c4a4f2f4 74fe24de 5db46132 c725ee1a 8e41b1fc a9a511bc 832c0113>

didRegisterUserNotificationSettings

2016-03-11 16:30:55.249 | JPUSH | W – [JPUSHClientController] Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed?  or there is no APNs register code? Please refer to JPush docs.

notificationSettings=<UIUserNotificationSettings: 0x14d5d8220; types: (UIUserNotificationTypeAlert UIUserNotificationTypeBadge UIUserNotificationTypeSound);>

2016-03-11 16:31:09.235 | JPUSH | I – [JPUSHSessionController] sis is not on protect

didRegisterUserNotificationSettings

notificationSettings=<UIUserNotificationSettings: 0x14d57f810; types: (UIUserNotificationTypeAlert UIUserNotificationTypeBadge UIUserNotificationTypeSound);>

2016-03-11 16:31:09.241 | JPUSH | I – [JPUSHAddressController] Action – sendSisRequest

2016-03-11 16:31:24.604 | JPUSH | I – [JPUSHDeviceTokenReport] upload device token success

didRegisterUserNotificationSettings被执行了两次,好像是第二次就没有上面的那个报错了。

然后好像工作了?

反正是iPhone6真机中可以显示本地通知了

但是为何不是remote notification?

经过后来的调试,终于可以了连接成功JPUSH了:

didFinishLaunchingWithOptions

2016-03-12 10:25:48.325 | JPUSH | I – [JPUSHService] 

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<————————- JPush Log —————————-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<——————JPush SDK Version:2.1.0–build:346———-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<—————AppKey:3a1a8d7c1caa422ee5548da3—————-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<————————————————————–

2016-03-12 10:25:48.361 | JPUSH | I – [JPUSHClientController] Action – setup

prevStoredUser=Optional("15051464654")

prevStotedPassword=Optional("111111")

didRegisterUserNotificationSettings

notificationSettings=<UIUserNotificationSettings: 0x15d555a80; types: (UIUserNotificationTypeAlert UIUserNotificationTypeBadge UIUserNotificationTypeSound);>

2016-03-12 10:25:50.570 | JPUSH | W – [JPUSHClientController] Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed?  or there is no APNs register code? Please refer to JPush docs.

didRegisterForRemoteNotificationsWithDeviceToken

deviceToken=<89b266fc 31bb2513 20a35909 03a31e9f c8127fef 4946138c 66df7769 617b1c0c>

已注册远程通知 didRegisterRemoteNotification=(Function)

deviceTokenStr=Optional(<89b266fc 31bb2513 20a35909 03a31e9f c8127fef 4946138c 66df7769 617b1c0c>)

2016-03-12 10:25:50.583 | JPUSH | I – [JPUSHSessionController] sis is not on protect

2016-03-12 10:25:50.586 | JPUSH | I – [JPUSHAddressController] Action – sendSisRequest

已连接 networkDidSetup notification=NSConcreteNotification 0x15d509700 {name = kJPUSHNetworkDidSetupNotification}

已注册 networkDidRegister notification=NSConcreteNotification 0x15d555320 {name = kJPUSHNetworkDidRegisterNotification; userInfo = {

    RegistrationID = 13165ffa4e0b5fb6ba3;

}}

RegistrationID=13165ffa4e0b5fb6ba3

已登陆 networkDidLogin notification=NSConcreteNotification 0x15d6923d0 {name = kJPUSHNetworkDidLoginNotification}

registrationID=13165ffa4e0b5fb6ba3

[后记 2016-04-09]

后来又遇到了:

2016-04-09 15:19:58.436 | JPUSH | I – [JPUSHService] 

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<————————- JPush Log —————————-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<——————JPush SDK Version:2.1.0–build:346———-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<—————AppKey:54ab761c3b571e2cf7dcdb47—————-

<span style="font-size: 12px; background-color: rgb(251, 250, 248); color: rgb(51, 51, 51); font-family: Monaco;"–<————————————————————–

2016-04-09 15:19:58.468 | JPUSH | I – [JPUSHClientController] Action – setup

2016-04-09 15:20:00.512 | JPUSH | W – [JPUSHClientController] Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed?  or there is no APNs register code? Please refer to JPush docs.

2016-04-09 15:20:00.724 | JPUSH | I – [JPUSHSessionController] sis is not on protect

2016-04-09 15:20:00.728 | JPUSH | I – [JPUSHAddressController] Action – sendSisRequest

然后想起了了:

好像是证书的问题?

去看看

去换成:

然后再去试试

然后可以编译了,但是问题依旧:

2016-04-09 15:26:45.184 | JPUSH | W – [JPUSHClientController] Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed?  or there is no APNs register code? Please refer to JPush docs.

发现证书又换回去了:

好像可以不用管了,因为:

2016-04-09 15:26:18.017 [Debug] [main] [AppDelegate.swift:116] application(_:didRegisterForRemoteNotificationsWithDeviceToken:) > deviceToken=<393887aa 8e55851d aca4a49a ede229bb 69a70118 6be31df8 a1dbf4b2 e127ea31>

2016-04-09 15:26:18.019 [Debug] [main] [AppDelegate.swift:372] didRegisterRemoteNotification > 已注册远程通知 didRegisterRemoteNotification=(Function)

2016-04-09 15:26:18.019 [Debug] [main] [AppDelegate.swift:374] didRegisterRemoteNotification > deviceTokenStr=Optional(<393887aa 8e55851d aca4a49a ede229bb 69a70118 6be31df8 a1dbf4b2 e127ea31>)

2016-04-09 15:26:18.022 [Debug] [main] [AppDelegate.swift:159] application(_:didRegisterUserNotificationSettings:) > notificationSettings=<UIUserNotificationSettings: 0x154dc4b20; types: (UIUserNotificationTypeAlert UIUserNotificationTypeBadge UIUserNotificationTypeSound);>

2016-04-09 15:26:18.040 | JPUSH | I – [JPUSHSessionController] sis is not on protect

2016-04-09 15:26:18.046 | JPUSH | I – [JPUSHAddressController] Action – sendSisRequest

已经执行到了:

didRegisterForRemoteNotificationsWithDeviceToken

已经带上设备token,去注册成功了

所以应该是正常了

-》应该可以收到远程推送消息才对。

还是不行。

再去设置对应的Provisioning profile

看看能否OK

再去换为:

看看

去借钱看看之前的另外一个账号的证书:

再去添加一个provisioning profile试试

算了,放弃。

JPUSH Not get deviceToken yet

真机调试Not get deviceToken yet. Maybe: your certificate not configured APNs? – 极光推送问答

iOS 常见问题 – 极光推送开发 – JPush 开发文档

Not get deviceToken yet. Maybe: your certificate not configured APNs – 极光推送问答

Not get deviceToken yet. Maybe: your certificate not configured APNs? – 极光推送问答

Not get deviceToken yet. Maybe: your certificate not configured APNs – 极光推送问答

分分钟搞定iOS推送, JPush提示Not get deviceToken yet. Maybe: your&n_yinhanmsn_新浪博客

apns证书已经生成并上传,但报错Not get deviceToken yet – 极光推送问答

ios7 使用JPush推送不成功 – 极光推送问答

“非常3Q,成功解决。code signing 里边多了一项Provisioning Profile,进行配置就ok了”

运行ios的demo中遇到的问题 – 极光推送问答

ios-证书都是绿灯的但提示Not get deviceToken yet. Maybe: your certificate not configured APNs? – 极光推送问答

估计就是:

之前弄的PP证书有问题?

那么去重新弄一遍。

后来的后来,折腾:

[已解决]Your build settings specify a provisioning profile with the UUID

之后虽然还是有:

2016-04-11 14:48:06.180 JianDao[3708:1682862] Unknown class _TtC7JianDao14ViewController in Interface Builder file.

2016-04-11 14:48:06.260 [Info] > JianDao Version: 1.0.0 Build: 1 PID: 3708

2016-04-11 14:48:06.260 [Info] > XCGLogger Version: 3.3 – LogLevel: Debug

2016-04-11 14:48:06.291 [Info] > XCGLogger writing to log to: file:///var/mobile/Containers/Data/Application/1575B643-B5CC-4F9C-8E10-65045AD75234/Documents/jiandao.log

2016-04-11 14:48:06.294 [Debug] [main] [AppDelegate.swift:23] application(_:willFinishLaunchingWithOptions:) > UIScreen.mainScreen().bounds=(0.0, 0.0, 414.0, 736.0)

2016-04-11 14:48:06.301 [Debug] [main] [AppDelegate.swift:31] application(_:willFinishLaunchingWithOptions:) > statusBarView.frame=(0.0, 0.0, 414.0, 20.0)

2016-04-11 14:48:06.326 [Debug] [main] [GlobalValues.swift:56] resetGlobalValues() > 

2016-04-11 14:48:06.465 [Debug] [main] [AppDelegate.swift:58] application(_:didFinishLaunchingWithOptions:) > didFinishLaunchingWithOptions launchOptions=nil

2016-04-11 14:48:06.488 | JPUSH | I – [JPUSHService] 

<span style="font-family: Monaco; font-size: 12px; color: rgb(51, 51, 51);"–<————————- JPush Log —————————-

<span style="font-family: Monaco; font-size: 12px; color: rgb(51, 51, 51);"–<——————JPush SDK Version:2.1.0–build:346———-

<span style="font-family: Monaco; font-size: 12px; color: rgb(51, 51, 51);"–<—————AppKey:54ab761c3b571e2cf7dcdb47—————-

<span style="font-family: Monaco; font-size: 12px; color: rgb(51, 51, 51);"–<————————————————————–

2016-04-11 14:48:06.519 | JPUSH | I – [JPUSHClientController] Action – setup

2016-04-11 14:48:06.530 [Debug] [main] [AppDelegate.swift:378] listenRemotePush() > 

2016-04-11 14:48:06.539 [Debug] [main] [GlobalFunctions.swift:48] showLoginView() > 

2016-04-11 14:48:06.542 [Debug] [main] [GlobalValues.swift:266] setNaviRootVC > rootVC=<JianDao.LoginViewController: 0x15e6facc0>

2016-04-11 14:48:08.612 | JPUSH | W – [JPUSHClientController] Not get deviceToken yet. Maybe: your certificate not configured APNs? or current network is not so good so APNs registration failed?  or there is no APNs register code? Please refer to JPush docs.

2016-04-11 14:48:08.647 [Debug] [main] [AppDelegate.swift:109] application(_:didFinishLaunchingWithOptions:) > didFinishLaunchingWithOptions complete

2016-04-11 14:48:08.654 [Debug] [main] [AppDelegate.swift:212] applicationDidBecomeActive > 

2016-04-11 14:48:08.728 [Info] [main] [GlobalFunctions.swift:317] restoreUserAndPassword() > restore user and password: false, restored user: nil

2016-04-11 14:48:08.729 [Debug] [main] [LoginViewController.swift:314] loginAction() > 

2016-04-11 14:48:08.731 [Debug] [com.apple.root.user-initiated-qos] [LoginViewController.swift:340] loginWithPhoneNumber(_:password:) > phoneNumber=Optional(""), password=Optional("")

2016-04-11 14:48:08.742 [Error] [com.apple.root.user-initiated-qos] [LoginViewController.swift:640] loginFail > failReason=用户名或密码为空

2016-04-11 14:48:08.743 [Debug] [main] [AppDelegate.swift:429] navigationController(_:willShowViewController:animated:) > curVC=<JianDao.LoginViewController: 0x15e6facc0>

2016-04-11 14:48:08.841 [Debug] [main] [AppDelegate.swift:116] application(_:didRegisterForRemoteNotificationsWithDeviceToken:) > deviceToken=<cd2d12be 9bf1767e 6e7b4e24 c150b50d f6e1aac8 dd24769a 0af9e1d9 d26ad809>

2016-04-11 14:48:08.842 [Debug] [main] [AppDelegate.swift:372] didRegisterRemoteNotification > 已注册远程通知 didRegisterRemoteNotification=(Function)

2016-04-11 14:48:08.843 [Debug] [main] [AppDelegate.swift:374] didRegisterRemoteNotification > deviceTokenStr=Optional(<cd2d12be 9bf1767e 6e7b4e24 c150b50d f6e1aac8 dd24769a 0af9e1d9 d26ad809>)

2016-04-11 14:48:08.847 [Debug] [main] [AppDelegate.swift:159] application(_:didRegisterUserNotificationSettings:) > notificationSettings=<UIUserNotificationSettings: 0x15e776520; types: (UIUserNotificationTypeAlert UIUserNotificationTypeBadge UIUserNotificationTypeSound);>

2016-04-11 14:48:08.856 | JPUSH | I – [JPUSHSessionController] sis is not on protect

2016-04-11 14:48:08.860 | JPUSH | I – [JPUSHAddressController] Action – sendSisRequest

2016-04-11 14:48:09.567 [Debug] [main] [AppDelegate.swift:299] networkDidSetup > 已连接 networkDidSetup notification=NSConcreteNotification 0x15e5444b0 {name = kJPUSHNetworkDidSetupNotification}

2016-04-11 14:48:10.224 [Debug] [main] [AppDelegate.swift:307] networkDidRegister > 已注册 networkDidRegister notification=NSConcreteNotification 0x15e607590 {name = kJPUSHNetworkDidRegisterNotification; userInfo = {

    RegistrationID = 1114a89792aa24dcb92;

}}

2016-04-11 14:48:25.377 [Debug] [main] [AppDelegate.swift:312] networkDidRegister > RegistrationID=1114a89792aa24dcb92

2016-04-11 14:48:29.180 [Debug] [main] [AppDelegate.swift:322] networkDidLogin > 已登陆 networkDidLogin notification=NSConcreteNotification 0x15f9499b0 {name = kJPUSHNetworkDidLoginNotification}

2016-04-11 14:48:29.183 [Debug] [main] [AppDelegate.swift:325] networkDidLogin > registrationID=1114a89792aa24dcb92

2016-04-11 14:48:29.294 | JPUSH | I – [JPUSHDeviceTokenReport] upload device token success

即,虽然还是有:

Not get deviceToken yet

但是最终执行到了:

    func networkDidRegister(notification:NSNotification) {

        gLog.debug("已注册 networkDidRegister notification=\(notification)")

       

        if let info = notification.userInfo as? Dictionary<String,String> {

            // Check if value present before using it

            if let RegistrationID = info["RegistrationID"] {

                gLog.debug("RegistrationID=\(RegistrationID)")

            } else {

                gLog.debug("no value for key\n")

            }

        } else {

            gLog.debug("wrong userInfo type")

        }

    }

-》networkDidRegister > RegistrationID=1114a89792aa24dcb92了。

-》最终看到了我们一直梦寐以求的:

[JPUSHDeviceTokenReport] upload device token success

-》

如此,才真正说明,此处的JPUSH的推送之前,设备注册到JPUSH那边是OK的了。

转载请注明:在路上 » [已解决]JPUSHClientController Not get deviceToken yet

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
90 queries in 0.189 seconds, using 22.08MB memory