wix / react-native-notifications

React Native Notifications
MIT License
3.23k stars 763 forks source link

Error opening react-native notification 'java.lang.Object android.os.Bundle.clone() #951

Closed ViniciusMargotti closed 1 year ago

ViniciusMargotti commented 1 year ago

I'm facing the same issue as mentioned in

https://github.com/wix/react-native-notifications/issues/910,

is there any solution for the issue in published versions? I managed to solve the problem with the Patch that was indicated, but I believe that it is not the best practice, but to solve the problem with the library code

Solution patch

react-native-notifications/lib/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotification.java

private void notifyOpenedToJS() { 
     Bundle response = new Bundle(); 
     response.putBundle("notification", mNotificationProps.asBundle()); 
     mJsIOHelper.sendEventToJS(NOTIFICATION_OPENED_EVENT_NAME, response, mAppLifecycleFacade.getRunningReactContext()); 
 }

to

Bundle response = new Bundle();
try {
            response.putBundle("notification", mNotificationProps.asBundle());
  } catch (NullPointerException e) {
            //Log.e(LOGTAG, "notifyOpenedToJS: Null pointer exception");
 }

We can create a PR correction, or some library collaborator could check the situation please. tks

ViniciusMargotti commented 1 year ago

@kg-currenxie You also only managed to solve the problem with a Patch?

kg-currenxie commented 1 year ago

@ViniciusMargotti yes :/

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 1 year ago

The issue has been closed for inactivity.

AlkanV commented 1 year ago

why we dont merge this into main fork?

C-Flatla commented 1 year ago

@AlkanV I just put up a PR #967 that would fix this 😄

AlkanV commented 1 year ago

@C-Flatla seems like still pending merge :(

Cyber-Quest commented 1 year ago

I have the same problem :( Please, merge the PR #967 as soon as possible