The app opens when I load from applications. However, it does not load when I try to load from he chrome. This his is my manifest file
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="spectacles"/>
</intent-filter>
Take a look at this answer:
"Essentially, the Chrome team feels that if a user actually types something into the address bar, no redirect should ever happen. As you've discovered, this is counter to behavior in all other browsers."
Related
Our teams goal is to have a customer dialer app on mobile phones b/c we want to mask the phone number for our users. They dont want their personal real numbers on caller ID. We have a phone service to do this behind the scenes (Twilio), but need to have our native app register as responding to the "tel" URL Schema and hooked into the React Native Deep LInk APis.
https://reactnative.dev/docs/linking#built-in-url-schemes
We have setup and followed the normal tutorials for custom URL schemas, like "myawesomeapp:/phone/+12223334444"
and we can get that to open.
We want the app to register as a main dialer app though, when we do not control to setup this custom url. So anywhere there is a link for +12223334444 we want the OS to offer our app vs the main phone app when user clicks on this link.
Any tutorial on this? How to do this in Android and iOS using React Native. We started with expo default react native project, but ejected it and have full control of native settings. Thanks!
This tutorial was userful or the custom schema, but not "tel"
https://rossbulat.medium.com/deep-linking-in-react-native-with-universal-links-and-url-schemes-7bc116e8ea8b
had the same problem. I added these intent filters to the AndroidManifest file
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.CALL_BUTTON" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="vnd.android.cursor.dir/calls" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="*ashnamoon.ir" android:path="tel/*" android:pathPrefix="/"/>
<data android:scheme="http" android:host="*ashnamoon.ir" android:path="tel/*" android:pathPrefix="/"/>
<data android:scheme="ashnamoon" android:host="*ashnamoon.ir" android:path="tel/*" />
</intent-filter>
clicking on the links below will suggest my app and you can get the data with Linking API of react-native you can read about here.
test this link https
test this link http
test this phone
test this link https
test this link http
test this link ashnamoon
I add some links that helped me. this will only solve the problem on android not sure how can it be done in ios though
https://developer.android.com/reference/android/content/Intent
https://android.googlesource.com/platform/packages/services/Telecomm/+/a06c9a4aef69ae27b951523cf72bf72412bf48fa/AndroidManifest.xml
I've got an intent in my AndroidManifest.xml working great. When a person visits a page called "train", the actions specified in my ActivityMain are carried out.
However, my website includes some features which are not available in my app.
So i'd still like users to be able to navigate around my website with ease, without links to the train page on the browser opening the app.
Does anyone know how I can use an intent-filter to prompt the user with the option to "open in app" from apps such as Gmail, Messenger, etc, but NOT when they're on my website going to the specified page?
<intent-filter>
<data android:scheme="https"/>
<data android:host="example.co.uk"/>
<data android:path="/train/"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="example.co.uk"
android:path="/train/"
android:scheme="https" />
</intent-filter>
For further information you can view detail here about deep linking:
https://developer.android.com/training/app-links
I'm doing a chat, and In this chat, some messages will be links to a specific url (this url opens a document viewer in the server).
The links look, like this: http://X.X.X.X:8080/DocumentViewer/...
Then I have a webview activity, where I want to open this type of links.
How can "intercept" when the user clicks on this type of links, and open my own webview and not open a "external" browser?
I think that you can accomplish this by creating an intent-filter in your AndroidManifest.xml file for the URL pattern that you are interested in. The documentation for the intent-filter's <data> element shows how you can specify a host and a scheme ("html" in your case) to handle URLs.
This answer shows an example where the developer wanted to handle youtube.com URLs. I have included the manifest snippet below for completeness:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="www.youtube.com" android:scheme="http" />
</intent-filter>
Based on this, I think (I have not done this myself) that your intent filter should look something like:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="http://X.X.X.X:8080/DocumentViewer/" android:scheme="http" />
</intent-filter>
I am trying to intercept my own app's URL on android so that the user can open the URL in the app rather than on the browser. (I don't have browser support yet).
This is what I'm doing
<activity android:name=".ui.activity.MainActivity" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PICK_ACTIVITY" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:host="myapp.com" />
<data android:pathPattern=".*"/>
</intent-filter>
</activity>
For some reason anytime I open myapp.com it still keeps opening in the browser, without giving me the option to open the URL in my app. I am trying this on my emulator with API 16 running on it. I've closed the emulator several times and started it again but still its the same behavior.
To avoid any errors in the URL of my personal app. I even experimented with:
<data android:host="goo.gl" android:scheme="http" />
<data android:host="goo.gl" android:scheme="https" />
The app DOES intercept the above url but ONLY the first time. If I click 'JUST ONCE' in the options presented, I don't get the option ever again until I restart the emulator.
Has anyone gone through this? What might I be doing wrong?
this answer helped me : link to question
if you add the package name to the intent, it will open your app by default
This seems to be a typical problem and there seems to be a lot of differing behaviour, the problem I'm having though is that my scheme will launch the picker and allow me to choose my app when I hit a link in an email or a note on the device, but if I hit a link on a web page I can't seem to launch the app, don't even get the picker (I'v checked the "defaults" for the two browsers and none are set).
<activity
android:name=".MyActivity"
android:exported="true"
android:enabled="true">
<intent-filter>
<data android:scheme="http" android:host="www.website.com"/>
<data android:scheme="http" android:host="website.com"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
If I use one of my links from an email as below it gives me the chooser, launches my app, all is great, however, hitting the same link in the web browser just launches the page with no chooser. Any suggestions on what the problem might be?
http://www.website.com/share.aspx?id=12345678
Testing on GS2 running ICS 4.0.3 with Chrome and stock browsers.
Add the android:pathPrefix attribute.
<data android:scheme="http" android:host="website.com" android:pathPrefix="/" />
This is how I solved it eventually:
<intent-filter>
<data
android:host="www.website.com"
android:pathPattern=".*\\share.aspx"
android:scheme="http" />
<data
android:host="website.com"
android:pathPattern=".*\\share.aspx"
android:scheme="http" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Also add the following to the Activity tag:
android:exported="true"
The reason there are two addresses is so that the app can pick up canonical domains (with/without www.).