Can a progressive web app be registered as a share option on iOS? - ios

I plan to develop an app (not sure if I will go with PWA yet) which includes the following "wishlist" scenario:
The user is browsing a website he likes using safari, chrome or any browser
He clicks the share button in that browser, in order to send the webpage url to another app
He selects my PWA
This url is saved in the user's wishlist
Is step 3 possible?
Note: someone asked the exact same question here about Android: Can a progressive web app be registered as a share option in Android?
My question is just the same, except mine is about iOS. I couldn't find any answers to it.

What you're describing is covered by Web Share Target Level 2.
Currently, it can be used with Chrome on some desktop platforms and on Android for installed PWAs.
It's not available on iOS, unfortunately.

Related

Does Google Search App block universal links

I am implementing Firebase App Indexing as mentioned in official firebase documentation here: https://firebase.google.com/docs/app-indexing/ios/app.
The universal links are enabled and work fine for search results from different browsers like Safari and Chrome. They also work for other applications. But when I tap on a search result from the Google Search App in iOS. It does not take me to my app. Also on long pressing a link in the Google app does not provide an option to open link using my App. This option is however shown when I long press on links from other applications.
Does it have something to do with the Google Search app disabling the universal links deliberately. Is it possible for individual applications to prevent Universal Links from opening other applications?
Or does Apple apply restrictions itself for certain apps?
Indeed, some apps disable the capability of deep linking using Universal Links. Some notable examples: Facebook, Instagram.
Some of these apps allow deep linking via URI schemes (the old iOS 9- way of deep linking), but there is no promise that this behaviour will be persisted.
I'm guessing most of these apps would like to have the user stay within their own in-app browser instead of switching to another app.
I never tried the Google Search app, but if your universal link works perfectly in Safari and not in the Google Search app, that may be the case. In that scenario you'll need your click domain server to redirect the user to the store or some landing page, based on the User Agent of the incoming browser.

PWAs on iOS 12 no longer shares Service Worker cache with Safari?

For the PWA on iOS 11 we solved the external third party login opened in Safari by storing the login details in the service worker web cache.
This no longer works in iOS 12 (in beta as of writing). I think this must be because the PWA now has its own service worker cache that it no longer shares with Safari, but I can't confirm this.
Does anyone know if there is a way to share the service worker cache between safari and the PWA? Note that we already tried IndexedDB, but that is not shared, and of course neither are cookies.
As far as I can figure out this means that a PWA is totally sandboxed from safari and there is no way to get a third party login working. Any solutions?
I asked Jonathan Davis(Web Technologies Evangelist for Apple) on twitter about this question. He says Web apps on iOS (“Save to home screen” apps) do not share data stores with Safari. They work as a standalone app separate from Safari and there is no way to share data between them on device.
As a possible solution that may suit you, I propose an article written by Maciej Caputa. Quoting the author the idea is to create a fake endpoint in service worker, which would save data in the cache on POST request and return cached data on GET request. Link on this article https://www.netguru.com/codestories/how-to-share-session-cookie-or-state-between-pwa-in-standalone-mode-and-safari-on-ios.
Hope this answer was helpful!
OAuth login is now possible as of iOS 12.2 (March 2019) as links of external sites now open in a PWA in-app browser and return links point back to the PWA. As a result I am now able to deploy PWA apps on iOS with third-party Auth0 login (it was already working on Android and Windows).
Note however that login session is not shared between Safari and PWA like in earlier versions of iOS.
I learned of this from this article from Maximiliano Firtman.

Facebook app links don't open app when post is clicked in 2017

