【问题标题】:Open other app using bundle id in Android using React Native?使用 React Native 在 Android 中使用 bundle id 打开其他应用程序?
【发布时间】:2019-03-07 08:55:06
【问题描述】:

是否可以仅使用我需要打开的应用程序的捆绑 ID 在我的应用程序中打开另一个应用程序?如果是怎么办?

【问题讨论】:

    标签: android react-native react-native-android deep-linking


    【解决方案1】:

    您无法在您的应用程序中打开其他应用程序,但可以重定向到其他应用程序(第三方应用程序),例如 whatsapp、instagram 或任何其他应用程序

     const url = 'whatsapp://';
    
                 Linking.canOpenURL(url).then(supported=> {
                    if (!supported) {
    
                        console.log('Can\'t handle url: ' + url);
    
             }else{
    
                        return Linking.openURL(url);
    
            }
    
             }).catch(err =>
             console.error('An error occurred', err));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-06
      • 1970-01-01
      • 2015-06-11
      • 2022-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-12
      相关资源
      最近更新 更多