Reputation: 16793
I am trying to open the instagram app from my application and implemented the following code, but it does not do anything. I have instagram app installed on my iphone.
NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
[[UIApplication sharedApplication] openURL:instagramURL];
}
Upvotes: 0
Views: 200
Reputation: 16160
Update info.plist
for Key LSApplicationQueriesSchemes
<key>LSApplicationQueriesSchemes</key>
<array>
<string>instagram</string>
</array>
Code:
NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
[[UIApplication sharedApplication] openURL:instagramURL];
}
Refer instagram docs
Upvotes: 2