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
29
29
RCT_EXPORT_MODULE ();
30
30
31
31
static bool _isVoipRegistered = NO ;
32
+ static NSString *_lastVoipToken = @" " ;
32
33
static NSMutableDictionary <NSString *, RNVoipPushNotificationCompletion> *completionHandlers = nil ;
33
34
34
35
@@ -125,8 +126,10 @@ + (void)voipRegistration
125
126
{
126
127
if (_isVoipRegistered) {
127
128
#ifdef DEBUG
128
- RCTLog (@" [RNVoipPushNotificationManager] voipRegistration is already registered" );
129
+ RCTLog (@" [RNVoipPushNotificationManager] voipRegistration is already registered. return _lastVoipToken = %@ " , _lastVoipToken );
129
130
#endif
131
+ RNVoipPushNotificationManager *voipPushManager = [RNVoipPushNotificationManager allocWithZone: nil ];
132
+ [voipPushManager sendEventWithNameWrapper: RNVoipPushRemoteNotificationsRegisteredEvent body: _lastVoipToken];
130
133
} else {
131
134
_isVoipRegistered = YES ;
132
135
#ifdef DEBUG
@@ -161,8 +164,10 @@ + (void)didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSStr
161
164
[hexString appendFormat: @" %02x " , bytes[i]];
162
165
}
163
166
167
+ _lastVoipToken = [hexString copy ];
168
+
164
169
RNVoipPushNotificationManager *voipPushManager = [RNVoipPushNotificationManager allocWithZone: nil ];
165
- [voipPushManager sendEventWithNameWrapper: RNVoipPushRemoteNotificationsRegisteredEvent body: [hexString copy ] ];
170
+ [voipPushManager sendEventWithNameWrapper: RNVoipPushRemoteNotificationsRegisteredEvent body: _lastVoipToken ];
166
171
}
167
172
168
173
// --- should be called from `AppDelegate.didReceiveIncomingPushWithPayload`
You can’t perform that action at this time.
0 commit comments