I have an android app with manifest file like this:
<intent-filter>
<data android:host="myurl.com"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.VIEW" />
</intent-filter>
which means my app can open urls match whit a given filter.
In most android devices this works fine, but in some devices like samsung A5 2016 when user clicks on links like this android doesn't show other browsers and automatically open the link with my app.
I use normal Intent to open links in my app. But I can't fix the problem.
Can anyone help me?
It seems because I added intent-filter to my manifest file it blocks other apps to run this url.
I removed intent-filter from manifest file and it worked. But I wanna my app to be able to open urls which I mentioned in manifest file.
Related
I have an app that listens for a deeplinks starting with example:// The app can be launched by scanning a QR code containing a deeplink.
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "example://” -->
<data android:scheme="example"/>
</intent-filter>
I am using the code above. It works exactly as expected on Samsung hardware. My other test device is a Google Pixel 5a. When using the google default camera with my app installed, The camera sees a deeplink starting with example:// my app is not part of the "open with" list that appears.
Any ideas what may be causing this?
It looks as though this is a bug specific to the Pixel camera app. The app is treating all example:// links as though the destination is a web browser, even though http:// or https:// is not included
We use declarations like the following one (Manifest) to link to certain parts of the app:
<activity
android:name=".some.package.SomeActivity"
android:launchMode="singleInstance"
android:exported="true">
<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" />
<data android:host="*.some-domain.com" />
<data android:path="/native/foo" />
</intent-filter>
</activity>
On devices running Android 12, this suddenly stopped working, e.g. scanning a QR code containing a certain URL automatically opens it in the default browser. Prior to Android 12, the system offers to open those URLs in our app when tapping on links like https://some.domain.com/native/foo/bar/. I went through the changelog and was unable to find anything that could explain this behavior (considering we already set exported="true").
What am I missing and how can I tell the system to offer our app to handle those specific URLs?
UPDATE
After test some case, I found you should change your scheme from https to non https string, such as your_app_string. If you still want to use https as your scheme, you should check the doordash's tech blog.
Your should make the android system can verify your scheme.In simple words,start with android 12(api 31), you need Declare the association between your website and your intent filters by hosting a Digital Asset Links JSON file at the following location:
https://some.domain.com/.well-known/assetlinks.json
official doc reference here
How can I control the default Open supported links to either Ask every time or Open in this app for my Android app? Does it happen in the manifest?
I have two apps that try to accept the same universal link scheme, and the ideal behavior is to have the user decide which app to open when they click on the link. However, it seems that the first app correctly has the Open supported links in settings set to Ask every time, while the other app has the Open supported links as Open in this app. Thus, when both apps are installed, only the second one will be opened straight away, whereas the first one won't even be prompted.
The portion that accepts universal links in both of the AndroidManifest.xml files are almost identical.
<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="foo.bar.com" android:pathPrefix="/action/" android:scheme="https" />
</intent-filter>
I am using Deep Linking in my application. But, now I have a requirement of opening two seperate apps on two seperate url's but same host like
http:www.google.com/Nexus5 - This should open App1
http:www.google.com/Nexus6 - This should open App2
The above url opens both the apps, but my requirement is that If I provide complete url like http:www.google.com/Nexus5 then it should only show option to of App1.
So, its like if I pass on url
http:www.google.com/Nexus5 then only Nexus5 app should open and show option to browse the app. There should be no option to open Nexus6 app.
Same way for http:www.google.com/Nexus6 if I open Nexus6 url the it should not show option of Nexus5 App.
Below is my AndroidManifest file for that Activity,
<activity
android:name=".DeepLinkDemo"
android:label="#string/app_name">
<intent-filter android:label="#string/app_name">
<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.google.com"
android:pathPrefix="/Nexus5"
android:scheme="http" />
</intent-filter>
</activity>
Now, this will run fine but if there is any other app with same host that means www.google.com I want to restrict that app from showing in the Browsable list(that other app will also be controlled by me)
So, is there anyway for achieving my above requirement?
Let, me know if anyone has any query!
You can use android:pathPattern to uniquely identify different application
I have an android containing an activity that can receive pictures sent to it by the android share menu. The activity has this configuration in the manifest file:
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<data android:mimeType="image/*" />
</intent-filter>
I am using the mimeType filter to allow only images to be sent to the activity.
Apparently, this is not working on all devices. I have tested it on the Nexus S and Galaxy S/S2 and it worked great, but I've got complaints from some users (especially xperia) saying the app it not showing in the Share menu when it's opened on a photo from the gallery.
The app is using SDK 2.1 sdk 7.
There is no rule that says that an activity have a "share" menu that supports any particular Intent filter.
That being said, I would add:
<category android:name="android.intent.category.DEFAULT" />
to your filter.