Remove deprecated method

setTagsWithAlias
This commit is contained in:
Hevin 2017-10-13 10:12:16 +08:00
parent 1c3228848b
commit 6283cb26f6
4 changed files with 1 additions and 54 deletions

View File

@ -527,24 +527,6 @@ public class JPushPlugin extends CordovaPlugin {
eventCallbackMap.put(sequence, callbackContext);
}
void setTagsWithAlias(JSONArray data, CallbackContext callbackContext) {
HashSet<String> tags = new HashSet<String>();
String alias;
try {
alias = data.getString(0);
JSONArray tagsArray = data.getJSONArray(1);
for (int i = 0; i < tagsArray.length(); i++) {
tags.add(tagsArray.getString(i));
}
JPushInterface.setAliasAndTags(mContext,
alias, tags, mTagWithAliasCallback);
callbackContext.success();
} catch (JSONException e) {
e.printStackTrace();
callbackContext.error("Error reading tagAlias JSON");
}
}
void getConnectionState(JSONArray data, CallbackContext callback) {
boolean isConnected = JPushInterface.getConnectionState(cordovaActivity.getApplicationContext());
callback.success(String.valueOf(isConnected));
@ -553,8 +535,7 @@ public class JPushPlugin extends CordovaPlugin {
/**
* 自定义通知行为声音震动呼吸灯等
*/
void setBasicPushNotificationBuilder(JSONArray data,
CallbackContext callbackContext) {
void setBasicPushNotificationBuilder(JSONArray data, CallbackContext callbackContext) {
BasicPushNotificationBuilder builder = new BasicPushNotificationBuilder(
this.cordova.getActivity());
builder.developerArg0 = "Basic builder 1";

View File

@ -17,8 +17,6 @@
//以下为js中可调用接口
//设置标签、别名
-(void)setTagsWithAlias:(CDVInvokedUrlCommand*)command;
-(void)setTags:(CDVInvokedUrlCommand*)command;
-(void)addTags:(CDVInvokedUrlCommand*)command;
-(void)deleteTags:(CDVInvokedUrlCommand*)command;
@ -76,7 +74,6 @@
/*
* js中可监听到的事件
* jpush.openNotification app
* jpush.setTagsWithAlias
* jpush.receiveMessage
* jpush.receiveNotification
* jpush.backgroundNotification

View File

@ -87,23 +87,6 @@
});
}
-(void)setTagsWithAlias:(CDVInvokedUrlCommand*)command{
NSString *alias = [command argumentAtIndex:0];
NSArray *tags = [command argumentAtIndex:1];
[JPUSHService setTags:[NSSet setWithArray:tags]
alias:alias
fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
CDVPluginResult *result;
if (iResCode == 0) {
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
} else {
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
}
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
}];
}
-(void)setTags:(CDVInvokedUrlCommand*)command {
NSDictionary* params = [command.arguments objectAtIndex:0];
NSNumber* sequence = params[@"sequence"];

View File

@ -70,20 +70,6 @@ JPushPlugin.prototype.clearLocalNotifications = function () {
}
}
JPushPlugin.prototype.setTagsWithAlias = function (tags, alias, successCallback, errorCallback) {
if (tags == null) {
this.setAlias(alias)
return
}
if (alias == null) {
this.setTags(tags)
return
}
var arrayTagWithAlias = [tags]
arrayTagWithAlias.unshift(alias)
this.callNative('setTagsWithAlias', arrayTagWithAlias, successCallback, errorCallback)
}
/**
* 设置标签
* 注意该接口是覆盖逻辑而不是增量逻辑即新的调用会覆盖之前的设置