pusher / pusher-js

Pusher Javascript library
http://pusher.com
MIT License
2.12k stars 374 forks source link

[Android] App showing white blank screen when quit app with hardware back button #682

Open anniewey opened 1 year ago

anniewey commented 1 year ago

Hi all, I'm having issue when opening Pusher notification from the system tray.

When quitting app with hardware back button, app is showing white blank screen (only happens after launching app from tapping on push notification). The blank screen doesn’t have bottom tab, seem to be not related to navigation. I've tried to log react navigation stack before quitting but showing only 1 route in the stack. Seems to be on native side issue.

I've also tried with all types of launchMode in AndroidManifest.xml but still getting same behaviour. When launch app normally, this issue doesn't happen. As I couldn't find ways to fix it, I was thinking to disable the Android back button only when the app is launched from opening notification. However, I can't find the listener that will triggered when tap to open the notification.

const channel = PUSHER.subscribe(thread.id);
      channel.bind('new-message', function (data: any) {
        //triggered when receive notification
        console.log('new message has come through', data);
      }

      return () => {
        PUSHER.unsubscribe(thread.id);
      };

Update: Suspect it's due to additional OpenNotificationActivity attached before MainActivity after checking out logcat. But still not sure how to disable/bypass the notification activity from push-notifications-android

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. If you'd like this issue to stay open please leave a comment indicating how this issue is affecting you. Thank you.

anniewey commented 1 year ago

Issue not solved. Disabled Android back button for temporary fix (not an ideal fix)

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. If you'd like this issue to stay open please leave a comment indicating how this issue is affecting you. Thank you.

anniewey commented 1 year ago

Not solved, temp solution by disabling Android back button which is not a good ux