Get arguments passed by Smart Banner iOS from flutter web safari - ios

I have implement a simple code to my flutter web app:
https://developer.apple.com/documentation/webkit/promoting_apps_with_smart_app_banners
Now it shows a banner on top if app is installed or not.
If app is install it shows "Open" otherwise it shows "View" which takes to download.
Now the issue is as per the documents it says you can pass specific arguments if needed like this:
I want to know how do i check in flutter app if the app is opened from smart banner from safari and which app-argument was passed down on opening the app.
I am stuck on this issue for 3 days now.

Use native application(_:open:options:) method to get access to app-argument and Write custom platform-specific code to access it from Flutter or maybe use app_links plugin.

Related

Why dynamic link is not working on ios device when app is in running/background state?

I have implemented firebase dynamic links to my flutter App. In android device every thing is working fine but in ios device dynamic link work only when App is in killed state. It is not working when app is in running state.I click dynamic link when app is running then it does not take me to desired location in my app. It simply opens up the screen which was opened before clicking the dynamic link.
I am using firebase_dynamic_links: ^0.5.0.In this version two methods are provide that are
getInitialLink a future to retrieve the link that opened the app.
2.onLink a callback to listen to links opened while the app is active or in background.
I have no idea why it is not working on ios device?
Thank you in advance.

handling chrome browser, play store and native app together - Android Appium

Here is my scenario:
Launch the native app and go to sign in page of my hybrid native app
Launch chrome browser in my mobile and navigate to particular url. From there navigate to playstore.
Now make sure after clicking the open button from the playstore launches my app(from step 1) successfully.
To achieve this i have did this.
Create an appium driver instance for my native app and launch it. --> Success
Create an another driver instance for chrome browser, navigate, click the link and it will take to the app page in the playstore. --> Success
Now i need to click Open button in the playstore and check when my app has been pushed to view. --> NOT SURE HOW TO DO THIS
I am having my control only on chrome browser and my app. How i can make this happen and your help is appreciated.
Just use the driver that you have for your apk app. By default it has the track of the current focused app of your mobile (in view).
For example, if you are in your app, and now you changed to settings app or some other app, if you get the driver.getPageSource()it will give the page source of the current view automatically. Basically you have control over the current view (android apk ) through the appium.
You have set up chrome browser so simply navigate to https://play.google.com/store/apps?hl=en inside web view and verify that your app has been shipped using store search

How to transfer a firebase dynamic link to a newly installed application?

Everything I say pertains to ios 9 and above.
Firebase documentation says:
When a user opens one of your Dynamic Links, if your app isn't yet
installed, the user is sent to the Play Store or App Store to install
your app (unless you specify otherwise), and your app opens. You can
then retrieve the link that was passed to your app and handle the link
as appropriate for your app.
I succeeded to install my application by FB-link and to open my installed application by the link. But when I try install and open in single step the application is opened without link passed. That is if my application already installed and I click on the link then the application is opened with link passed. But if application is not installed and I click on FN-link then iOS open AppStore and install the application and then I click on 'open' button and the application is opened without links. I am sorry for my bad English but hope that you are understanding me.
UPDATE
I've seen same similar question and question.
Check points.
Application starts (openURL is executed) by custom schema url (in my case it is same as bundle id)
Application starts (continueUserActivity is executed) by dynamic link.
I tryed to use cellular instead of wi-fi without success.
If application not installed taping on dynamic link open AppStore with my app.
In didFinishLaunchingWithOptions I call [FIRApp configure].
Nothing helped.
I didn't say that I use Xamarin and Xamarin FireBase
May be it uses the old version of native FireBase library.
SOLVED!
Xamarin Firebase plugin has been updated and problem have been solved.
Let me suggest how to test the Firebase Dynamic Links on iOS in the case when the iOS App is not installed.
Remove the iOS App from iPhone (ensure to use actual device, not Simulator);
Generate Firebase Dynamic Link and paste the link to the iOS Notes App;
Tap on the link in Notes App;
Ensure that you see Interstitial page, where you tap on "Open" button. After this you should be navigated to Apple AppStore;
Put breakpoint or NSLog to [UIApplicationDelegate application:openURL:options:] and observe the url value;
Install and launch the App using Xcode;
Shortly after App is launched you should observe call to the [UIApplicationDelegate application:openURL:options:] with url. Here you will call:
FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks]
dynamicLinkFromCustomSchemeURL:url];
If Firebase Dynamic Link is found you should see dynamicLink.url property being non-nil. If Firebase Dynamic Link not found, you will see dynamicLink.url property being nil.
When this scenario working well, you can re-check FDL behavior in Safari, Facebook, Email and other apps.
If App is already installed, then tapping on Firebase Dynamic Link should launch the App with the link. Watch out for [UIApplicationDelegate application:continueUserActivity:restorationHandler:], value userActivity.webpageURL.
I was able to solve this issue on my end without any code changes, and by simply running pod update and updating to the latest version of Firebase.

How do Apple detect if an iphone app is installed when clicking on a pure html link?

I am trying to detect if my ipad app is installed on a device when visiting my website, in order to suggest different action to the visitor.
Thanks to this post :
https://stackoverflow.com/a/8310348/1128754
I found that the "store" application on iphone seems to have achieve to detect if the app is installed on the device. When you click on store links, it launch the app instead of going to the mobile web version.
For example, if you go to :
http://store.apple.com/xc/anythinghere
with an iphone on which apple store app is installed ( http://itunes.apple.com/app/id375380948 )
it automatically start the store app, instead of the web page.
I tried to follow the stack call with mitmproxy but safari doesn't seems to ask query before launching the app.
So, I guess they did custom url scheme recognition, with http:// links.
Do you think it is possible?
This is done with URL protocol handlers:
http://www.iphonedevfaq.com/index.php?title=URL_schemes#URL_Protocol_Handlers
You cannot detect if an app is installed from HTML, but you can launch an app. For example, the popular game "Doodle Jump" can be launched by going to doodlejump://, but if you don't have it installed, the link won't work. As mentioned, this is done with a custom URL scheme and needs to be coded into your app.

How iOS handle URL scheme duplication?

If 2 other app register same url scheme, how iOS handle this?
The iOS Documentation reads:
Note: If more than one third-party app registers to handle the same URL scheme, there is currently no process for determining which app will be given that scheme.
The OSs behaviour is undefined if there are two apps registered for an URL scheme, therefore you should try to define a handler that is specific for your app to avoid this situation (e.g. awesomeMapsApp:// instead of maps://).
Actually it can be really problematic. For example, til' March 2016, an app called Grabb handles PayPal schemes so that if your app tries to open PayPal (with all the security nonce etc. within the call) it launches Grabb instead, and you can do nothing about it. Even with the openURL alertView added in iOS 9, it can still be a big security issue.
Here is what I have tested:
iOS 5: the first installed app will be chosen. If you delete first installed app, then the others will not launch unless you install again.
iOS 6: the lastest installed app will be chosen. If you delete the lastest installed app, then the previous installed app will be chosen.
It will present an UIActionSheet view allowing the user to choose which app to launch (good example are apps that handle .doc files). That's where the icon you specify is used - on the action sheet buttons when it's shown to the user

Resources