react-native-webrtc / react-native-voip-push-notification

React Native VoIP Push Notification - Currently iOS only
ISC License
213 stars 83 forks source link

First notification is missed when app is killed #16

Closed aarkalyk closed 6 years ago

aarkalyk commented 6 years ago

I'm encountering super weird bug. Basically, when I kill the app and send pushes, on the first push callKit is never shown, but it's shown on the following ones. I built the app in release mode, iOS version: 10.3.3.

Has anyone encountered this issue? Anyone solved it?

It might be related to issue #14 .

aarkalyk commented 6 years ago

Turns out I've been registering for voip notifications and setting PushKit delegate in AppDelegate.m file. It messed up with RNVoipPushNotificationManager.requestPermission(). My bad 😬

glocore commented 5 years ago

@aarkalyk I also had setup push notifications according to the docs for PushNotificationIos. I removed it, but I'm still facing the same issue. Could you please help me out?

Here's my AppDelegate.m file:

AppDelegate.m

```objective-c #import "AppDelegate.h" #import #import #import #import #import "RNVoipPushNotificationManager.h" #import "RNSplashScreen.h" #import "RNCallKit.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; [ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions bridgeManagerDelegate:self]; return YES; } - (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge { RNCallKit *rncallkit = [[RNCallKit alloc] init]; return @[rncallkit]; } /* Add PushKit delegate method */ // Handle updated push credentials - (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(NSString *)type { // Register VoIP push token (a property of PKPushCredentials) with server [RNVoipPushNotificationManager didUpdatePushCredentials:credentials forType:(NSString *)type]; } // Handle incoming pushes - (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type { // Process the received push [RNVoipPushNotificationManager didReceiveIncomingPushWithPayload:payload forType:(NSString *)type]; } @end ```

glocore commented 5 years ago

@ianlin @zxcpoiu Could you please help me out here? This is causing my app to miss calls in many instances. I find this mentioned in multiple issues but I can't find a solution 😕

aleksaToljic commented 5 years ago

@ianlin @zxcpoiu Could you please help me out here? This is causing my app to miss calls in many instances. I find this mentioned in multiple issues but I can't find a solution 😕

@platonish have you found the solution yet?