Launching Viber app via URL scheme on iOS

I am creating an iOS application that can open a Viber application and automatically call a person or go to the chat window with a person. Is there any URL scheme for Viber to do this, for example:

viber://tel:<phone_number> viber://chat:<phone_number> 

I followed this link, but for Android.

+7
ios url-scheme viber
source share
9 answers

I sent an email to Viber support and they told me that this kind of URL (opening Viber call / chat with a phone number) is no longer supported. When entering Viber version 5.6.

Look at their answer:

support@viber.com

"Thank you for contacting us. Unfortunately, Viber does not have such an option.


The only thing I found is the URL to send the message: https://www.viber.com/en/developers/share_on_viber you can specify the text, but not the recipient

Example:

 viber://forward?text=foo 
+8
source share

as of now (03/26/2017), I found that this URI works:

  • viber: // add? number = NUMBER - open user page
  • viber: // forward? text = foo - exchange text with selected users
  • viber: // chats - opens the chat tab
  • viber: // calls - opens the calls tab
  • ??? - Cannot find how to open user / contacts tab.
  • viber: // public - opens an open tab
  • viber: // more - open an additional tab (last in the line)

and some links for interacting with public accounts https://developers.viber.com/tools/deep-links/index.html - viber: // pa? chatURI = hello & context = abcdefg & text = hi - try to greet a public account

Support Forum: https://support.viber.com/

and they have a chrome extension - https://support.viber.com/customer/en/portal/articles/2191386-new-chrome-web-extension#top

+9
source share

I found one way to "almost" call using Viber - by adding a contact:

 viber://add?number=0123456789 

The Viber Add Contact dialog box opens, and the user can finally call the expected number after adding it as a new contact.

Tested on 5.6 Viber. Also works from HTML:

 <a href="viber://add?number=%2B49150123456789">Viber me</a> 

However, if the contact does not exist, the first click will open a dialog box, save the new contact and return to your application / page. Pressing the same link again will open a direct contact with the call button.

Hooray!

+5
source share

You can use this code to accomplish what you want:

 NSString *phoneNumber = @"1112223333"; NSString * const viberScheme = @"viber://"; NSString * const tel = @"tel"; NSString * const chat = @"chat"; NSString *action = @"<user selection, chat or tel>"; // this could be @"chat" or @"tel" depending on the choice of the user if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:viberScheme]]) { // viber is installed NSString *myString; if ([action isEqualToString:tel]) { myString = [NSString stringWithFormat:@"%@:%@", tel, phoneNumber]; } else if ([action isEqualToString:chat]) { myString = [NSString stringWithFormat:@"%@:%@", chat, phoneNumber]; } NSURL *myUrl = [NSURL URLWithString:[viberScheme stringByAppendingString:myString]]; if ([[UIApplication sharedApplication] canOpenURL:myUrl]) { [[UIApplication sharedApplication] openURL:myUrl]; } else { // wrong parameters } } else { // viber is not installed } 
+4
source share
 viber://contact?number= mobile number 

It will open a specific contact with the user. Let the user select a chat and call.
it worked for me!

+4
source share

This works: "viber: // chats" or "Viber: // calls"

+1
source share

For Swift, you can do the following :)

 let viberShareUrl = "viber://forward?text=\(shareUrl)" let url:NSURL =NSURL(string: viberShareUrl)! UIApplication.sharedApplication().openURL(url) 
0
source share

This points to the contact page.

viber: // contact? number = 38095xxxxxxx

IMPORTANT: do not put + at the beginning of the number, otherwise it will not work

0
source share

You can check using

 [[UIApplication sharedApplication] canOpenURL:@"viber://url"]; 

if the Viber application is installed on the device, and viber processes this URL scheme, it will return true, otherwise false.

-2
source share

All Articles