代码之家  ›  专栏  ›  技术社区  ›  Aleksandr Maybach

如何在React原生应用中打开深层链接?

  •  0
  • Aleksandr Maybach  · 技术社区  · 7 年前

    如何打开像这样的链接viber://chat...&tg://。。。在React Native中使用标准链接。

                  <TouchableOpacity onPress={() => { Linking.openURL(`viber://chat?number=0123456789`); }}>
                <View style={styles.messengerBlock} >
                  <Image source={{ uri: 'viber' }} style={styles.messengerIcon} resizeMode={'contain'} />
                  <Text style={styles.messengerText}>Viber</Text>
                </View>
    
    2 回复  |  直到 7 年前
        1
  •  1
  •   Paolo Dell'Aguzzo    7 年前

    在Viber上,您只能打开以下链接: https://developers.viber.com/docs/tools/deep-links/

        2
  •  1
  •   MoKhajavi75    6 年前

    如果你想在你的应用中打开另一个应用,你可以使用 react-native-app-link .

    如果你想用深度链接打开你的应用,比如:

    myApp://case/1
    

    然后看看 this article .