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{
|
-(void)setTagsWithAlias:(CDVInvokedUrlCommand*)command{
|
||||||
NSString *alias = [command argumentAtIndex:0];
|
NSString *alias = [command argumentAtIndex:0];
|
||||||
NSArray *tags = [command argumentAtIndex:1];
|
NSArray *tags = [command argumentAtIndex:1];
|
||||||
|
|
||||||
[JPUSHService setTags:[NSSet setWithArray:tags]
|
[JPUSHService setTags:[NSSet setWithArray:tags]
|
||||||
alias:alias
|
alias:alias
|
||||||
fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
|
fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
|
||||||
CDVPluginResult *result;
|
CDVPluginResult *result;
|
||||||
if (iResCode == 0) {
|
if (iResCode == 0) {
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
|
||||||
} else {
|
} else {
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
||||||
}
|
}
|
||||||
|
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)setTags:(CDVInvokedUrlCommand*)command{
|
-(void)setTags:(CDVInvokedUrlCommand*)command{
|
||||||
NSArray *tags = command.arguments;
|
NSArray *tags = command.arguments;
|
||||||
[JPUSHService setTags:[NSSet setWithArray:tags]
|
[JPUSHService setTags:[NSSet setWithArray:tags]
|
||||||
alias:nil
|
alias:nil
|
||||||
fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
|
fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
|
||||||
CDVPluginResult *result;
|
CDVPluginResult *result;
|
||||||
if (iResCode == 0) {
|
if (iResCode == 0) {
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
|
||||||
} else {
|
} else {
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
||||||
}
|
}
|
||||||
|
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)setAlias:(CDVInvokedUrlCommand*)command{
|
-(void)setAlias:(CDVInvokedUrlCommand*)command{
|
||||||
NSString *alias = [command argumentAtIndex:0];
|
NSString *alias = [command argumentAtIndex:0];
|
||||||
[JPUSHService setTags:nil
|
[JPUSHService setTags:nil
|
||||||
alias:alias
|
alias:alias
|
||||||
fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
|
fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
|
||||||
CDVPluginResult *result;
|
CDVPluginResult *result;
|
||||||
if (iResCode == 0) {
|
if (iResCode == 0) {
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
|
||||||
} else {
|
} else {
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
|
||||||
}
|
}
|
||||||
|
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,11 +347,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark 设置标签及别名回调
|
#pragma mark 设置标签及别名回调
|
||||||
-(void)tagsWithAliasCallback:(int)resultCode tags:(NSSet *)tags alias:(NSString *)alias {
|
-(void)tagsWithAliasCallback:(int)resultCode tags:(NSSet *)tags alias:(NSString *)alias {
|
||||||
if (resultCode == 0) { // Success
|
if (resultCode == 0) { // Success
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user