iOS使用jpush-phonegap-plugin插件,设置别名失败

ios
标签: #<Tag:0x00007fb83c4f7c60>

#12

phonegap 的 Jcore 1.2.0 对应 1.1.6 的原生版本

JPush 3.0.5 及以下版本 + jcore1.1.5-jcore1.1.7版本上别名标签是有点问题,就是实际上你别名已经设置成功,但是依旧给你报了 6002 。

不知道你用的插件实际对应的 原生 SDK 版本多少,你看下开发日志,应会打印原生 SDK 的版本,如果在这个版本上,就升级下


(Alias) #13

查了下,ios的版本是4.4.0,不知道这个版本对应的jcore v1.2.0和jpush v3.4.1有没有问题?
我是否需要rm掉ios,重新ionic cordova platform add ios@其他版本?


#14

这是什么版本?

需要你看一下日志里面打印 的极光SDK的版本是多少


(Alias) #15

这是安装的ios platform的版本


#16

看下日志,看我们 JPush SDK的版本


(Alias) #17
2018-05-07 18:23:57.169263+0800 ITSMOB3_LYT[44206:5808524] [Accessibility] ****************** Loading GAX Client Bundle ****************
2018-05-07 18:23:57.349844+0800 ITSMOB3_LYT[44206:5808524] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
2018-05-07 18:23:57.365091+0800 ITSMOB3_LYT[44206:5808524] Apache Cordova native platform version 4.4.0 is starting.
2018-05-07 18:23:57.366703+0800 ITSMOB3_LYT[44206:5808524] Multi-tasking -> Device: YES, App: YES
2018-05-07 18:23:57.591266+0800 ITSMOB3_LYT[44206:5808524] Using UIWebView
2018-05-07 18:23:57.597614+0800 ITSMOB3_LYT[44206:5808524] [CDVTimer][handleopenurl] 0.322938ms
2018-05-07 18:23:57.605404+0800 ITSMOB3_LYT[44206:5808524] [CDVTimer][intentandnavigationfilter] 7.626057ms
2018-05-07 18:23:57.605819+0800 ITSMOB3_LYT[44206:5808524] [CDVTimer][gesturehandler] 0.271082ms
2018-05-07 18:23:57.708492+0800 ITSMOB3_LYT[44206:5808524] [CDVTimer][file] 102.083921ms
2018-05-07 18:23:57.865636+0800 ITSMOB3_LYT[44206:5808524] [CDVTimer][splashscreen] 156.615973ms
2018-05-07 18:23:57.887817+0800 ITSMOB3_LYT[44206:5808524] [CDVTimer][statusbar] 22.019029ms
2018-05-07 18:23:57.890128+0800 ITSMOB3_LYT[44206:5808524] [CDVTimer][keyboard] 2.036929ms
2018-05-07 18:23:57.890386+0800 ITSMOB3_LYT[44206:5808524] [CDVTimer][TotalPluginStartup] 293.040991ms
2018-05-07 18:23:57.947696+0800 ITSMOB3_LYT[44206:5808628]  | JIGUANG | D - [JIGUANGService] Action - JPUSH begin Setup with appkey:bd59d80e6a3fa7329bd71dc0 channel:channel name isProduction:TRUE advertisingIdentifier: 
2018-05-07 18:23:57.962278+0800 ITSMOB3_LYT[44206:5808625]  | JIGUANG | I - [JIGUANGService] 
--------------------------- JPush Log ----------------------------
--------------------JPush SDK Version:3.0.7--build:45----------
--------------------JCore Lib Version:1.1.6--build:29----------
-----------------AppKey:bd59d80e6a3fa7329bd71dc0----------------
----------------------------------------------------------------
2018-05-07 18:23:57.964336+0800 ITSMOB3_LYT[44206:5808624]  | JIGUANG | I - [JIGUANGClientController] Action - jpush setup
2018-05-07 18:23:57.964958+0800 ITSMOB3_LYT[44206:5808625]  | JIGUANG | I - [JIGUANGClientController] Action - setup
2018-05-07 18:23:58.344453+0800 ITSMOB3_LYT[44206:5808627]  | JIGUANG | W - [JIGUANGService] 请将JPush的初始化方法,添加到[UIApplication application: didFinishLaunchingWithOptions:]方法中,否则JPush将不能准确的统计到通知的点击数量。参考文档:https://docs.jiguang.cn/jpush/client/iOS/ios_guide_new/#_6
2018-05-07 18:23:58.360728+0800 ITSMOB3_LYT[44206:5808628]  | JIGUANG | D - [JIGUANGPageFlow] trySetupSession
2018-05-07 18:23:58.364672+0800 ITSMOB3_LYT[44206:5808628]  | JIGUANG | D - [JIGUANGPageFlow] setupSession
2018-05-07 18:23:58.380908+0800 ITSMOB3_LYT[44206:5808626]  | JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession
2018-05-07 18:23:58.383543+0800 ITSMOB3_LYT[44206:5808626]  | JIGUANG | D - [JIGUANGPageFlow] setupSession
2018-05-07 18:23:58.385435+0800 ITSMOB3_LYT[44206:5808626]  | JIGUANG | D - [JIGUANGPageFlow] resetCurrentPage
2018-05-07 18:24:00.718074+0800 ITSMOB3_LYT[44206:5808524] Status bar could not find cached time string image. Rendering in-process.
2018-05-07 18:24:00.775877+0800 ITSMOB3_LYT[44206:5808524] Resetting plugins due to page load.
2018-05-07 18:24:02.518387+0800 ITSMOB3_LYT[44206:5808624]  | 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-05-07 18:24:02.813243+0800 ITSMOB3_LYT[44206:5808625] NSURLConnection finished with error - code -1100
2018-05-07 18:24:02.818204+0800 ITSMOB3_LYT[44206:5808625] NSURLConnection finished with error - code -1100
2018-05-07 18:24:03.254532+0800 ITSMOB3_LYT[44206:5808643] CoreAnimation: [EAGLContext renderbufferStorage:fromDrawable:] was called from a non-main thread in an implicit transaction! Note that this may be unsafe without an explicit CATransaction or a call to [CATransaction flush].
2018-05-07 18:24:03.800067+0800 ITSMOB3_LYT[44206:5808524] ### pluginInitialize
2018-05-07 18:24:03.800134+0800 ITSMOB3_LYT[44206:5808524] ERROR: Method 'init:' not defined in Plugin 'JPushPlugin'
2018-05-07 18:24:03.800976+0800 ITSMOB3_LYT[44206:5808688]  | JIGUANG | D - [JIGUANGService] Action - registrationID
2018-05-07 18:24:04.437801+0800 ITSMOB3_LYT[44206:5808627]  | 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-05-07 18:24:06.311826+0800 ITSMOB3_LYT[44206:5808524] Ionic Native: deviceready event fired after 2613 ms
2018-05-07 18:24:06.347995+0800 ITSMOB3_LYT[44206:5808524] Finished load of: file:///var/containers/Bundle/Application/371603AC-043B-4FC9-A6C2-B616E6C07758/ITSMOB3_LYT.app/www/index.html
2018-05-07 18:24:06.356408+0800 ITSMOB3_LYT[44206:5808524] Status bar could not find cached time string image. Rendering in-process.
2018-05-07 18:24:06.436239+0800 ITSMOB3_LYT[44206:5808716]  | 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-05-07 18:24:08.439774+0800 ITSMOB3_LYT[44206:5808735]  | 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-05-07 18:24:10.438092+0800 ITSMOB3_LYT[44206:5808716]  | 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-05-07 18:24:13.903025+0800 ITSMOB3_LYT[44206:5808734]  | JIGUANG | D - [JIGUANGSessionController] remove queued tcp request seq rid 7

