jpush / jpush-phonegap-plugin

JPush's officially supported PhoneGap/Cordova plugin (Android & iOS). 极光推送官方支持的 PhoneGap/Cordova 插件(Android & iOS)。
https://docs.jiguang.cn
MIT License
926 stars 350 forks source link

IOS无法收到推送 #356

Closed pedoc closed 6 years ago

pedoc commented 6 years ago

期望效果

收到推送

实际效果

在极光后台点击推送成功,但是到达失败

重现步骤

  1. 在macos上使用命令创建一个基本的cordova工程,并按照要求配置AppKey等,安装插件
  2. 在XCode10上选择真机调试,能够获取到RegistrationID
  3. 在极光后台,选择推送(生产环境),能够看到预估人数为1
  4. 无法收到推送消息

背景

你尝试做过些什么? 1.检查确认JPushConfig.plist配置是否正确 2.检查APPID是否已启用推送功能(确认在apple后台建立的Bundle ID启用了推送功能)

Debug logs

包括 Android 或 iOS 的日志:

Started backup to iCloud! Please be careful. Your application might be rejected by Apple if you store too much data. For more information please read "iOS Data Storage Guidelines" at: https://developer.apple.com/icloud/documentation/data-storage/ To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file 2018-06-17 23:23:19.235115+0800 HelloCordova[10790:2231380] Using UIWebView 2018-06-17 23:23:19.238542+0800 HelloCordova[10790:2231380] [CDVTimer][console] 0.386953ms 2018-06-17 23:23:19.238636+0800 HelloCordova[10790:2231380] [CDVTimer][handleopenurl] 0.061035ms 2018-06-17 23:23:19.239867+0800 HelloCordova[10790:2231380] [CDVTimer][intentandnavigationfilter] 1.212955ms 2018-06-17 23:23:19.239926+0800 HelloCordova[10790:2231380] [CDVTimer][gesturehandler] 0.033975ms 2018-06-17 23:23:19.239941+0800 HelloCordova[10790:2231380] [CDVTimer][TotalPluginStartup] 2.058983ms 2018-06-17 23:23:19.258243+0800 HelloCordova[10790:2231454] | JIGUANG | D - [JIGUANGService] Action - JPUSH begin Setup with appkey:78fc033a245a1ac9a5f48930 channel:channel name isProduction:FALSE advertisingIdentifier: 2018-06-17 23:23:19.260486+0800 HelloCordova[10790:2231454] | JIGUANG | I - [JIGUANGService] --------------------------- JPush Log ---------------------------- --------------------JPush SDK Version:3.0.7--build:45---------- --------------------JCore Lib Version:1.1.6--build:29---------- -----------------AppKey:78fc033a***c9a5f48930----------------

