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

Allow foreground service notification to open the application #652

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

manuquentin
Copy link
Contributor

No description provided.

@manuquentin manuquentin merged commit fb30581 into master Jan 30, 2023
@manuquentin manuquentin deleted the foreground_notification_open_app branch January 30, 2023 19:18
@@ -304,9 +307,18 @@ private void startForegroundService() {
assert manager != null;
manager.createNotificationChannel(chan);

Activity currentActivity = RNCallKeepModule.instance.getCurrentReactActivity();
Intent notificationIntent = new Intent(this, currentActivity.getClass());
Copy link

@carlosmg95 carlosmg95 Jan 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! When I have to display a notification in background, my app crashes because of java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference. I think it happens because there is no currentActivity. There was a similar issue that was fixed with this PR: https://github.com/react-native-webrtc/react-native-callkeep/pull/576/files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes my bad, it's fixed in #659, will be released today.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thank you very much!!

By the way, great library.

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.

3 participants