bkdev98/react-native-incoming-call

How to open MainActivity instead of UnlockScreenActivity

kimho opened this issue · 2 comments

kimho commented

In the current version, UnlockScreenActivity pops up when a call comes in while the app is in the background.
But I want the default MainActivity to be launched, not the UnlockScreenActivity.
In that case, it seems that the incoming screen can be customized with RN javascript code.
How can I make MainActivity run instead of UnlockScreenActivity?

This library is not designed for this behavior but I believed openAppFromHeadlessMode & backToForeground could also get the job done. So instead call IncomingCall.display you could use openAppFromHeadlessMode to wake the app and then getExtrasFromHeadlessMode to determine what to do.

kimho commented

@bkdev98
Thank you for answer. When I use IncomingCall.backToForeground() it works the way I want.