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]: Crash when using In-App messages #1871

Closed
1 task done
dmytroreutov opened this issue Oct 17, 2023 · 3 comments
Closed
1 task done

[Bug]: Crash when using In-App messages #1871

dmytroreutov opened this issue Oct 17, 2023 · 3 comments

Comments

@dmytroreutov
Copy link

dmytroreutov commented Oct 17, 2023

What happened?

Screenshot 2023-10-17 at 11 29 18 Screenshot 2023-10-17 at 11 30 03

Steps to reproduce?

STR unknown
I suppose issue is related to In-App message opening

What did you expect to happen?

I expected no crash happening

OneSignal Android SDK version

5.0.2

Android version

13, 12

Specific Android models

No response

Relevant log output

Fatal Exception: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://www.instagram.com/... flg=0x10000000 }
       at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2174)
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1805)
       at android.app.ContextImpl.startActivity(ContextImpl.java:1145)
       at android.app.ContextImpl.startActivity(ContextImpl.java:1116)
       at android.content.ContextWrapper.startActivity(ContextWrapper.java:441)
       at com.onesignal.common.AndroidUtils.openURLInBrowser(AndroidUtils.kt:169)
       at com.onesignal.common.AndroidUtils.openURLInBrowser(AndroidUtils.kt:164)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager.fireClickAction(InAppMessagesManager.kt:704)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager.access$fireClickAction(InAppMessagesManager.kt)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager$onMessageActionOccurredOnMessage$1.invokeSuspend(InAppMessagesManager.kt:556)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager$onMessageActionOccurredOnMessage$1.invoke(InAppMessagesManager.kt:8)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager$onMessageActionOccurredOnMessage$1.invoke(InAppMessagesManager.kt:2)
       at com.onesignal.common.threading.ThreadUtilsKt$suspendifyOnThread$1$1.invokeSuspend(ThreadUtils.kt:61)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
       at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
       at kotlinx.coroutines.BlockingCoroutine.joinBlocking(BlockingCoroutine.java:85)
       at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(BuildersKt__Builders.kt:59)
       at kotlinx.coroutines.BuildersKt.runBlocking(Builders.kt:1)
       at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(BuildersKt__Builders.kt:38)
       at kotlinx.coroutines.BuildersKt.runBlocking$default(Builders.kt:1)
       at com.onesignal.common.threading.ThreadUtilsKt$suspendifyOnThread$1.invoke(ThreadUtils.kt:60)
       at com.onesignal.common.threading.ThreadUtilsKt$suspendifyOnThread$1.invoke(ThreadUtils.kt:59)
       at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@emawby
Copy link
Contributor

emawby commented Oct 17, 2023

@dmytroreutov Thank you for reporting. When are you showing In App Messages in your app? Is it only during app startup or do you use triggers?

@brismithers
Copy link
Contributor

brismithers commented Oct 30, 2023

To me this looks like some devices aren't able to handle opening URLs ("https://www.instagram.com/...") and the SDK is not protecting against exceptions in this flow. I believe we need to add some additional exception handling to ensure the app does not crash when these conditions occur.

Please let me know your thoughts @dmytroreutov

@jennantilla
Copy link
Contributor

@dmytroreutov just a heads up this issue should be resolved in SDK versions >=5.0.4. Please feel free to update to the latest version of the SDK and let us know if you have any additional questions or concerns. Thanks!

jinliu9508 pushed a commit that referenced this issue Jan 31, 2024
General protection against exceptions that occur on a thread.
jinliu9508 pushed a commit that referenced this issue Jan 31, 2024
General protection against exceptions that occur on a thread.
jinliu9508 pushed a commit that referenced this issue Feb 6, 2024
General protection against exceptions that occur on a thread.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants