首页 > 解决方案 > 如何在 Android 上使用深度链接打开我的应用程序?

问题描述

我正在使用深度链接打开我的应用程序,在 iPhone 上,当您将 URL 放入浏览器myapp://my-view/params

标签: androidreact-native

解决方案


你怎么打开链接

尝试这个

从文档

import { Linking, Alert } from "react-native";
const url= "slack://open?team=123456";
const supported = await Linking.canOpenURL(url);

    if (supported) {
     // Opening the link with some app, if the URL scheme is "http" the web link should be opened
      // by some browser in the mobile
      await Linking.openURL(url);
    } else {
     Alert.alert(`Don't know how to open this URL: ${url}`);
}

推荐阅读