【问题标题】:Trying to open viber app from my react native app. (iOS)尝试从我的 react native 应用程序打开 viber 应用程序。 (iOS)
【发布时间】:2020-09-06 20:49:19
【问题描述】:

我正在尝试从我的 react-native 应用程序打开 viber 应用程序,但它无法正常工作。我遇到了错误。

Error: Unable to open URL: viber://contact?number=%2Bxxxxxxxxxxxx. 
Add viber to LSApplicationQueriesSchemes in your Info.plist.

我在 Info.plist 中列出了 viber

<key>LSApplicationQueriesSchemes</key>
<string>viber://</string>

这是我尝试打开 viber 的代码。

Linking
   .canOpenURL('viber://contact?number=%2Bxxxxxxxx')
   .then(res => {
        console.log("Viber response->",res)
        if(res) {
           Linking.openURL('viber://contact?number=%2Bxxxxxxxxx')
        }
    })
    .catch(err => {
        console.log("Viber Error:", err)
    })

【问题讨论】:

    标签: ios react-native deep-linking url-scheme viber


    【解决方案1】:

    应该可以的

    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>viber</string>
    </array>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-29
      • 2019-08-26
      • 1970-01-01
      相关资源
      最近更新 更多