Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios set tag失败 #285

Closed
DouSN opened this issue Jul 26, 2017 · 20 comments
Closed

ios set tag失败 #285

DouSN opened this issue Jul 26, 2017 · 20 comments

Comments

@DouSN
Copy link

DouSN commented Jul 26, 2017

将jupsh集成到项目后,项目启动后设置tag和别名失败进入失败回调函数,但是可以收到极光后台推送的消息,请问这是什么原因?

@huangminlinux
Copy link
Contributor

有日志吗?

@huangminlinux
Copy link
Contributor

有一个登录事件, 一般需要在登录后执行 setTag 之类的操作

@DouSN
Copy link
Author

DouSN commented Jul 26, 2017

是在登录后调用的setTag, 调用后进入了失败回调,没有错误信息,另外getRegistrationID也可以获取到信息

@huangminlinux
Copy link
Contributor

tag 和 alias 不能有一些特殊字符,还有一些其他限制。
https://docs.jiguang.cn/jpush/client/iOS/ios_api/ 参考官方文档看看参数有没有问题

@DouSN
Copy link
Author

DouSN commented Jul 26, 2017

确认tag和alias没有问题,会不会是因为应用签名方面的问题?

@DouSN
Copy link
Author

DouSN commented Jul 26, 2017

setTag返回 code 6002,是网络原因? 我换了手机和网络还是不行

@huangminlinux
Copy link
Contributor

换成 4G 网络看看还有这个问题吗?

@DouSN
Copy link
Author

DouSN commented Jul 26, 2017

1.试过4g也是这样,
2. ios 可以收到极光后台推送消息并可以监听到。 但networkDidSetup,networkDidClose,networkDidRegister,networkDidLogin这几个事件都没有监听到
3.测试了安卓手机,第一次启动应用时JPushModule.addGetRegistrationIdListener 过了几分钟才收到回调事件, 之后在setTag就可以

@huangminlinux
Copy link
Contributor

还是希望能提供完整的日志信息, 不然不好排查问题

@DouSN
Copy link
Author

DouSN commented Jul 27, 2017

请问react native 的jpush日志怎么查看

@huangminlinux
Copy link
Contributor

xcode 底部

9379a047-ffed-4efa-8cf4-9b6d38962cde

@DouSN
Copy link
Author

DouSN commented Jul 27, 2017

日志信息如下:
2017-07-27 17:46:55.595046+0800 app_name[1680:532262] You've implemented -[ application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
2017-07-27 17:46:55.617383+0800 app_name[1680:532297] | JIGUANG | I - [JIGUANGService]
--------------------------- JPush Log ----------------------------
--------------------JPush SDK Version:3.0.5--build:36----------
--------------------JCore Lib Version:1.1.5--build:25----------
-----------------AppKey:*----------------

