diff --git a/src/ios/Plugins/AppDelegate+JPush.m b/src/ios/Plugins/AppDelegate+JPush.m index efc08fa..301638e 100644 --- a/src/ios/Plugins/AppDelegate+JPush.m +++ b/src/ios/Plugins/AppDelegate+JPush.m @@ -35,7 +35,10 @@ NSDictionary *_launchOptions; _jpushEventCache = @{}.mutableCopy; } - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jpushSDKDidLoginNotification) name:kJPFNetworkDidRegisterNotification object:nil]; + [JPUSHService registrationIDCompletionHandler:^(int resCode, NSString *registrationID) { + NSDictionary *event = @{@"registrationId": registrationID?:@""}; + [JPushPlugin fireDocumentEvent:JPushDocumentEvent_receiveRegistrationId jsString:[event toJsonString]]; + }]; if (notification) { if (notification.userInfo) {