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

[Bug]: [Android] Click Events Not Registered After App Restart #1032

Open
2 of 3 tasks
wif70068 opened this issue Nov 12, 2024 · 2 comments
Open
2 of 3 tasks

[Bug]: [Android] Click Events Not Registered After App Restart #1032

wif70068 opened this issue Nov 12, 2024 · 2 comments

Comments

@wif70068
Copy link

wif70068 commented Nov 12, 2024

What happened?

Using Capacitor 5, after switching users (using logout() followed by login() or login() alone), click events are not registered within the app until it is fully closed and reopened. Additional attempts with multiple restarts and repeated logout/login sequences do not resolve the issue.

Devices Tested:

  • Huawei
  • Xiaomi

Not reproducible on iOS

Steps to reproduce?

1. (Optional) Log out the current user.
2. Log in with a different user account.
3. Send a push notification to the newly logged-in user.
4. Open the push notification.
5. Issue: The app does not register any click events after opening from the notification.

What did you expect to happen?

Click event in app

OneSignal Cordova SDK version

Release 5.2.6

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@wif70068
Copy link
Author

wif70068 commented Nov 21, 2024

This issue actually occurs every time the app restarts using window.location.reload(), which currently happens when the user logs out. Other events, such as foregroundWillDisplay, also don't trigger

@wif70068 wif70068 changed the title [Bug]: [Android] Click Events Not Registered After User Switch [Bug]: [Android] Click Events Not Registered After App Restart Nov 21, 2024
@wif70068
Copy link
Author

adding

      case "destroy":
        result = true;
        this.hasAddedNotificationClickListener = false;
        onDestroy();
        break;

to the execute function and then calling it before location.reload() seems to resolve the issue

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

1 participant