I've been trying to go with Applink protocol provide linkback referal from Facebook to original app. The way I've contructed destination link is:
fb://profile/123456?al_applink_data=<encoded_json>
where is url encded string:
{"target_url":"http:\/\/www.facebook.com/123456","referer_app_link":{"url":"myawesomeapp:\/\/member\/bojan-babic","app_name":"MyAwesomeApp"}}
In app itself this is opened in following manner:
let application = UIApplication.sharedApplication()
let targetUrl:NSURL = NSURL(string: targetUrlString)!
application.openURL(targetUrl)
Outcome is that myawesome opens native iOS app, but I do not see "Touch to get back to MyAwesomeApp" header within Facebook App.
What would be proper process to achieve link back to original app?
Note: I've tried same approach with Pinterest iOS app as well
Related
[iOS] I'd like to make facebook messenger bot that sends a URL. Once the URL is tapped, I want it to open the URL in native safari.app instead of an in-app browser in Messenger.app. I tried Safari-search URL scheme, but it doesn't work. Is there any way to open native safari by modifying URL without modifying iOS native source code because, you know, I can't make any change for FB messenger native app?
Typical scenario:
I am managing bot and send FB message with amazon product URL, let's say, https://www.amazon.com/gp/product/B00T85PMWY/.
The receiver tap the url.
Safari will open and show the page.
Open Facebook url in Safari instead of native app go get your answer
I am trying to build an iOS app that can do single sign on using Safari. For example, I would like my app to go to https://example.com and then get some token from there and then switch back to the iOS app with that information for me to use in the app.
Currently, I tried using URL Schemes but if from within the app I try to
[[UIApplication sharedApplication] openURL:[NSURLvURLWithString:#"DevTest://example.com"]];
it is not going away from my app. It is not flipping to safari, but if I use https://example.com as the URLWithString, it flips to Safari, but I don't know on how to do the callback from Safari.
Thanks for your help!
You need to create a link on your website example.com that will start with DevTest://, then when user taps on that link in Safari your app will be started. Don't forget to register "DevTest://" URL scheme in info.plist of your app and implement appDelegate methods for URL launching, see here:
https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html
I want to give the user a link to my app's Facebook page so the user can like it. I don't want there to be any login, permissions or any other social functionality. I thought I could use a simple link like this:
UIApplication.sharedApplication().openURL(NSURL(string: "https://www.facebook.com/MyAppPage")!)
I thought this would take the user to the Facebook app and open my app's page, or if the user doesn't have the Facebook app installed, take them to Safari. It did go to the Facebook app, but didn't go to my page. Is there a simple way to do this? Do I need to implement the Facebook SDK or Social Framework?
Here's the solution I use. Your app will have two links, one for the FB app and one for the browser. This will check to see if the device supports the FB app link first and if not show it in the browser (if available).
let urls = ["fb://profile/xxxxxxxx",
"https://m.facebook.com/xxxxxxx"];
let application = UIApplication.sharedApplication()
for urlString in urls {
let url = NSURL(string: urlString)
if(application.canOpenURL(url!))
{
application.openURL(url!)
return
}
}
I am trying to implement Facebook App Links using the Mobile Hosted API. Everything goes smoothly but when I test the App Link URL the app doesn't open even if installed and the URL redirects to the App Store. The custom URL for my app is set properly as when I type the custom scheme inside Safari it does open the app. It seems that something is off but can't tell why.
Here is some data:
The url that I test in the browser is:
http://fb.me/780961121977733
This is the registered data with the Mobile Hosted API:
{
id = 780961121977733;
ios =(
{
"app_name" = GoPhrazy;
"app_store_id" = 903559056;
url = "gophrazy://playerPuzzle/leo3/1420663071896";
}
);
}
The custom url scheme is registered in the info.plist as:
gophrazy://
I thought maybe the app_name case would affect it but I tested that to all lower with no effect.
Anyone has any tips on this?
Thanks
Url scheme in the info.plist MUST be always defined without leading ://
I know the available custom URL schemes for the native Facebook iPhone App:
What are all the custom URL schemes supported by the Facebook iPhone app?
But I can't find a way to publish a URL to my wall / timeline in that way, that Facebook collects / shows the site title and thumbnail as it does with the touch.facebook.com/sharer.php file.
The only way I see so far is to call
fb://publish/?text=www.domain.com
but this only post the link to my timeline, not title, thumbnail and site description.
Does anyone know a better way?
Basically you have two options:
You can either launch Safari using the Feed Dialog URL Scheme as explained here or use Facebook SDK as explained here.
If your App isn't integrated with Facebook already, it's probably easier to go with the first one.