One URL scheme for both Ios and Android - android

So I am in the mids of inplementing url-schemes in my app (React-native and for both Android and Ios) but I am having some trouble with the html implementation of the url schemes.
I figured out that for android you have to use:
<a href="intent://Something/#Intent;scheme=SomeApp;package=com.SomeApp;end">
But for IOS only this link works: <a href="SomeApp://Something">
Is there a way to allow both the android and IOS app to use the same link to open the app? I figured that it's quite common to ask that but I couldn't find any resource on the internet that was usefull for this. I could try to make some JS code to try both the links but that's not really a pretty solution (Android doesn't respond to the IOS link so I can run that one first and then the Android link after that)
Any help would be appreciated!

Related

Open mobile app when you click a link in IOS

I am working on a React project. The same web app has its Android and IOS apps as well.
When I copy a web app's link to android users' mobile phone, It asked to open through web or app like this.
But I try to open the same thing with the IOS device. It directly opens the link in the web browser.
I am new to this project and I have no access to any documentation for the project. How can I add android behaviour to the IOS? Is this can be done in the React web app itself?
I think this will help with support universal links:
https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html
In addition, there is a very detailed explanation here in terms of react native. I wanted to direct you in case you might not have come across.
https://rossbulat.medium.com/deep-linking-in-react-native-with-universal-links-and-url-schemes-7bc116e8ea8b

Html: Open ios application by href link

I use below code for android and work fine :
href='intent://name.com#Intent;scheme=http;package=com.name.app;S.POSITION=handle;end'
But for ios i can't find href solution
Please refer below flow of ios and web for implementing this in IOS.
IOS ::In Info.plist add a URL Types for example "SomeIdentification". (you can add hostname of your site)
WEB :: Your app will now open when you strike "SomeIdentification://" in safari. If you are using any other link then you need to detect ios devcie and trigger "SomeIdentification://" onclick of URL.
For more detail of ios you can refer

Viewing a PDF file from HTML5 Hybrid Mobile App

Intending to view a PDF File from the Hybrid Mobile App , created using HTML5 Jquery and Packaged with Phonegap.
But unable to achieve it ,
Things i tried
<object src="xyz.pdf" type="application/pdf"></object>
also,
window.open('xyz.pdf'); //through javascript
and
$(document).load('xyz.pdf');
Can anyone suggest the best way for viewing the PDF in a Hybrid Android Mobile App.
with cordova you must think about these:
HTML 5 object tag: not working
If you try with:
window.open('http://www.???.com/my.pdf', '_blank', 'location=yes');
The InAppViewer canĀ“t open this kind of files.
I think that there aren't an hybrid solution for this problem.
You must start to search or write about a plugin that use a native pdf's opening and then use it.
An example:
cordova-plugin-file-opener
The latest solution, a little more simple but include to open google docs is:
window.open('https://docs.google.com/viewer? url=http://www.example.com/test.pdf&embedded=true', '_blank', 'location=yes');
ref = window.open('index.html', '_self');
Go look at the Mozilla pdfJS project.
This project allows you to open a pdf (embedded in app or remote) in your app. No break-out links that relies on native viewers.
They also give you a very full featured sample viewer, that you can use as is, but much of functionality in that does not apply to mobile applications.
I have had success with this on Android 4.3 Devices.
Try installing the InAppBrowser plugin to do so. I have use it to open PDF files right inside the app on both iOS and Android.
Check the official InAppBrowser doc with full doc and examples, it has several options you can enable/disable (be sure to point to your current cordova version documentation):
My solution for connected apps with offline availability...
window.open('http://www.someserver.com/doc.pdf', '_system')
...this will open in default pdf viewer. I have my clients use adobe reader for obvious reasons. And also because once it is downloaded the first time, adobe app manages and edits the documents well, and the documents are also available offline from within adobe reader thereafter. Even pdf forms.
Have cordova.js linked on the page.
Have inAppBrowser added.
For full offline you may try FileOpener plugin. I have not needed to do that on android, but I have used that way in iOS.
Hope any of this may help.
Though am late here, still want to share what I know. You can use this plugin to view PDFs in the app (without inappbrowser). Supports only Android and iOS.

Open a link in the default browser of a system with cordova 3 and jquery mobile

Hi I'm working around with jquery mobile and cordova 3 on a android device.
Everything works great except that I can't open links in the default browser or for example the maps application.
I can open it with a inappbrowser plugin but I dont want to do that. I just want to open the links to websites with the default browser.
I tried many things like here:
Opening Link in System Browser in PhoneGap 3.3 on Android
Open Links in Default Browser using Phonegap/Cordova
But I saw that the answers are showing the solution with the inappbrowser which I dont want.
How can I solve this?
Thanks for any help
For Android OS use following code.
navigator.app.loadUrl("http://google.com", {openExternal : true});
or through inline JavaScript:
<a onclick="navigator.app.loadUrl('https://google.com/', { openExternal:true });">Link</a>
It will NOT work with iOS, also, I don't know, if currently exist a solution for iOS, that don't require inappbrowser.

Google navigation on a html5 Android app

I just wanted to know if someone can explain why is this happening to me.
I am developing a mobile app using phonegap and jquerymobile and one of the features of the app is to guide the user using a navigation tool.
For iOS we have choose Waze. It is really easy to add it:
<a href=" waze://q=Adress">
and it works! It works if we run the app using safari or even if we build a native app using phonegap.
The problem comes when using Android. For android we are using Google Navigation. The code we are using is:
<a href="google.navigation:q=Adress">
It is working ok, but only if we build a native app with our htlm code using phonegap but it is not working if we run the app on Android Web Browser.
We dont want the user to install the app to use this feature...
The question is: Why? Why the html code is working ok inside a webview on a native app but it is not working on Android Browser?
I just had the same issue and used the geo URI and it is working:
Wikimedia Headquarters
for a more detailed explanation see this link: http://en.wikipedia.org/wiki/Geo_URI#Example
The href above will open navigation apps, such as waze on Android (just tested it on the Galaxy S4 with Waze and it is working - it also opens up the Google Maps/Navigation app, which is now a combined app).
Hope this helps! :)

Categories

Resources