Parsing ActionCodeSettings in iOS via dynamic link - firebase-authentication

I'm trying to direct the user directly back to my iOS app when they sign up for a new Firebase account and click on the verification link in their email, but I'm unable to access the parameters generated in the ActionCodeSettings.
I'm doing this via a dynamic link, and it does redirect the user back to my app, but the url params are not exposed. I have tried the AppDelegate code from the Firebase documentation here, but no luck.
I've seen mention of an applyActionCode method in Swift but if I can't even surface the query string from the link then there's nothing for me to pass to that method anyway.
Anyone ever deal with this before?

Related

Firebase Console Dynamic Link OFL Parameter

I need a dynamic link (short url) that:
on mobile:
when app is installed -> open app
when app is not installed -> open store
on desktop:
open specific web url
I managed to get it working for the mobile part. However, on desktop it also opens the deeplink for the app. The documentation states to use the OFL parameter for that. Now if I manually add this parameter to the long url everything works as expected but I need a short url. How can I add this parameter via Firebase Console directly?
Cheers
The 'ofl' feature is not yet available for Dynamic Links created via the Firebase console. Currently, this is only possible with Manual URL construction dynamic link. The idea is to add the "ofl" parameter to the url to make the FDL redirect another URL on the desktop, like displaying a full web page of the app content.
I faced the same problem and i fixed it by using the property longDynamicLink that the DynamicLinkParameters object provides as they said in documentation:
/// Set the long Dynamic Link when building a short link (i.e. using `buildShortLink()` API). This allows the user to append
/// additional query strings that would otherwise not be possible (e.g. "ofl" parameter). This will not work if using buildLink() API.
final Uri? longDynamicLink;

How to know app was installed through firebase dynamic link in didFinishLaunchingWithOptions?

I am implementing firebase dynamic links in my iOS app and I can already parse the link, redirect to AppStore etc. Now I want to distinguish the first run of the app, when user installs it from the dynamic link - I want to skip the intro and show him the content that is expected to be shown.
Is there a way to know how the app is opened before being in didFinishLaunchingWithOptions?
The method application:openURL:options: will be called when Firebase Dynamic Links iOS SDK finished retrieving the pending (deferred) dynamic link.
If pending dynamic link is found, the object [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url] will have non-nil property url. The url will be equal to your deep link, that user tapped while your App was not installed. If link is not found, this property will be nil.
I suggest you to show "loading screen" in your didFinishLaunchingWithOptions. When Firebase Dynamic Links SDK will pass you result, you can proceed with custom onboarding if pending dynamic link is found. Or default onboarding if pending dynamic link is not found. Keep in mind, if network is slow, this may take some time. You may want to have timeout set to X seconds, to not hold your user too long at "loading screen".
Documentation about receiving Firebase Dynamic Links on iOS https://firebase.google.com/docs/dynamic-links/ios/receive

How do I Login inside app to use GPPNativeShareBuilder of Google API in Objective C?

I am using Google Plus API for login purpose.
My app rejects once due to GPPSignIn (Not Google login within app), then I used GTMOAuth2Authentication for login with Google. This allow me to login inside my app.
This goes well.
I am worrying about share on Google, for same issue (rejection), I implemented GPPNativeShareBuilder, which allows me to share within app, but this goes out of app for login, when tried with same GTMOAuth2Authentication this gives me error message:-
[GPPNativeShareBuilderImpl open] User must be signed in to use the native share box.
I used this also
GTLServicePlus* plusService = [[GTLServicePlus alloc] init];
[plusService setAuthorizer:self.auth]; // authentication object!!!
This produces same warning error, not presents share dialog.
Help me, Thanks in advance.

xcode twitter api authorize screen issue

I have an app that I'm using the xcode IDE and writing in Objective-C that uses the twitter api and the 'default' twitter login page for username and password.
I already have all the oauth stuff set up and it is working fine.
I create a new view controller with a web view inside it, and pass the URL of https://api.twitter.com/oauth/authorize.
If I put in my email and password, everything works fine - the view disappears, and we are then off and running.
If I press cancel on the twitter login screen, I get a twitter page saying I need to log in. I need to capture the cancel in my code so I can dismiss the view controller, but I cannot find out what the name of the callback is? I tried didFailLoadWithError but that is not it.
Can someone shed some light on this please?
It turns out it can be handled from the same callback that handles a 'correct' login. except looking for a failure.
So, they have handled it correctly within the original callback.

Creating a facebook application

Hi I created a desktop application. I was wondering what I should put for my Canvas Callback URL. I tried to define it as local (http://localhost:8084) but it doesnt accept it.
I need it to get the session using http://www.facebook.com/login.php?api_key=YOUR_API_KEY&v=1.0
Thanks!
Your canvas callback URL has to be an address that Facebook can actually fetch data from. That is not localhost, since as the name implies that is local to you.
Read the following: http://wiki.developers.facebook.com/index.php/Canvas_Callback_URL#How_It_Works
Your canvas page URL is http://apps.facebook.com/foobar/
Your canvas callback URL is http://www.foobar.com/yourapp/
[...etc]
Putting localhost as the canvas callback url is like buying something online and filling the shipping address as "my house".
For some basic information on how a Facebook application works, this is a good reading material:
http://wiki.developers.facebook.com/index.php/Anatomy_of_a_Facebook_App