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

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

[iOS][2.0.0] Not awake closed app when received voip call. #48

Closed william-normann closed 3 years ago

william-normann commented 4 years ago

We use voip-push-notification & react-native-callkeep on iOS to awake app from background mode / closed state when received a voip call.

It work fine in background mode. But when app in closed state. Nothing happen, no notifcation, no automation awake app.

We met this issue from version 2.0.0 and react native 0.60.6. V1 and react-native 0.59 work fine.

any ones met the same issue with us? Can we resolve this problem?

tuanbm commented 4 years ago

Have you got any workaround for this?

zxcpoiu commented 4 years ago

Please read the new notes in the readme to see if there any missed part.

https://github.com/react-native-webrtc/react-native-voip-push-notification/blob/master/README.md#important-note

tnghia944 commented 4 years ago

same issue @william-normann , @r0b0t3d , @tuanbm Have you solved it yet?

zxcpoiu commented 4 years ago

Have you find the cause? I know ios 13.3 seems have issues, butsolved after upgrade to ios 13.4

MrAlexWeber commented 4 years ago

I'm running into a similar issue. It seems like VoipPushNotification.wakeupByPush is false, and I'm not sure why.

MrAlexWeber commented 4 years ago

Have you got any workaround for this?

As a workaround you can import { AppState } from 'react-native' and then basically just check that Platform.OS === 'ios' && AppState.currentState === 'background' instead of checking wakeupByPush.

tuanbm commented 4 years ago

Have you got any workaround for this?

As a workaround you can import { AppState } from 'react-native' and then basically just check that Platform.OS === 'ios' && AppState.currentState === 'background' instead of checking wakeupByPush.

It's the problem with iOS version < 13, I checked with iOS 12. My work around is to send double voip notification (and of cause handle the duplication on client code, for me, I send APN messages with a flag to mark if a notification is a duplication one), so far it's working for me. Btw, ios 13 is working as expected, no need to apply the workaround.

MrAlexWeber commented 4 years ago

It's the problem with iOS version < 13, I checked with iOS 12. Btw, ios 13 is working as expected, no need to apply the workaround.

I was having the issue when testing on iOS 13.4

vsalle commented 4 years ago

It's the problem with iOS version < 13, I checked with iOS 12. Btw, ios 13 is working as expected, no need to apply the workaround.

I was having the issue when testing on iOS 13.4

Hi, I have the same issue in iOS 13.4.1 i can't wake up app.

willnaoosmith commented 4 years ago

did you guys even managed to use it with the app minimized? I'm struggling with it and dont find anything to make it work :(

pschill commented 4 years ago

The problem is that the method didReceiveIncomingPushWithPayload in AppDelegate.m doesn't get called when the app is killed. This results in the system trying to invoke Callkit a few times but fails and it then drops all attempts to start your application on a background push (the console log will just show "Dropped on the floor").

To enable the retries to call this method you need to reinstall your application.

I'm really new at iOS-development so I have no idea why this method doesn't get called or how you call it from a push.

kentanaka000 commented 4 years ago

It's the problem with iOS version < 13, I checked with iOS 12. My work around is to send double voip notification (and of cause handle the duplication on client code, for me, I send APN messages with a flag to mark if a notification is a duplication one), so far it's working for me. Btw, ios 13 is working as expected, no need to apply the workaround.

How exactly did you get this workaround to work? I've been trying this and it gives me weird bugs when the call is closed before the duplicate comes in

tuanbm commented 4 years ago

It's the problem with iOS version < 13, I checked with iOS 12. My work around is to send double voip notification (and of cause handle the duplication on client code, for me, I send APN messages with a flag to mark if a notification is a duplication one), so far it's working for me. Btw, ios 13 is working as expected, no need to apply the workaround.

How exactly did you get this workaround to work? I've been trying this and it gives me weird bugs when the call is closed before the duplicate comes in

It's a little bit tricky that the duplicated push should be sent just after the 1st one came, like: send the 1st one, delay 1s, then send the 2nd one. 2 notification should contain the same uuid and in the code, you should call the api to show the incoming call UI with the same UUID ( that means 2nd one will be ignored if the UI is still showing because of the 1st one) Hope this helps.

zxcpoiu commented 3 years ago

please check discussion in #59 and the test the fix in PR #69

zxcpoiu commented 3 years ago

Released 3.0.0, this should be fixed. Please check doc and test, especially didLoadWithEvents part.