mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-02-21 21:43:02 +08:00
ios add jpush.receiveRegistrationId event
This commit is contained in:
parent
266d0cb28f
commit
f5ea2b5b10
@ -38,6 +38,7 @@
|
||||
NSDictionary *_launchOptions;
|
||||
-(void)applicationDidLaunch:(NSNotification *)notification{
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jpushSDKDidLoginNotification) name:kJPFNetworkDidLoginNotification object:nil];
|
||||
|
||||
if (notification) {
|
||||
if (notification.userInfo) {
|
||||
@ -70,6 +71,11 @@ NSDictionary *_launchOptions;
|
||||
[JPushPlugin setupJPushSDK:_launchOptions];
|
||||
}
|
||||
|
||||
- (void)jpushSDKDidLoginNotification {
|
||||
NSDictionary *event = @{@"registrationId": JPUSHService.registrationID};
|
||||
[JPushPlugin fireDocumentEvent:JPushDocumentEvent_receiveRegistrationId jsString:[event toJsonString]];
|
||||
}
|
||||
|
||||
-(void)registerForRemoteNotification{
|
||||
if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) {
|
||||
#ifdef NSFoundationVersionNumber_iOS_9_x_Max
|
||||
|
@ -30,4 +30,4 @@ static NSString *const JPushDocumentEvent_ReceiveMessage = @"receiveM
|
||||
static NSString *const JPushDocumentEvent_StartLocalNotification = @"startLocalNotification";
|
||||
static NSString *const JPushDocumentEvent_ReceiveLocalNotification = @"receiveLocalNotification";
|
||||
|
||||
|
||||
static NSString *const JPushDocumentEvent_receiveRegistrationId = @"receiveRegistrationId";
|
||||
|
Loading…
Reference in New Issue
Block a user