is there any way to open Facebook url (ex. http://www.facebook.com/facebook) in Safari instead of native app? I\'m tried to do this:
NSURL *url = [NSURL URLW
Copy link to the messenger app and send to yourself. Open the link on messenger app and click on share and will apear open with facebook app
Ok, I think I found answer, you must replace "www.facebook.com" with "facebook.com" in url.
Something like this:
NSString *facebookUrlString = @"http://www.facebook.com/facebook";
if ([[facebookUrlString pathComponents] count] > 0) {
if ([[facebookUrlString pathComponents][1] isEqualToString:@"www.facebook.com"]) {
NSMutableArray *pathComponents = [[facebookUrlString pathComponents] mutableCopy];
[pathComponents replaceObjectAtIndex:1 withObject:@"facebook.com"];
facebookUrlString = [NSString pathWithComponents:pathComponents];
}
}
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:facebookUrlString]];