mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-02-20 20:22:50 +08:00
Update tag & alias api
This commit is contained in:
parent
e71c6f3505
commit
7afb705555
@ -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();
|
||||
}
|
||||
|
@ -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];
|
||||
}
|
||||
|
||||
|
@ -95,8 +95,7 @@ JPushPlugin.prototype.setTags = function (params, successCallback, errorCallback
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增标签,新增不代表设置。
|
||||
* 注意:该接口是覆盖逻辑,而不是增量逻辑。即新的调用会覆盖之前的设置。
|
||||
* 新增标签。
|
||||
*
|
||||
* @param params = { 'sequence': number, 'tags': ['tag1', 'tag2'] }
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user