-
Notifications
You must be signed in to change notification settings - Fork 368
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
intent.setFlags recommend #663
Comments
@cuichanghao Thanks for the suggestion, we will look into using an <application ...>
<meta-data android:name="com.onesignal.NotificationOpened.DEFAULT" android:value="DISABLE" />
</application> |
Closing issue. Note: request still under consideration |
Facing the same behavior. Is there any workaround to it? And When should we expect to be added? |
Hello, |
We are addressing this issue in PRs #1276 and #1277. In summary the OneSignal default notification open behavior will now always resume your app and won't affect your backstace. By "resume" it means the exact behavior an Android Launcher does, bring the last If you need more details on the resume behavior I recommend reading PR #1277 as it will most likely cover your question on it but feel free to reply here or open a new more specific issue. This will be rolled into the next update which will most likely be 4.1.1 but it could be 4.2.0. |
sometime onesignal will not start activity if activity backstack already existed.
after 4 hour research i found this is intent flag problem.
How to reproduce:
1.kill application.
2.touch onesignal notification.
3.start some activity.( with (applicationContext) )。and manually start some your other activity.
4.touch onesignal other notification.
4.just bring up previous activity, not my specify activity with parameter. ( with (applicationContext) )
https://developer.android.com/reference/android/content/Intent.html?hl=ja#FLAG_ACTIVITY_NEW_TASK
so solution is
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK
or
you can get Activity Context with registerActivityLifecycleCallbacks.
App.kt
The text was updated successfully, but these errors were encountered: