Android JPush setAliasAndTags提示成功但查询不到问题

498226445
8年前 8k 0

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": []}

2个回答

热门排序
  • 你好,这个是目前我们一个策略限制,如果你短时间内,客户端设置接口和服务端的device api接口,对同一个regid进行相同反复操作,这个目前确实会有相应限制,也是一种安全措施考虑。不过考虑到可能会有这样需求,清明节后,我们会进行相关策略 展示全部
  • jiminy
    8年前
    你的提问信息不全,请重新编辑问题,补充如下信息:1.客户端设置tag、alias打印设置的值和返回code的日志;2.客户端调用接口获取registration id的日志;3.你服务端请求的json串和结果。 展示全部