Showing custom popup in safari if app is not installed - iphone

I have written code in iOS for launching my app from a custom url in safari and it all works well as long as my app is installed. But if it is not installed then safari shows a popup saying it cannot open the page because the address is invalid. However, my stop page still opens up in the background prompting the user to app's link on app store.
My question is, how do i change this popup to show a custom message instead, a message that can relate to the stop page im displaying.

Related

Flutter Webview disabled to open installed Apps by clicking on link

I have a simple WebView in my Project. The user can google and search for anything. The problem that I have right now is that by clicking on certain links, I get automatically redirected to the specific app (if I have it installed).
Example:
I have the Adidas App on my iPhone and tap on a "Adidas"-Link -> I get redirected to the Adidas app. That should not happen. Instead the link should be opened within my WebView.Is there any way to prevent other apps from opening?
Is there any way to prevent other apps from opening?

when the dynamic link is opened from browser(especially in safari) it is always redirecting to the app store even though app is installed in iOS

My URL is same as below, i will get this link to my mail from sendgrid and in iOS when i tap on this it always loads the browser first (safari most of the case) and opens in app preview page even though app is installed.
URL:<a clicktracking="off" href="https://{project_name}.page.link/?link=https://{project_name}.page.link/users/email_check/{{ $email_token }}&apn=com.{project_name}.app&isi={applestoreid}&ibi=com.{project_name}.app&efr=1">https://{project_name}.page.link/?link=https://{project_name}.page.link/users/email_check/{{ $email_token }}&apn=com.{project_name}.app&isi={applestoreid}&ibi=com.{project_name}.app&efr=1</a>
When you access a dynamic link in a browser. It will intentionally not go to your app because the actions indicate that your intent is to open a web page.
If you have your custom domain from Firebase ie: [your custom domain].app.goo.gl, send it into your link like so:
https://[your custom code].app.goo.gl/
And then tap that link. Does it open the app, or does it go to Safari? If it goes to Safari, it means that you haven't configured your iOS app for universal links yet, which is needed to support opening your custom domain url directly in the app. In Xcode, go to the Capabilities tab, and ensure that you've added the universal link domain as described in Apple's docs.
If you tapped the site address on the far top-right on iOS, it disables universal linking on that iOS app, until you long-tap and ask to open in the app again.
Second, you can't type in universal links into Safari's address bar and navigate to the app. Safari, by design, will open that URL in the browser. The easiest, most reliable way to test whether universal links are working is to put a universal link into the app, and tap the link from there.

forge.tabs tab closed on iOS when app is send to background

We are using trigger.io (2.1.0) in our mobile app and are opening the LinkedIn OAUTH dialog in a forge.tabs window (using forge.tabs 2.6).
LinkedIn sends Authorisation Mails to Users when they authorise an app for the first time and the user has to enter an authorisation code he received via email in the view we opened in the forge.tab.
Unfortunately the tab in which we show the dialog is closed on iOS (iOS 7.0.4 here) when the app is sent to the background when the user switches to his mail app to get the code.
The user returns to the app and can't enter the code he just received. If he reopens the linked in authorisation dialog the code he just copied is not valid anymore (he is sent a new one).
How do we prevent the tab from being closed when the app is sent to the background?
Best regards,
Richard
Official fix is in launchimage v2.3
Thank you to everyone who contributed to this question.
We found the offender: The trigger launch image module seems to interfere with the trigger tabs module.
We stripped the project down to the last bits (load the tabs module only) and ended up with a plain html file which opens a trigger forge.tab when you click on a button.
Here the tab will persist even if you send the app to the background.
We found out that the trigger launch image module causes this behaviour - as soon as you add the module the trigger tabs vanish when the app is backgrounded.
We can confirm that the launch image module closes all modal dialogs when the app is backgrounded - we forked the module and will try to fix it.
As long as you want to use the launchimage module, the Trigger.io tab will always close when the app loses focus. See Richard's answer for more information.
A good workaround is to use Mobile Safari for the authentication process. After the authentication is finished you can make use of Trigger.io's URL scheme module to forward the user back to your app automatically.
Positive side-effect: the user might already be logged in on his Mobile Safari.

Return to app from safari

In my application, I redirect the user to the safari browser when he/she taps on a button, which in turn closes the application and opens the safari browser. There is no problem in that. It works fine. The thing is when the user quits the safari browser, I want to redirect the user back to the application, not the home screen. Any idea please...
If you control the website that you are redirecting them to, then you can place a link on the site using custom URL which I describe in more details below. But if it's a site you don't control, you can have the user surf within your app using the UIWebView.
For an iOS app, you can create custom URL schemes that your app register with the system. Then on the web page you would create a link using that custom URL. That is how Apple launches the telephone.app or the mail.app from mobile safari.
For example: Let say your app is call BigBadApp. You custom URL would be: bigbadapp:// Now, you could create a link to your app would be: Launch BigBadApp You can pass any kind of information back to your app using the custom URL and your app will handle that information in the app delegate. For iOS 4.2 and later: application:openURL:sourceApplication:annotation:. The name of old delegate on earlier version of iOS is application:handleOpenURL:
For more information see check Apple Implementing Custom URL Schemes.
Also iOS developer:tips has a tutorial on Launching Your Own Application via a Custom URL Scheme.
You can't. When you redirect someone out of your application the only way to get back is using the task switcher or opening your application from the home screen again.
If you want to keep the user in your application you could open the web pages in a webview within your application
use UIwebViewController . that represent web link within app . so that your app wont be in back ground and add back button in navigation bar on click back button navigate to back screen . i guess it would be better
i would launch an in app browser...
this is a good uiviewcontroller subclass that has most of the browser functions already implemented. its very easy to use.
https://github.com/samvermette/SVWebViewController

iPhone Web App -- Links launched via "Home Screen" mode

I have an mobile web application that I'd like users to be able to use on "home screen mode" (that is, adding it as a bookmark to the homescreen, and then launching the web app via the home screen button).
However, this seems to behave differently than if it the web application was accessed via mobile Safari. For example, whenever I click a link on the web application (even an internal link), it separately launches an instance of Safari instead of displaying the page within the current "browser" (or whatever is launched when you click a bookmark on the home screen). How do I fix this?
Thanks!
iPhone Safari Web App opens links in new window