I want to open my public page in vk app (if it is installed). How can I manage to do that
Here's the same trick with facebook
- (IBAction)facebook:(id)sender{
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://profile/1425897281000202"]]){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"fb://profile/1425897281000202"]];
NSURL *url = [NSURL URLWithString:@"fb://profile/1425897281000202"];
[[UIApplication sharedApplication] openURL:url];
}
else {
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:@"https://www.facebook.com/GooodApps"]];
}
}
Thanx!
VKontakte unites tens of millions of people by offering unlimited features for communication, dating, entertainment, business and sharing news from anywhere around the world. On the app, you can listen to music, watch videos and clips, keep track of your health, play games, and shop.
VK is the largest social media networking site in Russia. It's ranked globally for all social networks, second only to Facebook. It ranks higher than Instagram and Twitter. VK also ranks #5 on the list of all websites available.
Apple has removed VKontakte, a top Russian social media platform, from its app store, according to the app's developer. Apple's decision also affects other iOS apps produced by VKontakte's parent, the technology giant VK, according to a blog post Tuesday by the company.
This works for me in Swift:
let appURL = NSURL(string: "vk://vk.com/id\(user.vkID)")!
let safariURL = NSURL(string: "vk.com/id\(user.vkID)")!
if UIApplication.sharedApplication().canOpenURL(appURL){
UIApplication.sharedApplication().openURL(appURL)
} else {
UIApplication.sharedApplication().openURL(safariURL)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With