(Alias) #18

这是打印的日志,不知道有没有帮助


#19

看到版本的 3.0.7+1.1.6,那没有那个问题,不过你这个日志里面没看到有集成成功的信息,提示了获取不到 token


(Alias) #20

的确是没有获取到DeviceToken


(Alias) #21

用ionic cordova run ios可以获取Token和设置alias;
但是Xcode运行就不会获取Token(获取Token为空),setAlias提示6002,间隔60秒重设依然是6002


(Alias) #22

这是JPushConfig.plist的设置


(Alias) #23

类似这种问题需要怎么处理呢,是要更换jpush plugin,还是降低Xcode或iOS的版本,或者修改某些配置?


(HuminiOS) #24
  1. 检查一下 xcode 的 bundleid 是否正确,
  2. Capabilities->PushNotifications 是否点开。

(Alias) #25

这块绝对是不会出错的,刚才我rm掉ios和jpush的plugin,然后重新add,Xcode直接运行可以获取token和setAlias,但是是打包后还是不能获取token设置别名


(Alias) #26

不知道是不是跟我的自动签名有关


(Alias) #27

现在改成手动签名,问题依然存在,是不是需要某些特殊的配置


(HuminiOS) #28

编译选项选择 release 可以正常获取 token 和 setTag 吗?


(Alias) #29

是指的这块吗


(Alias) #30

build configuration改成release后,获取不到Token了


(Alias) #31

换回debug后,删除APP,重装就可以获取Token