Reputation: 1456
So I am trying to link to a Facebook page on iOS6 from my app using
NSString* urlString = @"https://www.facebook.com/vioside";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]];
This opens up the Facebook app successfully but it doesn't go on my page. Anyone has an idea on how to link properly on iOS6?
Upvotes: 10
Views: 2332
Reputation: 17
it's working fine i tested it as like:-
- (void)viewDidLoad
{
[super viewDidLoad];
NSString* urlString = @"https://www.facebook.com/vioside";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]];
}
Upvotes: -1
Reputation: 3489
The problem is that you may not use the short name. It has to be the 'id' for it to work currently.
iOS6 and facbook URLs not opening correctly in facebook app
Upvotes: 9
Reputation: 1
Replace "www.facebook.com" with "m.facebook.com":
NSString* urlString = @"https://m.facebook.com/vioside";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]];
Upvotes: 0
Reputation: 1456
I fixed this myself by removing the 'www' from the url. It's funny but with the 'www' is only opens the Facebook app, after removing it, safari is opened instead and views the proper page. Maybe it's an iOS6 bug but this worked for me
Upvotes: 3