I'd like to implement the native Snapchat App into my iOS Application. I've already done that with Facebook and Twitter by using the URL Schemes. But I weren't able to find such thing for Snapchat.
I found something to open Snapchat in Safari "see it below below", but i need the scheme itself, thanks in advance.
https://www.snapchat.com/add/ProfileName
You can use the following to add a specific user assuming the app is already installed:
NSURL *snapchatURL = [NSURL URLWithString:@"https://www.snapchat.com/add/username"];
if([[UIApplication sharedApplication] canOpenURL:snapchatURL])
{
[[UIApplication sharedApplication] openURL:snapchatURL];
}
Replace username with the desired user's name
let username = "USERNAME"
let appURL = URL(string: "snapchat://add/\(username)")!
let application = UIApplication.shared
if application.canOpenURL(appURL) {
application.open(appURL)
} else {
// if Snapchat app is not installed, open URL inside Safari
let webURL = URL(string: "https://www.snapchat.com/add/\(username)")!
application.open(webURL)
}
I'm doing it like this:
NSURL *snapchatURL = [NSURL URLWithString:@"snapchat://app"];
if([[UIApplication sharedApplication] canOpenURL:snapchatURL])
{
[[UIApplication sharedApplication] openURL:snapchatURL];
}
Also added snapchat to LSApplicationQueriesSchemes in plist.
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