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

[Android] Fix permission checking in the Quit state #576

Merged
merged 1 commit into from
May 19, 2022
Merged

[Android] Fix permission checking in the Quit state #576

merged 1 commit into from
May 19, 2022

Conversation

mluksha
Copy link
Contributor

@mluksha mluksha commented May 4, 2022

Problem:
I'm trying to displayIncomingCall in the BackgroundMessaging (by Firebase) when the app in the Quit state (when a user has killed the application), but it doesn't work because hasPermissions always returns false.
hasPermissions returns false because Activity is always null in the Quit state.

Solution:
Use ReactApplicationContext to check permissions.

@mluksha
Copy link
Contributor Author

mluksha commented May 6, 2022

@c960657, @LinusU, @danjenkins, @saghul, @manuquentin please review.

@mluksha
Copy link
Contributor Author

mluksha commented May 6, 2022

@c960657, @LinusU, @danjenkins, @saghul please review.

@saghul
Copy link
Member

saghul commented May 6, 2022

Sorry, I don't have enough experience with this package to review this PR..

@glesperance
Copy link
Contributor

glesperance commented May 10, 2022

I can confirm this fixed issue #577 for me. Tested on

  • Android: 11
  • Phone model: Samsung Galaxy A32 5G

@yotamishak
Copy link
Contributor

Can also confirm this fixed the problem for me

  • Android 12
  • Phone Model: Galaxy S21 FE

@ahmetserefoglu
Copy link

Thank you so much Problem Solved:
Note 10

@kingofday
Copy link

kingofday commented Sep 8, 2022

please confirm this pr @manuquentin
i can't see ir after installation

@fukemy
Copy link

fukemy commented Oct 19, 2022

yes it's work

@HalilFocic
Copy link

@fukemy could you please provide code inside the backgroundMessageHandler, I am having issues displaying the call when the app was killed on Android

@fukemy
Copy link

fukemy commented Nov 4, 2022

@fukemy could you please provide code inside the backgroundMessageHandler, I am having issues displaying the call when the app was killed on Android

Ok wait me few hours, im busy now

@HalilFocic
Copy link

@fukemy 🙏

@fukemy
Copy link

fukemy commented Nov 14, 2022

@fukemy 🙏

Read commit difference them modify source code inside your project

@alaaamady
Copy link

alaaamady commented Jan 25, 2023

can you provide the code you wrote to achieve what you were trying to do in your problem:
"I'm trying to displayIncomingCall in the BackgroundMessaging (by Firebase) when the app in the Quit state"
because I have done the following in my index.js file but it is not working

import { AppRegistry } from "react-native";
import App from "./src/App";
import { registerGlobals } from "livekit-react-native";
import RNCallKeep from "react-native-callkeep";

import messaging from "@react-native-firebase/messaging";
registerGlobals();

AppRegistry.registerComponent("main", () => App);

// Register background handler
messaging().setBackgroundMessageHandler(async (remoteMessage) => {
  console.log("Message handled in the background!", remoteMessage);
  RNCallKeep.displayIncomingCall(generateUUID(), "guestName");
});

@mluksha

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

Successfully merging this pull request may close these issues.

10 participants