I've added app links headers for my web site with metadata for my iOS app, but they don't open app when post is clicked. Is app links works as described in documentation in 2017? (https://developers.facebook.com/docs/applinks/add-to-content)
This is expected behavior
Unfortunately it is not currently possible to directly launch a third-party app from within the iOS Facebook app. This is a known issue that Facebook has essentially written off as wontfix. This is still possible in the Android Facebook app, but it's unfortunate they haven't been more transparent about the change to the iOS version because there is quite a bit of confusion about it.
Instagram is a special case because it is a Facebook-owned app and gets different treatment.
But you can work around it
Services like Branch.io (full disclosure: I am on the team) get around this by implementing a judicious combination of App Links, URI schemes, and iOS Universal Links. Essentially what you need to do is open a page in the webview and then have a button or other user-driven CTA event that launches the app from there. It's an extra step for the user, but currently the best workaround. If you just want to be able to post a link that goes into your app when it is installed and otherwise goes to a webpage (or the App/Play Store), then Branch links are definitely your simplest solution.
Branch link routing logic

Mobile deep linking behavior on desktop OS

Would like to know if expected behavior on deep linking using branch.io so when clicked on should check for app availability and prompt customer on iOS device to
Prompts to download app in App Store if not installed
Open in iOS app seamlessly if installed
If customer declines app download it will open in iOS mobile browser
My concern is this deep link behavior on a desktop experience. When a user clicks the same url I am being told this will take them to the iTunes app store resulting in a poor experience. Is this a correct statement? Is there any way to provide a better experience to the end user.
Thanks in advance!
I am being told if the same url is opened in Windows10 it will take me to the App
For example
1. Users opens email with deeplink url
2. what is expected behavior on mobile device with app installed that deep link
For iOS redirects, you'll have to set yourself up for Universal Linking per the documentation here:
https://dev.branch.io/getting-started/universal-app-links/guide/ios/
This is very important for redirect behavior on iOS 9 and later. Please note that not all 3rd party apps and browsers support Universal Linking functionality yet, so you should test on iOS from iMessage or Notes initially.
As for Desktop, you can set your Desktop redirect on the Link settings page - this will not take users to the App store/Play store on Desktop, but to the page you set. You can use the Branch hosted text-me-the-app page if you want to have this as your default for Branch redirects, or your site homepage, or any other page of your choosing. You can add Deeplink data that will be used for all redirects by adding key/value pairs in the SDK or manually when creating a marketing link from the Branch Dashboard. You can also set a $deeplink_path value that will be honored for a specific link, and you can further set a $desktop_url that will override defaults if you want a different redirect for a specific link.
There are many options and ways for you to configure how your redirects work - all of this is up to how you set your Link Settings on the Dashboard, and if you choose to override these defaults for any particular link. For example, you might have default redirects to the App store set for iOS and a desktop URL set to your main webpage on Link Settings. In this case, a link created without modifying these values will take the user to the App store on iOS (or the App if installed), and to the desktop URL specified in Link settings if clicked from Desktop. If, however, you want to override and set $desktop_url as something else for a given link, say, to a specific page on your webpage using the $desktop_url key, on iOS the redirects will be the same but on desktop you will be taken to the set $desktop_url. For any of these scenarios you can specify Deeplink Data to be passed through.

"Hijack" system-wide http links on OSX and ideally iOS and open native App

Assume I build a native Facebook App for the Mac or for iOS (just an example).
Now whenever the user opens an url http://facebook.com/.. I want my app to open rather than the browser. This is similar to opening google maps links prior to iOS 6 on iOS.
Unfortunately (like in the case with facebook) I do not own the service but I am only consuming its API so I can't forward to another URL from the actual website.
My question now is whether this is possible:
On the Mac with my native Mac App
On iOS (However, here I would be quite supprised if this was possible)
On iOS you can register a custom protocol which triggers if any other app (system, or not) tries to open that URL.
So in other words. Say your app registers the protocol 'myprotocol'. Then if you go to safari and type in the addressbar: myprotocol://sometext it will open your app, and your app can handle that URL.
This ALSO works from HTML loaded externally from Safari. So if your website is shown and on your website you link to myprotocol://sometext and someone clicks the link, then again your app will be opened.
Catching generic http requests system wide is unsupported on iOS
search for CustomURL / customProtocol for IOS apps. you will get your required answers. do let me know if you need a sample code.

Resources