Joel Denke
01/29/2024, 10:50 AMmattinger
01/29/2024, 6:07 PMmattinger
01/29/2024, 6:09 PMMy first case is to navigate to another native app if its installed, and if not open AppStore/Google Play if it exists and if not open url as fallback.
There’s several products out there to handle this, and i’m not going to vouch for one over the other, and I know that Firebase links is sunsetting sometime next year, so that is not really an option.Joel Denke
01/29/2024, 6:12 PMmattinger
01/29/2024, 6:26 PMcurioustechizen
01/30/2024, 1:33 PMNavigate to another native app if it is installedEven on Android, this is not a one-liner if I understand your requirement correctly. • First, you open an activity, not an app. • If you own the other app, then things are probably fine. If not, you'll need to go for the
queries
element in the Manifest and you'll be subjected to PlayStore policies since you are using some specific PackageManager APIs.
• You might instead use a try-catch (not sure if any restrictions have appeared around that).
On iOS I think this might not even be possible. As in, the generic intent mechanism doesn't exist on iOS. You probably need to know that another app ins installed and you need to know the format that it expects data in. (Not an expert, just thinking out aloud based on what I gathered from discussions here and there).curioustechizen
01/30/2024, 1:36 PMJoel Denke
01/30/2024, 1:43 PMMy first case is to navigate to another native app if its installed, and if not open AppStore/Google Play if it exists and if not open url as fallback
🙂 But yeah I did used a lot of frameworks in Android to allow CMSs to be happy creating deep links between apps and urls in web pages, but never worked well imo. I prefer never to have that kind of dynamic framework. In my case I want pre-defined things, like open Slack app or App Store, and not any url or app.
Main issue how to decouple this logic with both Android and iOS, and in future also for desktop and web 😄
I think there is an UiApplication.openUrl thing, given that iOS apps allows custom url queries, as Apple warns for exploits using it.
For try catch vs PackageManager I prefer one shot try catch and hope user having the app to be launched. Other variant open up some security things in your own app, expose third party connections kind a.
Feeling confident in the Android code itself, but not how to make the code agnostic, as I cant use Uris in iOS 😄 iOS mostly using NSUrl it seems like in their APIs.
From what I seen so far NsUrl is very similar to Android Uri in how to parse web url structure of Uri parts etc. But not sure if its the case for all things or not.
If thats the case it will work well with web, and for desktop as well I think.
The main complexity I think will be things like share Intents, or pick files or media, or request sharing content between iOS and Android 😄 So I will avoid that as much as I can.