mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2026-04-19 00:03:45 +08:00
iOS - fix #194
This commit is contained in:
@@ -90,10 +90,8 @@
|
||||
object:nil];
|
||||
}
|
||||
|
||||
-(void)jpushFireDocumentEvent:(NSString*)eventName jsString:(NSString*)jsString{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.commandDelegate evalJs:[NSString stringWithFormat:@"cordova.fireDocumentEvent('jpush.%@',%@)", eventName, jsString]];
|
||||
});
|
||||
+(void)fireDocumentEvent:(NSString*)eventName jsString:(NSString*)jsString{
|
||||
[SharedJPushPlugin.commandDelegate evalJs:[NSString stringWithFormat:@"cordova.fireDocumentEvent('jpush.%@',%@)", eventName, jsString]];
|
||||
}
|
||||
|
||||
-(void)setTagsWithAlias:(CDVInvokedUrlCommand*)command{
|
||||
@@ -322,12 +320,12 @@
|
||||
@"tags" :tags == nil ? [NSNull null] : [tags allObjects],
|
||||
@"alias" :alias == nil ? [NSNull null] : alias
|
||||
};
|
||||
[self jpushFireDocumentEvent:JPushDocumentEvent_SetTagsWithAlias jsString:[dict toJsonString]];
|
||||
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_SetTagsWithAlias jsString:[dict toJsonString]];
|
||||
}
|
||||
|
||||
- (void)networkDidReceiveMessage:(NSNotification *)notification {
|
||||
if (notification && notification.userInfo) {
|
||||
[self jpushFireDocumentEvent:JPushDocumentEvent_ReceiveMessage jsString:[notification.userInfo toJsonString]];
|
||||
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_ReceiveMessage jsString:[notification.userInfo toJsonString]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user