File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
ios/RNVoipPushNotification Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ @implementation RNVoipPushNotificationManager
2929RCT_EXPORT_MODULE ();
3030
3131static bool _isVoipRegistered = NO ;
32+ static NSString *_lastVoipToken = @" " ;
3233static NSMutableDictionary <NSString *, RNVoipPushNotificationCompletion> *completionHandlers = nil ;
3334
3435
@@ -125,8 +126,10 @@ + (void)voipRegistration
125126{
126127 if (_isVoipRegistered) {
127128#ifdef DEBUG
128- RCTLog (@" [RNVoipPushNotificationManager] voipRegistration is already registered" );
129+ RCTLog (@" [RNVoipPushNotificationManager] voipRegistration is already registered. return _lastVoipToken = %@ " , _lastVoipToken );
129130#endif
131+ RNVoipPushNotificationManager *voipPushManager = [RNVoipPushNotificationManager allocWithZone: nil ];
132+ [voipPushManager sendEventWithNameWrapper: RNVoipPushRemoteNotificationsRegisteredEvent body: _lastVoipToken];
130133 } else {
131134 _isVoipRegistered = YES ;
132135#ifdef DEBUG
@@ -161,8 +164,10 @@ + (void)didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSStr
161164 [hexString appendFormat: @" %02x " , bytes[i]];
162165 }
163166
167+ _lastVoipToken = [hexString copy ];
168+
164169 RNVoipPushNotificationManager *voipPushManager = [RNVoipPushNotificationManager allocWithZone: nil ];
165- [voipPushManager sendEventWithNameWrapper: RNVoipPushRemoteNotificationsRegisteredEvent body: [hexString copy ] ];
170+ [voipPushManager sendEventWithNameWrapper: RNVoipPushRemoteNotificationsRegisteredEvent body: _lastVoipToken ];
166171}
167172
168173// --- should be called from `AppDelegate.didReceiveIncomingPushWithPayload`
You can’t perform that action at this time.
0 commit comments