paypal/PayPal-Android-SDK

Exception in case of reject open url in external app

Closed this issue · 7 comments

General information

  • SDK/Library version: 2.15.1
  • Environment: production
  • Android Version and Device: Several devices with Android 5.0 and 6.0

Issue description

Seems no try-catch block for startActivityForResult in case there is no app responsible for View action on device.

atal Exception: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://www.paypal.com/... }
       at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1809)
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1523)
       at android.app.Activity.startActivityForResult(Activity.java:3968)
       at android.app.Activity.startActivityForResult(Activity.java:3920)
       at android.app.Activity.startActivity(Activity.java:4259)
       at android.app.Activity.startActivity(Activity.java:4227)
       at com.paypal.android.sdk.payments.LoginActivity.b(Unknown Source)
       at com.paypal.android.sdk.payments.az.onClick(Unknown Source)
       at android.view.View.performClick(View.java:5265)
       at android.view.View$PerformClick.run(View.java:21534)
       at android.os.Handler.handleCallback(Handler.java:815)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at android.os.Looper.loop(Looper.java:207)
       at android.app.ActivityThread.main(ActivityThread.java:5728)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)

PayPal is deprecating the REST mobile SDKs. Are you in integrating testing stage? If so, please consider to integrate https://github.com/braintree/braintree_android instead for PayPal feature.

Hey @snakelizzard ! When you mean no app responsible for View action, it feels like this was a browser flow. Is this case where there are no browsers available on phone ? I am curious to replicate this behavior.

@jaypatel512 This was reproduced not on developer device. My suggestion is to try reject open url when os prompts to select which browser to use.

@snakelizzard Could you pelase submit a pull request for us to review?

@xiaoleih41 I do not have access to your sources. This repo contains only aars.

@snakelizzard We are looking into this.

PayPal Mobile SDKs are Deprecated. The APIs powering them will remain operational long enough for merchants to migrate, but the SDKs themselves will no longer be updated. Please use Braintree Direct in supported countries. In other countries, use Express Checkout and choose the Braintree SDK integration option.