ios add jpush.receiveRegistrationId event

This commit is contained in:
huangminlinux 2017-10-11 11:15:13 +08:00
parent 266d0cb28f
commit f5ea2b5b10
2 changed files with 163 additions and 157 deletions

View File

@ -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

View File

@ -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";