2018-06-17 23:23:19.260835+0800 HelloCordova[10790:2231454] | JIGUANG | I - [JIGUANGClientController] Action - jpush setup 2018-06-17 23:23:19.261047+0800 HelloCordova[10790:2231453] | JIGUANG | I - [JIGUANGClientController] Action - setup 2018-06-17 23:23:19.264577+0800 HelloCordova[10790:2231454] | JIGUANG | E - [JIGUANGClientController] load aps evi error, no em provision url 2018-06-17 23:23:19.376000+0800 HelloCordova[10790:2231456] | JIGUANG | D - [JIGUANGPageFlow] trySetupSession 2018-06-17 23:23:19.376381+0800 HelloCordova[10790:2231454] | JIGUANG | D - [JIGUANGPageFlow] setupSession 2018-06-17 23:23:19.441277+0800 HelloCordova[10790:2231455] | JIGUANG | D - [JIGUANGUserActiveReport] report content { activities = ( ); date = "2018-06-17"; duration = "121.9"; itime = 1529248354; "session_id" = 84faabd017a177e01c6ed44e91b9f19c; time = "23:12:34"; timezone = "+8"; type = "active_terminate"; } 2018-06-17 23:23:19.457079+0800 HelloCordova[10790:2231456] | JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession 2018-06-17 23:23:19.457378+0800 HelloCordova[10790:2231456] | JIGUANG | D - [JIGUANGPageFlow] setupSession 2018-06-17 23:23:19.457604+0800 HelloCordova[10790:2231455] | JIGUANG | D - [JIGUANGPageFlow] resetCurrentPage 2018-06-17 23:23:19.467226+0800 HelloCordova[10790:2231456] | JIGUANG | W - [JIGUANGService] 请将JPush的初始化方法,添加到[UIApplication application: didFinishLaunchingWithOptions:]方法中,否则JPush将不能准确的统计到通知的点击数量。参考文档:https://docs.jiguang.cn/jpush/client/iOS/ios_guide_new/#_6 2018-06-17 23:23:36.266054+0800 HelloCordova[10790:2231475] | JIGUANG | D - [JIGUANGService] Action - registerDeviceToken: <57f39576 9f78885c 5fcfbd1f c0c4d0de 978b46af d19a3a22 0d1c4b9b e558b515> 2018-06-17 23:23:36.268887+0800 HelloCordova[10790:2231454] | JIGUANG | W - [JIGUANGClientController] 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. 2018-06-17 23:23:36.270714+0800 HelloCordova[10790:2231454] | JIGUANG | D - [JIGUANGUserDefaultsController] Action - setCurrentDeviceToken - 57f395769f78885c5fcfbd1fc0c4d0de978b46afd19a3a220d1c4b9be558b515 2018-06-17 23:23:36.271922+0800 HelloCordova[10790:2231454] | JIGUANG | D - [JIGUANGNetworkController] Action - trySetupSession 2018-06-17 23:23:36.273009+0800 HelloCordova[10790:2231453] | JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession 2018-06-17 23:23:36.273955+0800 HelloCordova[10790:2231454] | JIGUANG | D - [JIGUANGNetworkController] userDefaut verified: 1, curNetworkStatus: 3 2018-06-17 23:23:36.274977+0800 HelloCordova[10790:2231453] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPFNetworkIsConnectingNotification (null) 2018-06-17 23:23:36.276045+0800 HelloCordova[10790:2231454] | JIGUANG | D - [JIGUANGSessionController] Action - connect 2018-06-17 23:23:36.276873+0800 HelloCordova[10790:2231453] | JIGUANG | D - [JIGUANGSessionController] Action - isSisOnProtect 2018-06-17 23:23:36.277864+0800 HelloCordova[10790:2231454] | JIGUANG | D - [JIGUANGSessionController] sis is not on protect 2018-06-17 23:23:36.278567+0800 HelloCordova[10790:2231453] | JIGUANG | D - [JIGUANGSessionController] Action - reset sis cache 2018-06-17 23:23:36.279347+0800 HelloCordova[10790:2231454] | JIGUANG | D - [JIGUANGAddressController] 开始Sis解析 2018-06-17 23:23:36.280873+0800 HelloCordova[10790:2231453] | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest 2018-06-17 23:23:36.298706+0800 HelloCordova[10790:2231380] Resetting plugins due to page load. 2018-06-17 23:23:36.300559+0800 HelloCordova[10790:2231479] | JIGUANG | D - [JIGUANGAddressController] get address :124.202.138.32 from host : s.jpush.cn 2018-06-17 23:23:36.300911+0800 HelloCordova[10790:2231453] | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest:toDefaultPort 2018-06-17 23:23:36.305904+0800 HelloCordova[10790:2231453] Missing server connection for kCTConnectionInvalidatedNotification 2018-06-17 23:23:36.306053+0800 HelloCordova[10790:2231479] | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info: 2018-06-17 23:23:36.308837+0800 HelloCordova[10790:2231740] Missing server connection for kCTConnectionInvalidatedNotification 2018-06-17 23:23:36.311486+0800 HelloCordova[10790:2231740] Missing server connection for kCTConnectionInvalidatedNotification 2018-06-17 23:23:36.312165+0800 HelloCordova[10790:2231740] | JIGUANG | D - [JIGUANGUdpSocket] send udp data 2018-06-17 23:23:36.312808+0800 HelloCordova[10790:2231456] | JIGUANG | D - [JIGUANGUdpSocket] send udp data succeed 2018-06-17 23:23:36.313090+0800 HelloCordova[10790:2231456] | JIGUANG | D - [JIGUANGUdpSocket] udp socket begin send behavior 2018-06-17 23:23:36.468302+0800 HelloCordova[10790:2231475] | JIGUANG | D - [JIGUANGAddressController] Action - parse 2018-06-17 23:23:36.496599+0800 HelloCordova[10790:2231479] | JIGUANG | D - [JIGUANGAddressController] Action - parse ips address 2018-06-17 23:23:36.521798+0800 HelloCordova[10790:2231475] | JIGUANG | D - [JIGUANGAddressController] Action - parseOptionAddress 2018-06-17 23:23:36.531454+0800 HelloCordova[10790:2231479] | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info: 2018-06-17 23:23:36.532132+0800 HelloCordova[10790:2231475] | JIGUANG | D - [JIGUANGAddressController] receive sis result 2018-06-17 23:23:36.532419+0800 HelloCordova[10790:2231479] | JIGUANG | D - [JIGUANGSessionController] Action - connectTcp 2018-06-17 23:23:36.532647+0800 HelloCordova[10790:2231475] | JIGUANG | D - [JIGUANGSessionController] Action - connectTcpAddress: 2018-06-17 23:23:36.532851+0800 HelloCordova[10790:2231479] | JIGUANG | D - [JIGUANGSessionController] connectTcp:121.46.25.194:7007 2018-06-17 23:23:36.533123+0800 HelloCordova[10790:2231475] | JIGUANG | I - [JIGUANGSessionController] connecting with coreAddr 121.46.25.194,port 7007 2018-06-17 23:23:36.536058+0800 HelloCordova[10790:2231475] Missing server connection for kCTConnectionInvalidatedNotification 2018-06-17 23:23:36.738251+0800 HelloCordova[10790:2231453] | JIGUANG | D - [JIGUANGTcpSocket] 连接主机成功 2018-06-17 23:23:36.739634+0800 HelloCordova[10790:2231479] | JIGUANG | D - [JIGUANGAddressController] Action - sisReport:port 2018-06-17 23:23:36.741192+0800 HelloCordova[10790:2231453] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPUSHNetworkDidSetupNotification (null) 2018-06-17 23:23:36.776545+0800 HelloCordova[10790:2231747] | JIGUANG | D - [JIGUANGSessionController] Action - doSendTcpRequest 2018-06-17 23:23:36.780739+0800 HelloCordova[10790:2231747] Missing server connection for kCTConnectionInvalidatedNotification 2018-06-17 23:23:36.783320+0800 HelloCordova[10790:2231741] | JIGUANG | D - [JIGUANGReport] send report:( { date = "2018-06-17"; itime = 1529248999; "session_id" = 3cdbd8aa397989532922c58a7f3ef04b; time = "23:23:19"; timezone = "+8"; type = "active_launch"; } ) log succed 2018-06-17 23:23:36.853572+0800 HelloCordova[10790:2231750] | JIGUANG | I - [JIGUANGLogin] ----- login result ----- uid:14276845269 registrationID:141fe1da9e8c40cd790 2018-06-17 23:23:36.853786+0800 HelloCordova[10790:2231454] | JIGUANG | D - [JIGUANGTcpSocket] Got tcp command 2018-06-17 23:23:36.853971+0800 HelloCordova[10790:2231750] | JIGUANG | D - [JIGUANGSessionController] Action - onAckOrRespReceived: 2018-06-17 23:23:36.854161+0800 HelloCordova[10790:2231454] | JIGUANG | D - [JIGUANGSessionController] Event - onLoginRespond 2018-06-17 23:23:36.855430+0800 HelloCordova[10790:2231750] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPUSHNetworkDidLoginNotification (null) 2018-06-17 23:23:36.901462+0800 HelloCordova[10790:2231454] | JIGUANG | D - [JIGUANGReport] send report:( { activities = ( ); date = "2018-06-17"; duration = "121.9"; itime = 1529248354; "session_id" = 84faabd017a177e01c6ed44e91b9f19c; time = "23:12:34"; timezone = "+8"; type = "active_terminate"; } ) log succed 2018-06-17 23:23:36.952715+0800 HelloCordova[10790:2231750] NSURLConnection finished with error - code -1100 2018-06-17 23:23:36.988098+0800 HelloCordova[10790:2231380] Finished load of: file:///var/containers/Bundle/Application/F0B03164-9E52-4501-8D60-6466D09450BD/HelloCordova.app/www/index.html 2018-06-17 23:23:36.995017+0800 HelloCordova[10790:2231380] ### pluginInitialize 2018-06-17 23:23:36.995322+0800 HelloCordova[10790:2231740] | JIGUANG | D - [JIGUANGService] Action - setDebugMode 2018-06-17 23:23:40.594739+0800 HelloCordova[10790:2231740] | JIGUANG | D - [JIGUANGService] Action - registrationID 2018-06-17 23:23:40.601743+0800 HelloCordova[10790:2231380] JPushPlugin:registrationID is 141fe1da9e8c40cd790

huangminlinux commented 6 years ago

换成开发环境试试, 测试生成环境要打 adhoc 包

pedoc commented 6 years ago

@huangminlinux 好的,感谢回复,我测试后再看

pedoc commented 6 years ago

证书问题,当使用开发证书打包app时,sdk上报了生产环境的deviceToken,从而导致开发证书的包收不到正式环境APN的推送。 遇到此类问题时,建议尝试分别使用开发和生产证书打包去测一下。

至于为什么开发证书打包的app上报了生产环境的deviceToken,不得而知