crisp-im / crisp-sdk-android

:package: Crisp Android SDK, add a chat in any Android app and communicate with your users.
https://docs.crisp.chat/guides/chatbox-sdks/android-sdk/
Other
55 stars 17 forks source link

handleIntentToLink() is crashing app when other app is not found #32

Closed AraujoJordan closed 3 years ago

AraujoJordan commented 3 years ago

I found this issue on Crashlytics and it's happens when there is a link to Facebook Messenger. A simple catch for ActivityNotFoundException can fix this problem. I will submit a PR for it.

Here is the full error log:

Fatal Exception: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=fb-messenger://user/1234567890/?intent_trigger=mme&nav=discover pkg=com.facebook.orca }
       at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2071)
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1857)
       at android.app.Activity.startActivityForResult(Activity.java:5950)
       at android.app.Activity.startActivityFromFragment(Activity.java:5925)
       at android.app.Activity$HostCallbacks.onStartActivityFromFragment(Activity.java:8853)
       at android.app.Fragment.startActivity(Fragment.java:1101)
       at android.app.Fragment.startActivity(Fragment.java:1080)
       at im.crisp.sdk.ui.CrispFragment.handleIntentToLink(CrispFragment.java:3)
       at im.crisp.sdk.ui.a.shouldOverrideUrlLoading(a.java:3)
       at Ir.a(Ir.java:1)
       at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:15)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:336)
       at android.os.Looper.loop(Looper.java:197)
       at android.app.ActivityThread.main(ActivityThread.java:7811)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
baptistejamin commented 3 years ago

We just published the early beta of the Crisp Android native SDK. You can find it here: https://github.com/crisp-im/crisp-sdk-android/tree/beta