iOS app URL scheme for Facebook Messenger - ios

I want to share my app URL scheme via FB Messenger, my URL scheme is myapp.
The problem is, when I send the message: myapp://?param1=1234, FB Messenger shows the message as plain text and not as a link.
My question is, what should I do to FB Messenger recognize my URL Scheme?

Facebook Messenger doesn't see custom URL schemes as hyperlinks, which is why they're being shown as plain text. Even if they were, those links would break for anyone who doesn't have the app installed so it would lead to a somewhat unpleasant user experience.
What you probably want to do instead is wrap your custom URL scheme links inside a standard HTTP link by using a redirect. If you add some fallback logic, you can even send visitors without the app installed to the app store to get it.
Branch.io (full disclosure: I'm on the team) can handle all of this for you and also does what is known as 'deferred deep linking', which means you can still route users without the app to the correct page after they have downloaded it.

Related

IOS open an application from browser, and after processing send response back to browser

I want a technical help about my website and mobile application communication.
The flow is user will press checkout from the web, and it will redirect to mobile applicaiton on IOS. The application will take the payment and send the response back to Webpage opened in safari.
I have explored some optios like Deep linking and back linking but the issue is In deep linking we can transfer some data to mobile app but we cannot take some response data back on webpage. and the same is with Back linking.
please note that if I open the webpage again using open url method It will open a new tab, but I want to redirect to same page on safari with some response string.
Pleaes note that the platform is IOS, and the communication will be between webbrowser and IOS native Mobile app.
Try checking out the Universal Links documentation. It should support your use case.
When checking out, redirect the user to a URL you control that matches your schema, then iOS will redirect to your app, and when you wish to go back to the browser, simply open a link back to your site.

share post on facebook using applinks iphone

I am working on a app which has the user feed of posts and I want to post feed post on facebook just like instagram do and if user will clicks on facebook shared post user will redirect to app or appstore, we are not using any post hosting server.
To implement this feature I found this url from facebook and I successfully got the object:
{
"canonical_url": "url",
"id": "643402985734299"
}
here I am facing problem to share my post with this given object please help.
I recommend using a deferred deep linking service like Branch which is free to use. You'll be able to generate links that work from most other apps including Facebook. You can start by implementing the iOS SDK.
In terms of sharing, you should be able to use the Facebook iOS SDK to add functionality for sharing pieces of content directly to Facebook. If you embed a Branch link as the contentURL you'll be able to link to the content in your app regardless of whether the app is installed.
Branch already leverages App Links for you so you do not need to do any specific handling just for Facebook.

Universal Link does not work in Safari

I have implemented google sign-in in my app. The problem is when I go to Safari for the sign in I want the user to be redirected back to my app.
The first approach that I tried was using Custom URL scheme. This worked, however the user was shown a pop-up saying 'Do you want to open (app name)'.
It appears the solution to this pop-up is Universal Links, which I have implemented. I can seamlessly now navigate to my app from Notes and other apps. However, when I tried this inside my app, it doesn't work and the user is redirected to the website instead of the app.
For testing, I created a website and added a button to it, which was linked to my original website. When I open that website in Safari and click the button, my app opens. So why doesn't the redirection from google sign-in to my website open my app?
Universal Links do not work with automatic redirects. They must be triggered via some sort of user action. The link URL also needs to be on a different domain/subdomain from the page where the link is being clicked (e.g., example.dom and link.example.com).
Based on your description of link behavior from Notes and other apps, it appears your configuration is correct and you are simply attempting to do something that Universal Links does not support.
For others who find this question via Google and do not have links from Notes working correctly, try the Universal Links validator tool from Branch.io (full disclosure: I'm on the Branch team).

Xamarin iOS Universal Links support for Twitter Auth

So, now twitter from 25 sep supports universal linking, it means that when UIWebView hits https://twitter.com/oauth/authorize?oauth_token link, it tries to open a twitter app, and if it is there, then it redirects me to auth page with auth error, so I wonder, how can I disable it from code, without uninstalling twitter app, or how I can enable universal linking auth in my xamarin ios app? Is it possible at all?
(similar question but for native: Disable Twitter Universal Deep Links)
Unless Twitter removes/updates the apps section of "https://www.twitter.com/apple-app-site-association" to allow a bypass or a secondary oauth that is not in the apple-app-site-association file I do not see how you would do it. These files are signed and iOS handles them at an OS level.
I have not played around very much with the continueUserActivity delegate and the NSUserActivity object that is passed to apps launched from UNI links, but I do not see a way for the launched app (i.e. Twitter) to return control to the original app, and at that point the oauth call-chain would be broken anyway....
Unique. Unlike custom URL schemes, universal links can’t be claimed by other apps, because they use standard HTTP or HTTPS links to your website.
Secure. When users install your app, iOS checks a file that you’ve uploaded to your web server to make sure that your website allows your app to open URLs on its behalf. Only you can create and upload this file, so the association of your website with your app is secure.
Via: https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html

Is it possible to call native ios Facebook login dialog from just a web page (not a web app)?

We have an ios app that uses native Facebook login just fine.
Then we also have a website (app is basically an optimized client for it) where people can login via Facebook too. When they open our website in mobile safari, they are directed to Facebook pages to authenticate there and it works, but.. it is still far from native and users have to retype credentials they often have in ios already.
So could it be possible to to somehow launch system fb authentication for just a web page (maybe using some clever URL schema?) and get granted token back to web?
Difficult way
As described here http://aaronparecki.com/articles/2012/07/29/1/oauth2-simplified#mobile-apps you could find URL scheme to trigger the native iOS app for app authorization:
fbauth://authorize?redirect_uri=[redirect_uri]&client_id=[client_id]&response_type=token
But if you call that link it's not possible to have a redirection. You could try to hack that redirection but maybe you could not find a way out.
A secure way to solve that problem is to use a SSO token to authenticate user on your App when he logs in, and next on Safari take a redirection, with a custom url to your APP, that do as bridge to FB App via Token stored in your APP. After FB authentication you can directly redirect user back to your landing page in Safari. As said by #Lego it's an alternative way to direct authenticate that could be made by going deep to custom URL used by FB.
No, it is not yet possible to directly authenticate the user via the native Facebook App, but it's possible to authenticate the user using a custom URL scheme which opens your native iOS app which then handles the authentication flow:
The user authenticates natively with your iOS App. You then store the user login (not password) in your app (i.e. using NSUserDefaults).
Then the user opens your web page in Mobile Safari. You redirect the user via a custom url scheme to your app (i.e. using myapp://authenticate). Apple documentation on implementing custom URL schemes: click
Now, if you have an active FB session in your iOS app, you can either directly redirect the user back to your landing page in Mobile Safari, passing the access token via url get parameter or you first re-authenticate the user, displaying a login view with the user name pre-filled, which you have stored in your iOS app before (step 1) and then redirect the user to your landing page, again all depending on session state and your security needs.
For opening face book app you can use Custom URL scheme. But i am not sure if u can authenticate user from it. In case if you could also then it will be confined up to the fb account which is already configured on that device app .so better try to use face book api or something
I don't get your question exactly but i think as per your question you want to create fb app Login in safari or in your custom web view.
is this perfect ?
as per my knowledge web view is different thing and native app is different thing.
if you are Login in web view then no need to check anything token or other thing because it will give you Logout thing there.
but if you are Login in your application then "developer.facebook.com" will definitely help you.
and yes, you will do most of the thing in your app as native facebook app do.
Hope it help....

Resources