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: App not focused on push notification press if backgrounded and custom url is handled #76

Closed
jehartzog opened this issue Sep 24, 2020 · 1 comment · Fixed by #79

Comments

@jehartzog
Copy link
Contributor

jehartzog commented Sep 24, 2020

Reproduction

  1. Using Android app, use this lib and add a custom urlHandler which processes the url and returns true
  2. Open the Android device, and then hit home button to place app in background (but still running)
  3. Using Iterable Web UI, send a test push from a template with a Push open action of Open URL
  4. On Android device, press the push

Expected

  1. App will process the push url, and come into focus

Actual

  1. App will process push url fully in background, but not come into focus

Environment:

  1. @iterable/react-native-sdk 1.0.12
  2. react-native 0.63.1
  3. Android OS 10

Suspected cause

Looking at this code, it seems the Android SDK is designed to not focus the app if the event is handled. This may be fine for an Android SDK, but this RN SDK doesn't have a way to bring the app into focus if it reports the url is handled.

Current workaround

For Android only, we return false in our urlHandler, basically disabling our custom url handler, and we make sure to use urls to double as valid deep links. This works for now, but is a somewhat limited solution.

@jehartzog
Copy link
Contributor Author

After further integration work, we found that this was also the case whenever customActionHandler was set, and unlike with the urlHandler we could not do a simple workaround.

We dived into the code and submitted #79 which should clear the issue, and result in consistent behavior between iOS/Android when pressing on push notifications.

We're thankful these libraries are own source, allowing us to speed forward to fix our implementation while providing feedback on what we found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant