Shopify / checkout-sheet-kit-react-native

Shopify's Checkout Sheet Kit for React Native - simplifying the process of adding checkout to your native apps.
https://shopify.dev/docs/custom-storefronts/mobile-apps
MIT License
30 stars 3 forks source link

External Links open in active Webview (android) #68

Closed BARK-AHAAS closed 6 months ago

BARK-AHAAS commented 7 months ago

"@shopify/checkout-sheet-kit": "^1.0.1" "react-native": "^0.73.2"

When opening links within other screens (such as Terms & Conditions and Privacy Policy) the link is opened in the default browser in iOS, allowing you to easily open the app again and continue to checkout whereas Android opens in the active webview. You can return to checkout by sliding back to do a native "back" but is it possible to make the behavior default for both to open in the default browser outside of the webview to keep the checkout experience contained and smooth as when this page is opened you lose the "Checkout" header with a close CTA?

BARK-AHAAS commented 6 months ago

It seems like there are also Shopify generated sections like Subscription which then links to the Account (but happens within the checkout view). Is there a way to hook into navigation changes (similar to onNavigationStateChange on native Webview components) so that we can handle these navigations properly?

Screenshot 2024-02-27 at 3 15 09 PM

kiftio commented 6 months ago

This was closed a little prematurely.

But we've added in some fixes for links in checkout and have another ready to go for links in shop policies that should ship tomorrow

BARK-AHAAS commented 5 months ago

Hey @kiftio, I just updated the SDK with the current version and its working a lot smoother but a few questions with the "Fix".

I am not seeing the "Manage your subscription" section and button displayed at all on the Thank You page, or the "View Account" link in the "Order Details" Sections. Were these just removed from the webview and its expected that they will not display?

Also, when i click on the "Contact Us" link (which should open an mailto link) or click on the Download Shop App buttons the whole app crashes (I am currently working on an Android Emulator).

Screenshot 2024-04-04 at 12 17 14 AM
markmur commented 5 months ago

@BARK-AHAAS this has been fixed in @shopify/checkout-sheet-kit@2.0.1.

Please open a new issue if you experience more issues with external links 👍

kiftio commented 5 months ago

Hey @BARK-AHAAS

On the 'Manage your subscription' and 'View account' links - yes they were removed for checkout-sheet-kit. The rationale was that subscription / account management are more likely to be dealt with natively rather than in the browser.

But it'd be great to hear feedback on that

BARK-AHAAS commented 5 months ago

Hey @BARK-AHAAS

On the 'Manage your subscription' and 'View account' links - yes they were removed for checkout-sheet-kit. The rationale was that subscription / account management are more likely to be dealt with natively rather than in the browser.

But it'd be great to hear feedback on that

Yes that totally makes sense and wont be a blocker from our end so seems like a solid solution at the moment. In regards to feedback i think it would be nice to have some way to link into those "natively handled" clicks (like go to account, or go to subscriptions) so that we could either pass a callback to do proper navigating within the app when those types of buttons are clicked. Or maybe add it to the list of possible event listeners to handle the actions that way.