1

I am trying to open viber app from my react-native app but its not working. I am getting below error.

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

I have listed viber in my Info.plist

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

This is my code trying to open 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)
    })
Shu.T
  • 439
  • 1
  • 6
  • 12

1 Answers1

0

That should work

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>viber</string>
</array>
Makar
  • 83
  • 2
  • 11