mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-19 22:55:02 +08:00
fix setTags/Alias bug
This commit is contained in:
parent
c72cde6632
commit
2df6ea47a8
@ -99,44 +99,47 @@
|
||||
-(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];
|
||||
}
|
||||
|
||||
[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{
|
||||
NSArray *tags = command.arguments;
|
||||
[JPUSHService setTags:[NSSet setWithArray:tags]
|
||||
alias:nil
|
||||
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];
|
||||
}
|
||||
NSArray *tags = command.arguments;
|
||||
[JPUSHService setTags:[NSSet setWithArray:tags]
|
||||
alias:nil
|
||||
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)setAlias:(CDVInvokedUrlCommand*)command{
|
||||
NSString *alias = [command argumentAtIndex:0];
|
||||
[JPUSHService setTags:nil
|
||||
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];
|
||||
}
|
||||
[JPUSHService setTags:nil
|
||||
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];
|
||||
}];
|
||||
}
|
||||
|
||||
@ -344,11 +347,11 @@
|
||||
}
|
||||
|
||||
#pragma mark 设置标签及别名回调
|
||||
-(void)tagsWithAliasCallback:(int)resultCode tags:(NSSet *)tags alias:(NSString *)alias {
|
||||
if (resultCode == 0) { // Success
|
||||
|
||||
} else {
|
||||
|
||||
-(void)tagsWithAliasCallback:(int)resultCode tags:(NSSet *)tags alias:(NSString *)alias {
|
||||
if (resultCode == 0) { // Success
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user