Prevent link to open in PWA - hyperlink

A have multiple web applications that are all PWA. From application A, I need to open application B in a window which allows me to navigate to any of the other applications and make a selection, which I then send back to application A by using 'window.opener.postMessage'. This works great on desktop. It opens a single new window, in which I can navigate my whole application suite and it stays in that window. On mobile however, every link to another (pwa) application is automatically opened within a new PWA 'window' which is fine at every other moment, but not when you want to send back data to the originating opener. Is there a way to prevent a link to a PWA application to open the PWA application, and instead just open in this same browser window?

Related

Pass data from App to Safari Web page back using Universal Links in iOS

As per Apple documentation ,Support Universal Links , we can move control from Safari to App using Universal Links.
In my app, when user is in doing some actions in web pages, only for particular action I want to move control from Safari to my App. Then I want to do some action in App and then again want to move control to Safari's web page, from where I had moved control to App , with output data that got generated in App by using web service.
I know user can go back to Safari from App by clicking on breadcrumb button in the status bar. But I want to achieve this programatically.
How can I achieve this.
Just use openURL in your app to open the web page you want to return to in Safari. The Universal Link will not be in effect in this case, since you're in your app and iOS will correctly deduce you just want to open Safari.
configuring Universal Links does not require you to include the query part, which means you can still use it to pass data (in both ways)
You registered http://acme.com/foo/bar in your apple-app-side-association
You can use openURL to open http://acme.com/foo/bar?data=xxx and your webpage can process the data in the query part of the URL

Handling Custom URL Application Start in ios

We have link functionality in our web application that when clicked, browses to a page on our server that performs the following:
Tries to open the custom url to our ios application
If this fails, it redirects the user to our ios app store to download the app.
This actually all works perfectly well.
However, it creates a weird corner case, where after a user has done this and finished, if they come back sometime later and open their safari on the same phone, if our web link is still the active tab, it will redirect them again to our application.
The cause of this is fairly obvious, but we are struggling to come up with a solution for it. Is there any known to rectify this behavior, either through a different mechanism then I described for opening the application or through somehow killing the page simultaneously?

Phonegap how to come back to app screen and exit from app iOS

I am creating a phonegap application that posts the login information to my website. When user signs off I want to come back to my app. Do I just send the url location along with the post data so that I can come back? or there is another elegant way?
Also when user clicks on the iphone home button, I want the application to exit. Currently it just saves the session and the page and goes back directly to the page if I start the application again.
I am using adobe phonegap site to build and test the application
From your description, I assume that you are navigating the Phonegap WebView (which is running your app) to the URL of your website?
If so, at this point you no longer have an app to navigate back to - the WebView has lost its handle on your app. In order to "navigate back" to your app, you should use the InAppBrowser plugin to navigate to your website. This will allow you to return to your app after the user logs out from your website. You'll need to somehow communicate the logout from your website in the InAppBrowser WebView to your app in its WebView. You may be able to achieve this with cross window messaging.
You can't "exit" an app in iOS - the OS does not allow you to do this. The best you can do is use the resume event to detect when your app has been restored from the background, then manually reset your app to its initial state.

is it possible to get notification from browser when page is loaded completely?

if I want to design an iPhone app to do this monitoring, is it possible? such as open the app and input web address, the app can call safari's function to request and render the webpage, so that i can monitor the page load event in the app. How can I achieve that?
or
create an app that monitors the time taken to load a web page by any browser on iPhone. let suppose i have button in my app on clicking the button my app will start monitoring the other apps, now if i start safari(or any browser) and try to open web page, than the time taken to load web page must be calculated by my app. is it possible to do??

From the iOS chrome app to my app and back chrome on the same tab

The flow I am trying to do here is as follows:
user visits a page in my webapp with the chrome iOS app
user clicks a login link which starts a session and shows a link with an url scheme my iOS app can handle
user clicks that link and my iOS app opens up
my iOS app does it thing ( it authenticates the user )
when finished, I would like to be able to get the user back to the chrome iOS app on the same tab he started from. This tab is polling my server every x seconds to see if my iOS app has finished.
Is this possible? I can open up the chrome app easily just by using the googlechromes url scheme but this opens up a new tab. I need the user to land on the same tab
Similary for the safari app, I can get the same behaviour by using the https url scheme to open up safari.
Ok it seems it is not possible as explained here: Open safari in same tab from iPhone application
I guess it makes sense not allowing this, so other apps cannot manipulate your current open tabs.

Resources