BrowserSwitchResult receiving UserCanceledException
See original GitHub issueGeneral information
- SDK/Library version: 4.0.1
- Environment: Sandbox but should behave the same in prod
- Android Version and Device: Android 10, 11, Pixel 3, Pixel 4 com.braintreepayments.api:data-collector com.braintreepayments.api:paypal
Issue description
I migrated from SDK version 3 to 4 and implemented PayPal flow according to your documentation.
I think I have hit one case that is not handled by the SDK. Steps:
- Implement PayPal flow according to docs
- While in in the PayPal flow (BrowserSwithch / Chromium custom tabs) click under the three dots on top right
- Select open in Chrome
What happens is that immediately when the new Chrome process is started I receive in my PayPalActivity (identical to your docs example) callback from payPalClient.onBrowserSwitchResult
which is placed in the onResume()
of the activity. The callback receives UserCanceledException
which I handle as the user cancelled the flow (exiting the activity and not receiving the payPalAccountNonce
). This means that the flow does not work if user opens the custom tab in new Chrome process.
Do you have ideas how we could make this work?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Developers - BrowserSwitchResult receiving UserCanceledException
The callback receives UserCanceledException which I handle as the user cancelled the flow (exiting the activity and not receiving the payPalAccountNonce ).
Read more >Migration | Android - Braintree Developer Documentation
When the customer cancels out of a payment flow, a UserCanceledException will be returned in the on<PaymentMethod>Failure listener method. Handling Errors.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Has the UserCanceledException issue for Paypal been resolved? I’ve noticed that when the exception occurs, I can tap the ‘Overview’ button on the phone and see there is still a paypal activity on the stack , still spinning its progress indicator. In fact, there’s an activity still running for the last several attempts I’ve made to use PayPal. Seems like the webview is not finishing before going back to the app to complete the purchase and therefore shows as canceled. I’ve attached a short video showing the paypal activities still running
https://user-images.githubusercontent.com/90287915/162626833-f2304c27-5c71-4d97-a584-e753c99ea8b3.mp4
@sshropshire I have re opened this again since it seems to still happen quite a lot for our users: https://github.com/braintree/braintree_android/issues/557