Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incoming call screen is not opening from background push listener. #5

Closed
anjandaffo opened this issue Jun 23, 2020 · 11 comments
Closed

Comments

@anjandaffo
Copy link

When app is in foreground IncomingCall.display(id, "Toothie", "test"); is working properly.

But when app is in background incoming call screen is not showing. I am getting the push in background and log is printing.
I am using the react-native-notifications library to receive push.

Notifications.events().registerNotificationReceivedBackground(
(notification,completion) => {
const { title, body } = notification.payload;
console.log("Android push notification received in background", notification, title, body);
const id = uuid()
IncomingCall.display(id, "Toothie", "test");
});

the console log is getting print when push is coming in the background. but incoming call is not showing.

@maloni991
Copy link

maloni991 commented Jun 26, 2020

I am facing the same problem , IncomingCall is working perfectly when my app is in foreground. But it doesn't want to trigger from the background. I am using firebase to send notification and i am reciving all data while in background but IncomingCall wont display.

messaging().setBackgroundMessageHandler(async remoteMessage => { console.log('bg message', remoteMessage); console.log('state'+ AppState.currentState); IncomingCall.display('5446465416', 'marko','https://image.shutterstock.com/image-photo/white-transparent-leaf-on-mirror-260nw-1029171697.jpg'); });

any solution for that ?

thanks in advance

Update :

I just tested it on Android 8 and everything works perfectly. But when i start it on android 9 or 10 nothing happens

@bkdev98
Copy link
Owner

bkdev98 commented Jun 27, 2020

@maloni991

I just tested it on Android 8 and everything works perfectly. But when I start it on android 9 or 10 nothing happens

In android > 9 you had to set autostart and display pop-up window permissions manually to make it works in background.
I'm working on an example project and invest more on other issues this weekend.

@anjandaffo
Copy link
Author

@maloni991

I just tested it on Android 8 and everything works perfectly. But when I start it on android 9 or 10 nothing happens

In android > 9 you had to set autostart and display pop-up window permissions manually to make it works in background.
I'm working on an example project and invest more on other issues this weekend.

@bkdev98 I tested it on redmi Android 8 phone and it's not working in background.

@anjandaffo
Copy link
Author

I am facing the same problem , IncomingCall is working perfectly when my app is in foreground. But it doesn't want to trigger from the background. I am using firebase to send notification and i am reciving all data while in background but IncomingCall wont display.

messaging().setBackgroundMessageHandler(async remoteMessage => { console.log('bg message', remoteMessage); console.log('state'+ AppState.currentState); IncomingCall.display('5446465416', 'marko','https://image.shutterstock.com/image-photo/white-transparent-leaf-on-mirror-260nw-1029171697.jpg'); });

any solution for that ?

thanks in advance

Update :

I just tested it on Android 8 and everything works perfectly. But when i start it on android 9 or 10 nothing happens

@@maloni991 I used the react-native-invoke-apphttps://www.npmjs.com/package/react-native-invoke-app to open app from background and killed state. From firebase background message listeners I am calling invokeApp method with data argument. And from "appInvoked" Listener calling IncomingCall.display method. It's working fine on Android 8,9 and 10.

@anjandaffo
Copy link
Author

@bkdev98 any update on background issue?

@fachrezamuslim
Copy link

@anjandaffo did you get the solution for this?

@anjandaffo
Copy link
Author

@fachreza73 I fixed the issue with using another package https://www.npmjs.com/package/react-native-invoke-app together. From firebase background message listeners I am calling invokeApp method with data argument. And from "appInvoked" Listener calling IncomingCall.display method. It's working fine on Android 8,9 and 10.

@fachrezamuslim
Copy link

fachrezamuslim commented Jul 12, 2020

i just follow the example project and its working. you need to import function that trigger the IncomingCall.display and call the function when remote message coming (see index.js and App.js in example folder).

thanks for the example @bkdev98

@eskiesirius
Copy link

eskiesirius commented Jul 17, 2020

i only experience this in release build..

UPDATE: I have two xiaomi phones.. same model and android version but the other one works even the app is in the background and the other one isn't..

@fachrezamuslim
Copy link

i just follow the example project and its working. you need to import function that trigger the IncomingCall.display and call the function when remote message coming (see index.js and App.js in example folder).

thanks for the example @bkdev98

Update:
i just notice that my emulator using Android 9. then when i try to assemble build with some devices. the result is :

  1. Xiaomi with Android 10, incoming call only work in foreground state
  2. Samsung with Android 9, incoming call work for all state (foreground, background, inactive)
  3. Oppo with Android 8, incoming call only work in foreground and background state

@bkdev98
Copy link
Owner

bkdev98 commented Aug 20, 2020

I just released version 2 of the library which believed fixed this bug so I gonna close it here. Feel free to reopen or create new issue if you still got this issue.

@bkdev98 bkdev98 closed this as completed Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants