Update tag & alias api

This commit is contained in:
Hevin 2017-09-22 20:08:37 +08:00
parent e71c6f3505
commit 7afb705555
3 changed files with 18 additions and 19 deletions

View File

@ -58,7 +58,7 @@ public class JPushEventReceiver extends JPushMessageReceiver {
} else {
try {
resultJson.put("errorCode", jPushMessage.getErrorCode());
resultJson.put("code", jPushMessage.getErrorCode());
} catch (JSONException e) {
e.printStackTrace();
}
@ -99,7 +99,7 @@ public class JPushEventReceiver extends JPushMessageReceiver {
} else {
try {
resultJson.put("errorCode", jPushMessage.getErrorCode());
resultJson.put("code", jPushMessage.getErrorCode());
} catch (JSONException e) {
e.printStackTrace();
}
@ -143,7 +143,7 @@ public class JPushEventReceiver extends JPushMessageReceiver {
} else {
try {
resultJson.put("errorCode", jPushMessage.getErrorCode());
resultJson.put("code", jPushMessage.getErrorCode());
} catch (JSONException e) {
e.printStackTrace();
}

View File

@ -116,11 +116,11 @@
CDVPluginResult* result;
if (iResCode == 0) { // success
if (iResCode == 0) {
[dic setObject:[iTags allObjects] forKey:@"tags"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dic];
} else {
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"errorCode"];
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"code"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:dic];
}
@ -140,11 +140,11 @@
CDVPluginResult* result;
if (iResCode == 0) { // success
if (iResCode == 0) {
[dic setObject:[iTags allObjects] forKey:@"tags"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dic];
} else {
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"errorCode"];
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"code"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:dic];
}
@ -164,11 +164,11 @@
CDVPluginResult* result;
if (iResCode == 0) { // success
if (iResCode == 0) {
[dic setObject:[iTags allObjects] forKey:@"tags"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dic];
} else {
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"errorCode"];
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"code"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:dic];
}
@ -189,7 +189,7 @@
if (iResCode == 0) {
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dic];
} else {
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"errorCode"];
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"code"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:dic];
}
@ -207,11 +207,11 @@
CDVPluginResult* result;
if (iResCode == 0) { // success
if (iResCode == 0) {
[dic setObject:[iTags allObjects] forKey:@"tags"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dic];
} else {
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"errorCode"];
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"code"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:dic];
}
@ -230,12 +230,12 @@
CDVPluginResult* result;
if (iResCode == 0) { // success
if (iResCode == 0) {
[dic setObject:[iTags allObjects] forKey:@"tags"];
[dic setObject:[NSNumber numberWithBool:isBind] forKey:@"isBind"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dic];
} else {
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"errorCode"];
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"code"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:dic];
}
@ -259,7 +259,7 @@
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dic];
} else {
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"errorCode"];
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"code"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:dic];
}
@ -280,7 +280,7 @@
if (iResCode == 0) {
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dic];
} else {
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"errorCode"];
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"code"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:dic];
}
@ -302,7 +302,7 @@
[dic setObject:iAlias forKey:@"alias"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:dic];
} else {
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"errorCode"];
[dic setValue:[NSNumber numberWithUnsignedInteger:iResCode] forKey:@"code"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:dic];
}

View File

@ -95,8 +95,7 @@ JPushPlugin.prototype.setTags = function (params, successCallback, errorCallback
}
/**
* 新增标签新增不代表设置
* 注意该接口是覆盖逻辑而不是增量逻辑即新的调用会覆盖之前的设置
* 新增标签
*
* @param params = { 'sequence': number, 'tags': ['tag1', 'tag2'] }
*/