OneSignal-Unity-SDK icon indicating copy to clipboard operation
OneSignal-Unity-SDK copied to clipboard

[Bug]: No Activity found to handle Intent for invalid url

Open ajaybirla-fabzen opened this issue 1 year ago • 1 comments

What happened?

The application crashes whenever it receives a notification when the user clicks on in-app messages that contain invalid URLs.

Steps to reproduce?

1. Launch the application.
2. Send an in-app message to the application.
3. Click on the message.
4. Observe the application crash.

What did you expect to happen?

I expect the app to not crash whenever it receives an in-app message.

Unity version

2021.3.17f1

OneSignal Unity SDK version

5.0.5

Platform

Android

Relevant log output

01-29 16:27:58.653  3980  9320 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=skp://skillpattiempire?SPUnrestrict flg=0x10000000} from uid 10073
01-29 16:27:58.654  9447  9700 W Instrumentation: Unresolved intent: cmp: null
01-29 16:27:58.654  9447  9700 W Instrumentation: Unresolved intent: data: skp://skillpattiempire?spunrestrict
01-29 16:27:58.655  9447  9700 E AndroidRuntime: FATAL EXCEPTION: Thread-110
01-29 16:27:58.655  9447  9700 E AndroidRuntime: Process: com.winzenia.ludo, PID: 9447
01-29 16:27:58.655  9447  9700 E AndroidRuntime: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=skp://skillpattiempire?SPUnrestrict flg=0x10000000 }
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2406)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1968)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at android.app.Activity.startActivityForResult(Activity.java:4635)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at android.app.Activity.startActivityForResult(Activity.java:4593)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at android.app.Activity.startActivity(Activity.java:4954)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at android.app.Activity.startActivity(Activity.java:4922)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at com.onesignal.common.AndroidUtils.openURLInBrowser(AndroidUtils.kt:169)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at com.onesignal.common.AndroidUtils.openURLInBrowser(AndroidUtils.kt:164)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at com.onesignal.inAppMessages.internal.InAppMessagesManager.fireClickAction(InAppMessagesManager.kt:704)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at com.onesignal.inAppMessages.internal.InAppMessagesManager.access$fireClickAction(InAppMessagesManager.kt:50)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at com.onesignal.inAppMessages.internal.InAppMessagesManager$onMessageActionOccurredOnMessage$1.invokeSuspend(InAppMessagesManager.kt:556)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at com.onesignal.common.threading.ThreadUtilsKt$suspendifyOnThread$1.invoke(ThreadUtils.kt:60)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at com.onesignal.common.threading.ThreadUtilsKt$suspendifyOnThread$1.invoke(ThreadUtils.kt:59)
01-29 16:27:58.655  9447  9700 E AndroidRuntime:        at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

ajaybirla-fabzen avatar Jan 29 '24 11:01 ajaybirla-fabzen

Thanks for reporting! This is being worked on and will be in the next Unity release. You can follow the Android PR here: https://github.com/OneSignal/OneSignal-Android-SDK/pull/1954

shepherd-l avatar Jan 30 '24 22:01 shepherd-l