2017-07-27 17:46:55.618223+0800 app_name[1680:532295] | JIGUANG | I - [JIGUANGClientController] Action - jpush setup
2017-07-27 17:46:55.618855+0800 app_name[1680:532295] | JIGUANG | I - [JIGUANGClientController] Action - setup
2017-07-27 17:46:55.642 [info][tid:main][RCTCxxBridge.mm:186] Initializing <RCTCxxBridge: 0x1743a0fc0> (parent: <RCTBridge: 0x1740b3440>, executor: (null))
2017-07-27 17:46:55.642677+0800 app_name[1680:532262] Initializing <RCTCxxBridge: 0x1743a0fc0> (parent: <RCTBridge: 0x1740b3440>, executor: (null))
2017-07-27 17:46:55.655 [warn][tid:main][RCTBridge.m:114] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2017-07-27 17:46:55.654843+0800 app_name[1680:532262] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2017-07-27 17:46:55.672 [info][tid:main][RCTRootView.m:302] Running application app_name ({
initialProps = {
};
rootTag = 1;
})
2017-07-27 17:46:55.671920+0800 app_name[1680:532262] Running application app_name ({
initialProps = {
};
rootTag = 1;
})
2017-07-27 17:46:55.688387+0800 app_name[1680:532302] [] nw_connection_get_connected_socket_block_invoke 2 Connection has no connected handler
2017-07-27 17:46:55.880 [warn][tid:com.facebook.react.JavaScript] Warning: React.createClass is no longer supported. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement. (https://fb.me/migrating-from-react-create-class)
2017-07-27 17:46:55.880413+0800 app_name[1680:532308] Warning: React.createClass is no longer supported. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement. (https://fb.me/migrating-from-react-create-class)
2017-07-27 17:46:55.889354+0800 app_name[1680:532295] | JIGUANG | I - [JIGUANGSessionController] connecting with coreAddr 121.46.20.43,port 7002
2017-07-27 17:46:55.892 [info][tid:com.facebook.react.JavaScript] Running application "app_name" with appParams: {"rootTag":1,"initialProps":{}}. DEV === true, development-level warning are ON, performance optimizations are OFF
2017-07-27 17:46:55.892234+0800 app_name[1680:532308] Running application "app_name" with appParams: {"rootTag":1,"initialProps":{}}. DEV === true, development-level warning are ON, performance optimizations are OFF
2017-07-27 17:46:55.894758+0800 app_name[1680:532302] [] nw_connection_get_connected_socket_block_invoke 4 Connection has no connected handler
2017-07-27 17:46:56.053444+0800 app_name[1680:532312] | JIGUANG | I - [JIGUANGLogin]
----- login result -----
uid:*
registrationID:*
2017-07-27 17:46:57.144442+0800 app_name[1680:532262] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-07-27 17:46:57.145477+0800 app_name[1680:532262] [MC] Reading from public effective user settings.
2017-07-27 17:46:57.839806+0800 app_name[1680:532294] [] nw_connection_get_connected_socket_block_invoke 6 Connection has no connected handler
2017-07-27 17:46:57.972424+0800 app_name[1680:532302] [] nw_connection_get_connected_socket_block_invoke 7 Connection has no connected handler
2017-07-27 17:46:59.985089+0800 app_name[1680:532312] [] nw_connection_get_connected_socket_block_invoke 8 Connection has no connected handler
2017-07-27 17:47:00.025784+0800 app_name[1680:532292] [] nw_connection_get_connected_socket_block_invoke 9 Connection has no connected handler
2017-07-27 17:47:00.574828+0800 app_name[1680:532294] 0x170147900 Copy matching assets reply: XPC_TYPE_DICTIONARY <dictionary: 0x170147900> { count = 1, transaction: 0, voucher = 0x0, contents =
"Result" => <int64: 0x1702357e0>: 29
}
2017-07-27 17:47:00.576373+0800 app_name[1680:532294] 0x1701479b0 Daemon configuration query reply: XPC_TYPE_DICTIONARY <dictionary: 0x1701479b0> { count = 2, transaction: 0, voucher = 0x0, contents =
"Dictionary" => <dictionary: 0x170147d20> { count = 1, transaction: 0, voucher = 0x0, contents =
"ServerURL" => <dictionary: 0x170147bc0> { count = 3, transaction: 0, voucher = 0x0, contents =
"com.apple.CFURL.magic" => <uuid: 0x170453800> C3853DCC-9776-4114-B6C1-FD9F51944A6D
"com.apple.CFURL.string" => <string: 0x1704537a0> { length = 30, contents = "https://mesu.apple.com/assets/" }
"com.apple.CFURL.base" => <null: 0x1a9892e80>: null-object
}
}
"Result" => <int64: 0x1702379a0>: 0
}
2017-07-27 17:47:00.576606+0800 app_name[1680:532294] [MobileAssetError:29] Unable to copy asset information from https://mesu.apple.com/assets/ for asset type com.apple.MobileAsset.TextInput.SpellChecker
2017-07-27 17:47:02.004345+0800 app_name[1680:532297] [] nw_connection_get_connected_socket_block_invoke 10 Connection has no connected handler
2017-07-27 17:47:02.014 [info][tid:com.facebook.react.JavaScript] fail
2017-07-27 17:47:02.013842+0800 app_name[1680:532308] fail
2017-07-27 17:47:02.014 [info][tid:com.facebook.react.JavaScript] fail set tag
2017-07-27 17:47:02.014282+0800 app_name[1680:532308] fail set tag
2017-07-27 17:47:02.219569+0800 app_name[1680:532295] [] nw_connection_get_connected_socket_block_invoke 11 Connection has no connected handler

@huangminlinux
Copy link
Contributor

看日志已经集成成功了,

能提供 setTag 的代码吗? 我看看参数有没问题

@DouSN
Copy link
Author

DouSN commented Jul 28, 2017

我用demo中的代码setTag也是失败的

@huangminlinux
Copy link
Contributor

还有一点要注意的是,这个接口有频率限制,两个请求不能隔着

@DouSN
Copy link
Author

DouSN commented Jul 29, 2017

重新尝试了很多次还是不行,下面是我的详细操作流程,帮忙看下是否存问题,谢谢。

  1. 在apple develope创建appId, 然后Certificates中添加Apple Push Notification service SSL (Sandbox),下载生成的证书,导出p12文件。在Provisioning Profiles中创建新的描述文件。
    2.在极光官网创建新的应用,将p12文件上传。
    3.react-native init jpushTest, 然后安装配置,将jpush-react-native/example/react-native-iOS/set_activity.js复制到项目中。 确定在此过程中bundleID保持一致。在极光后台发送推送可以收到
    4.react-native run-ios,运行项目,输入tag 666点击setTag按钮,xcode日志中看不到错误信息,jsDebug可以看到set tag fail

xcode详细日志如下:
2017-07-29 16:00:27.567880+0800 jpushTest[2706:684285] You've implemented -[ application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
2017-07-29 16:00:27.641994+0800 jpushTest[2706:684332] | JIGUANG | I - [JIGUANGService]
--------------------------- JPush Log ----------------------------
--------------------JPush SDK Version:3.0.5--build:36----------
--------------------JCore Lib Version:1.1.5--build:25----------
-----------------AppKey:e2174ca0870ed927913f63b5----------------

2017-07-29 16:00:27.644093+0800 jpushTest[2706:684334] | JIGUANG | I - [JIGUANGClientController] Action - jpush setup
2017-07-29 16:00:27.646363+0800 jpushTest[2706:684334] | JIGUANG | I - [JIGUANGClientController] Action - setup
2017-07-29 16:00:27.744 [info][tid:main][RCTCxxBridge.mm:186] Initializing <RCTCxxBridge: 0x1701aefc0> (parent: <RCTBridge: 0x1700b5720>, executor: (null))
2017-07-29 16:00:27.745818+0800 jpushTest[2706:684285] Initializing <RCTCxxBridge: 0x1701aefc0> (parent: <RCTBridge: 0x1700b5720>, executor: (null))
2017-07-29 16:00:27.821 [warn][tid:main][RCTBridge.m:114] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2017-07-29 16:00:27.821148+0800 jpushTest[2706:684285] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2017-07-29 16:00:27.867 [info][tid:main][RCTRootView.m:302] Running application jpushTest ({
initialProps = {
};
rootTag = 1;
})
2017-07-29 16:00:27.867709+0800 jpushTest[2706:684285] Running application jpushTest ({
initialProps = {
};
rootTag = 1;
})
2017-07-29 16:00:27.994 [info][tid:main][RCTCxxBridge.mm:186] Initializing <RCTCxxBridge: 0x1741afdc0> (parent: <RCTBridge: 0x1700b5720>, executor: RCTWebSocketExecutor)
2017-07-29 16:00:27.993775+0800 jpushTest[2706:684285] Initializing <RCTCxxBridge: 0x1741afdc0> (parent: <RCTBridge: 0x1700b5720>, executor: RCTWebSocketExecutor)
2017-07-29 16:00:28.117945+0800 jpushTest[2706:684357] | JIGUANG | D - [JIGUANGUserActiveReport] report content {
activities = (
);
date = "2017-07-29";
duration = "846.1";
itime = 1501315126;
"session_id" = 625a4055d40a75188ca6957e51cab251;
time = "15:58:46";
timezone = "+8";
type = "active_terminate";
}
2017-07-29 16:00:28.153286+0800 jpushTest[2706:684334] | JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession
2017-07-29 16:00:28.156680+0800 jpushTest[2706:684334] | JIGUANG | D - [JIGUANGPageFlow] setupSession
2017-07-29 16:00:28.176193+0800 jpushTest[2706:684358] | JIGUANG | D - [JIGUANGPageFlow] resetCurrentPage
2017-07-29 16:00:28.204815+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGUserDefaultsController] Action - setCurrentDeviceToken - 2d92b029c08c0973c1a7c66108faaa1e322863113b210a2aeed81cfe510ede48
2017-07-29 16:00:28.206006+0800 jpushTest[2706:684332] | JIGUANG | D - [JIGUANGNetworkController] Action - trySetupSession
2017-07-29 16:00:28.207082+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGHttpSessionController] Action - setupSession
2017-07-29 16:00:28.208394+0800 jpushTest[2706:684332] | JIGUANG | D - [JIGUANGNetworkController] userDefaut verified: 1, curNetworkStatus: 2
2017-07-29 16:00:28.209418+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPFNetworkIsConnectingNotification (null)
2017-07-29 16:00:28.210853+0800 jpushTest[2706:684332] | JIGUANG | D - [JIGUANGSessionController] Action - connect
2017-07-29 16:00:28.212229+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGSessionController] Action - isSisOnProtect
2017-07-29 16:00:28.213308+0800 jpushTest[2706:684332] | JIGUANG | D - [JIGUANGSessionController] sis is not on protect
2017-07-29 16:00:28.214118+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGSessionController] Action - reset sis cache
2017-07-29 16:00:28.215835+0800 jpushTest[2706:684332] | JIGUANG | D - [JIGUANGAddressController] 开始Sis解析
2017-07-29 16:00:28.217119+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest
2017-07-29 16:00:28.252939+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGAddressController] get address :103.229.215.61 from host : s.jpush.cn
2017-07-29 16:00:28.254655+0800 jpushTest[2706:684332] | JIGUANG | D - [JIGUANGAddressController] Action - sendSisRequest:toDefaultPort
2017-07-29 16:00:28.255836+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:
2017-07-29 16:00:28.340432+0800 jpushTest[2706:684354] | JIGUANG | D - [JIGUANGUdpSocket] send udp data
2017-07-29 16:00:28.346364+0800 jpushTest[2706:684332] | JIGUANG | D - [JIGUANGUdpSocket] send udp data succeed
2017-07-29 16:00:28.354327+0800 jpushTest[2706:684354] | JIGUANG | D - [JIGUANGUdpSocket] udp socket begin send behavior
2017-07-29 16:00:28.462458+0800 jpushTest[2706:684351] | JIGUANG | D - [JIGUANGAddressController] Action - parse
2017-07-29 16:00:28.533754+0800 jpushTest[2706:684351] | JIGUANG | D - [JIGUANGAddressController] Action - parse ips address
2017-07-29 16:00:28.730167+0800 jpushTest[2706:684351] | JIGUANG | D - [JIGUANGAddressController] Action - parseOptionAddress
2017-07-29 16:00:28.731354+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGUdpSocket] close udp socket,info:
2017-07-29 16:00:28.740680+0800 jpushTest[2706:684354] | JIGUANG | D - [JIGUANGAddressController] receive sis result
2017-07-29 16:00:28.754015+0800 jpushTest[2706:684353] | JIGUANG | D - [JIGUANGSessionController] Action - connectTcp
2017-07-29 16:00:28.755547+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGSessionController] Action - connectTcpAddress:
2017-07-29 16:00:28.757976+0800 jpushTest[2706:684353] | JIGUANG | D - [JIGUANGSessionController] connectTcp:121.46.25.196:7005
2017-07-29 16:00:28.759142+0800 jpushTest[2706:684333] | JIGUANG | I - [JIGUANGSessionController] connecting with coreAddr 121.46.25.196,port 7005
2017-07-29 16:00:28.856462+0800 jpushTest[2706:684334] | JIGUANG | D - [JIGUANGReport] send report:(
{
date = "2017-07-29";
itime = 1501315227;
"session_id" = ff4389c1019ad1e318d7b622fd255802;
time = "16:00:27";
timezone = "+8";
type = "active_launch";
}
) log succed
2017-07-29 16:00:28.859940+0800 jpushTest[2706:684331] | JIGUANG | D - [JIGUANGTcpSocket] 连接主机成功
2017-07-29 16:00:28.869514+0800 jpushTest[2706:684354] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPUSHNetworkDidSetupNotification (null)
2017-07-29 16:00:28.946922+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGSessionController] Action - doSendTcpRequest
2017-07-29 16:00:28.980849+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGReport] send report:(
{
activities = (
);
date = "2017-07-29";
duration = "846.1";
itime = 1501315126;
"session_id" = 625a4055d40a75188ca6957e51cab251;
time = "15:58:46";
timezone = "+8";
type = "active_terminate";
}
) log succed
2017-07-29 16:00:29.097673+0800 jpushTest[2706:684333] | JIGUANG | I - [JIGUANGLogin]
----- login result -----
uid:10313316269
registrationID:161a3797c830da9c0ae
2017-07-29 16:00:29.103755+0800 jpushTest[2706:684334] | JIGUANG | D - [JIGUANGTcpSocket] Got tcp command
2017-07-29 16:00:29.105307+0800 jpushTest[2706:684351] | JIGUANG | D - [JIGUANGSessionController] Action - onAckOrRespReceived:
2017-07-29 16:00:29.108129+0800 jpushTest[2706:684351] | JIGUANG | D - [JIGUANGSessionController] Event - onLoginRespond
2017-07-29 16:00:29.115717+0800 jpushTest[2706:684334] | JIGUANG | D - [JIGUANGUtilities] JCOREPostNotificationWithUserInfo name: kJPUSHNetworkDidLoginNotification (null)
2017-07-29 16:00:29.180 [info][tid:main][RCTRootView.m:302] Running application jpushTest ({
initialProps = {
};
rootTag = 1;
})
2017-07-29 16:00:29.180025+0800 jpushTest[2706:684285] Running application jpushTest ({
initialProps = {
};
rootTag = 1;
})
2017-07-29 16:00:29.584821+0800 jpushTest[2706:684358] [] nw_connection_get_connected_socket_block_invoke 9 Connection has no connected handler
2017-07-29 16:00:32.936317+0800 jpushTest[2706:684333] [] nw_connection_get_connected_socket_block_invoke 10 Connection has no connected handler
2017-07-29 16:00:33.039829+0800 jpushTest[2706:684285] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-07-29 16:00:33.046277+0800 jpushTest[2706:684285] [MC] Reading from public effective user settings.
2017-07-29 16:00:46.860489+0800 jpushTest[2706:684464] [] nw_connection_get_connected_socket_block_invoke 11 Connection has no connected handler
2017-07-29 16:00:46.876333+0800 jpushTest[2706:684332] | JIGUANG | D - [JIGUANGService] Action - setTags: (null) alias: 666 fetchCompletionHandle:
2017-07-29 16:00:46.904774+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGSessionController] Action - doSendTcpRequest
2017-07-29 16:00:46.945632+0800 jpushTest[2706:684332] | JIGUANG | D - [JIGUANGTcpSocket] Got tcp command
2017-07-29 16:00:46.947926+0800 jpushTest[2706:684333] | JIGUANG | D - [JIGUANGSessionController] Action - onAckOrRespReceived:
2017-07-29 16:00:47.720368+0800 jpushTest[2706:684332] | JIGUANG | D - [JIGUANGTcpSocket] Got tcp command
2017-07-29 16:05:19.153924+0800 jpushTest[2706:684824] | JIGUANG | D - [JIGUANGSessionController] Action - doSendTcpRequest
2017-07-29 16:05:19.223196+0800 jpushTest[2706:684824] | JIGUANG | D - [JIGUANGTcpSocket] Got tcp command
2017-07-29 16:05:19.224942+0800 jpushTest[2706:684696] | JIGUANG | D - [JIGUANGSessionController] Action - onAckOrRespReceived:
2017-07-29 16:08:22.082488+0800 jpushTest[2706:685498] | JIGUANG | D - [JIGUANGPageFlow] savePageFlowWithTime

@huangminlinux
Copy link
Contributor

huangminlinux commented Jul 29, 2017

这是我 Q:380108184, 可以吧你的测试项目发一份,我看看

@huangminlinux
Copy link
Contributor

问题是 3.0.5 不兼容 1.1.5 的 jcore, 下个版本会发布 jpush 新版本来支持。

jcore 插件 可以回会退到之前版本,运行下面代码。

npm install jcore-react-native@1.1.5 --save

@DouSN
Copy link
Author

DouSN commented Jul 31, 2017

问题解决,非常感谢您的帮助。

@DouSN DouSN closed this as completed Jul 31, 2017
@arniu
Copy link
Contributor

arniu commented Dec 27, 2017

@pingxiaodou @huangminlinux

请问 Connection has no connected handler 这个问题是怎么解决的?

已找到解决方案,具体可见:Issue 10027

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants