androidreact-nativeexporeact-native-web

React native expo open url android web intent


How can I open an installed Android app from a url like 'intent://payment#Intent;action=ch.twint.action.TWINT_PAYMENT;scheme=twint;S.code={token};S.startingOrigin=EXTERNAL_WEB_BROWSER;S.browser_fallback_url=;end'?

Everytime I try Linking.openUrl() from expo-linking through the Expo Go client I get a console error. If I open it from the browser, it works fine.

EDIT:

I saw this SO, which is basically what I need to do, but he's using flutter, and since I'm using Expo, I cannot add specific code.

Convert intent web url to Android Intent

I've seen Expo Linking has sendIntent() https://docs.expo.dev/versions/latest/sdk/linking/#linkingsendintentaction-extras method, but I don't know how to convert this kind of URL to pass it to the method.


Solution

  • This can be solved easily by using https://docs.expo.dev/versions/latest/sdk/intent-launcher/#intentlauncherstartactivityasyncactivityaction-params