Android JPush setAliasAndTags提示成功但查询不到问题
BUG描述:客户端为设备A设置alias和tags,服务端清除该rid的alias和tags。之后客户端再次设置和被清除的相同的alias和tags客户端会提示成功,但是api查询不到该rid的alias和tags(api设置可以设置成功且查询到 ),但是客户端设置不同的alias和tags会成功。
Android端设置tag使用接口:JPushInterface.setAliasAndTags(Context, alias, tags , callback);
api清除接口:public DefaultResult updateDeviceTagAlias(String registrationId, boolean clearAlias, boolean clearTag)
api查询接口:public TagAliasResult getDeviceTagAlias(String registrationId)
api设置接口:public DefaultResult updateDeviceTagAlias(String registrationId, String alias,
Set<String> tagsToAdd, Set<String> tagsToRemove)
Android端debug模式JPush相关日志如下:
03-30 14:25:23.801 25555-25588/com.creditease.creditlife D/JPush: [ConnectingHelper] SIS Receiving...
03-30 14:25:23.901 25555-25588/com.creditease.creditlife I/JPush: [ConnectingHelper] Get sis info succeed with host: s.jpush.cn
03-30 14:25:23.901 25555-25588/com.creditease.creditlife D/JPush: [ConnectingHelper] Open connection with main - ip:118.145.3.78, port:7006
03-30 14:25:23.911 25555-25588/com.creditease.creditlife I/JPush: [ConnectingHelper] Succeed to open connection - ip:118.145.3.78, port:7006
03-30 14:25:23.911 25555-25588/com.creditease.creditlife I/JPush: [ConnectingHelper] Login with - juid:4602679411, appKey:c9d24295baa89041ffccf601, sdkVersion:131078
03-30 14:25:23.921 25555-25588/com.creditease.creditlife I/JPush: [ConnectingHelper] Login succeed - sid:81605, serverTime;1459319127000
03-30 14:25:23.921 25555-25588/com.creditease.creditlife D/JPush: [ConnectingHelper] Action - sendServerTimer
03-30 14:25:23.961 25555-25588/com.creditease.creditlife D/JPush: [NetworkingClient] Network listening...
03-30 14:25:23.961 25555-25555/com.creditease.creditlife D/JPush: [PushService] Action - onLoggedIn - connection:547866267648
03-30 14:25:23.961 25555-25555/com.creditease.creditlife D/JPush: [ConnectingHelper] Action - sendConnectionChanged
03-30 14:25:23.961 25555-25555/com.creditease.creditlife D/JPush: [RequestingThread] Action - onLoggedIn
03-30 14:25:38.971 25555-25555/com.creditease.creditlife D/JPush: [PushService] Send heart beat
03-30 14:25:38.971 25555-25588/com.creditease.creditlife D/JPush: [NetworkingClient] Received bytes - len:31, connection:547866267648, pkg:com.creditease.creditlife
03-30 14:25:38.981 25555-25588/com.creditease.creditlife D/JPush: [NetworkingClient] Action - receivedCommand - cmd:19
03-30 14:25:38.981 25555-25588/com.creditease.creditlife D/JPush: [NetworkingClient] Network listening...
03-30 14:25:38.981 25555-25555/com.creditease.creditlife D/JPush: [PushService] Action - onHeartbeatSucceed - connection:547866267648
03-30 14:26:15.451 26369-26369/com.creditease.creditlife:remote D/JPush: [JPushInterface] action:init - sdkVersion:2.0.6, buildId:253
03-30 14:26:15.471 26369-26369/com.creditease.creditlife:remote D/JPush: [JPushGlobal] metadata: appKey - c9d24295baa89041ffccf601
03-30 14:26:15.471 26369-26369/com.creditease.creditlife:remote D/JPush: [JPushGlobal] metadata: channel - azsc
03-30 14:26:15.581 25555-25555/com.creditease.creditlife D/JPush: [PushService] onStartCommand - intent:Intent { act=cn.jpush.android.intent.INIT cmp=com.creditease.creditlife/cn.jpush.android.service.PushService (has extras) }, pkg:com.creditease.creditlife, connection:547866267648
03-30 14:26:15.581 25555-25555/com.creditease.creditlife D/JPush: [PushService] Action - handleServiceAction - action:cn.jpush.android.intent.INIT
03-30 14:26:20.111 25555-25555/com.creditease.creditlife D/JPushUtil: --->1459319180121---别名和Tags均正常,开始设置0
03-30 14:26:20.111 25555-25555/com.creditease.creditlife D/JPush: [JPushInterface] action:setAliasAndTags - alias:2, tags:bg2
03-30 14:26:20.121 25555-25555/com.creditease.creditlife D/JPush: [PushService] onStartCommand - intent:Intent { act=cn.jpush.android.intent.ALIAS_TAGS cmp=com.creditease.creditlife/cn.jpush.android.service.PushService (has extras) }, pkg:com.creditease.creditlife, connection:547866267648
03-30 14:26:20.121 25555-25555/com.creditease.creditlife D/JPush: [PushService] Action - handleServiceAction - action:cn.jpush.android.intent.ALIAS_TAGS
03-30 14:26:20.121 25555-25586/com.creditease.creditlife D/JPush: [RequestingThread] Action - sendRequestInternal - connection:547866267648, timeout:20000, threadId:1761
03-30 14:26:20.121 25555-25586/com.creditease.creditlife D/JPush: [RequestingThread] Action - sendCommandWithLoggedIn
03-30 14:26:20.121 25555-25586/com.creditease.creditlife D/JPush: [RequestingThread] Request params - cmd:10, sid:81605, juid:4602679411
03-30 14:26:20.131 25555-25588/com.creditease.creditlife D/JPush: [NetworkingClient] Received bytes - len:31, connection:547866267648, pkg:com.creditease.creditlife
03-30 14:26:20.131 25555-25588/com.creditease.creditlife D/JPush: [NetworkingClient] Action - receivedCommand - cmd:19
03-30 14:26:20.131 25555-25588/com.creditease.creditlife D/JPush: [NetworkingClient] Network listening...
03-30 14:26:20.771 25555-25588/com.creditease.creditlife D/JPush: [NetworkingClient] Received bytes - len:109, connection:547866267648, pkg:com.creditease.creditlife
03-30 14:26:20.771 25555-25588/com.creditease.creditlife D/JPush: [NetworkingClient] Action - receivedCommand - cmd:3
03-30 14:26:20.781 25555-25588/com.creditease.creditlife D/JPush: [NetworkingClient] Network listening...
03-30 14:26:20.781 25555-25555/com.creditease.creditlife D/JPushUtil: --->1459319180793---Set tag and alias success
api调用日志:
2016-03-30 14:40:54.781 DEBUG 2287 --- [pool-3-thread-2] h.api.common.connection.NativeHttpClient : Send request - GET https://device.jpush.cn/v3/devices/170976fa8a83528fc68
2016-03-30 14:40:55.207 DEBUG 2287 --- [pool-3-thread-2] cn.jpush.api.common.resp.ResponseWrapper : JPush API Rate Limiting params - quota:1200, remaining:1199, reset:60
2016-03-30 14:40:55.208 DEBUG 2287 --- [pool-3-thread-2] h.api.common.connection.NativeHttpClient : Succeed to get response OK - responseCode:200
2016-03-30 14:40:55.208 DEBUG 2287 --- [pool-3-thread-2] h.api.common.connection.NativeHttpClient : Response Content - {"mobile": null, "alias": null, "tags": []}
2016-03-30 14:41:42.405 DEBUG 2287 --- [pool-3-thread-3] h.api.common.connection.NativeHttpClient : Send request - POST https: //device.jpush.cn/v3/devices/170976fa8a83528fc68
2016-03-30 14:41:42.406 DEBUG 2287 --- [pool-3-thread-3] h.api.common.connection.NativeHttpClient : Request Content - {"alias":"2","tags":{"add":["bg2"]}}
2016-03-30 14:41:42.636 DEBUG 2287 --- [pool-3-thread-3] cn.jpush.api.common.resp.ResponseWrapper : JPush API Rate Limiting params - quota:1200, remaining:1198, reset:12
2016-03-30 14:41:42.636 DEBUG 2287 --- [pool-3-thread-3] h.api.common.connection.NativeHttpClient : Succeed to get response OK - responseCode:200
2016-03-30 14:41:42.636 DEBUG 2287 --- [pool-3-thread-3] h.api.common.connection.NativeHttpClient : Response Content -
2016-03-30 14:42:09.219 DEBUG 2287 --- [pool-3-thread-4] h.api.common.connection.NativeHttpClient : Send request - GET https://device.jpush.cn/v3/devices/170976fa8a83528fc68
2016-03-30 14:42:09.650 DEBUG 2287 --- [pool-3-thread-4] cn.jpush.api.common.resp.ResponseWrapper : JPush API Rate Limiting params - quota:1200, remaining:1199, reset:60
2016-03-30 14:42:09.650 DEBUG 2287 --- [pool-3-thread-4] h.api.common.connection.NativeHttpClient : Succeed to get response OK - responseCode:200
2016-03-30 14:42:09.650 DEBUG 2287 --- [pool-3-thread-4] h.api.common.connection.NativeHttpClient : Response Content - {"mobile": null, "alias": "2", "tags": ["bg2"]}
2016-03-30 14:42:14.237 DEBUG 2287 --- [pool-3-thread-5] h.api.common.connection.NativeHttpClient : Send request - POST https ://device.jpush.cn/v3/devices/170976fa8a83528fc68
2016-03-30 14:42:14.237 DEBUG 2287 --- [pool-3-thread-5] h.api.common.connection.NativeHttpClient : Request Content - {"alias":"","tags":""}
2016-03-30 14:42:14.459 DEBUG 2287 --- [pool-3-thread-5] cn.jpush.api.common.resp.ResponseWrapper : JPush API Rate Limiting params - quota:1200, remaining:1198, reset:55
2016-03-30 14:42:14.459 DEBUG 2287 --- [pool-3-thread-5] h.api.common.connection.NativeHttpClient : Succeed to get response OK - responseCode:200
2016-03-30 14:42:14.459 DEBUG 2287 --- [pool-3-thread-5] h.api.common.connection.NativeHttpClient : Response Content -
2016-03-30 14:42:16.772 DEBUG 2287 --- [pool-3-thread-6] h.api.common.connection.NativeHttpClient : Send request - GET https ://device.jpush.cn/v3/devices/170976fa8a83528fc68
2016-03-30 14:42:16.992 DEBUG 2287 --- [pool-3-thread-6] cn.jpush.api.common.resp.ResponseWrapper : JPush API Rate Limiting params - quota:1200, remaining:1197, reset:52
2016-03-30 14:42:16.992 DEBUG 2287 --- [pool-3-thread-6] h.api.common.connection.NativeHttpClient : Succeed to get response OK - responseCode:200
2016-03-30 14:42:16.992 DEBUG 2287 --- [pool-3-thread-6] h.api.common.connection.NativeHttpClient : Response Content - {"mobile": null, "alias": null, "tags": []}