I have implemented Deep link in my application in manifest file I have define intent-filter like this
<activity
android:name=".activity.ProfilePreviewActivity"
android:theme="#style/AppTheme.ActionBar.Transparent">
<intent-filter android:autoVerify="true" android:label="#string/app_name"
tools:targetApi="m">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:host="appsdata2.cloudapp.net"
android:scheme="https"
/>
</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="appsdata2.cloudapp.net"
android:scheme="http"
/>
</intent-filter>
</activity>
Now Problem is :
I have define scheme for both and also added android:autoVerify="true"
In Android 6.0.1 With app install
https scheme - url open app and work perfect
http scheme - url open browser not the actual App ? Am I missing something?
I have follow https://stackoverflow.com/a/39486914/1293313 but no luck
and In Android 7.1.1 With app install
https scheme - url open app and work perfect
http scheme - url open app and work perfect (edited)
First check the link is reachable by adb or not by using:
adb shell am start -n com.example.simon.test/.activity.ProfilePreviewActivity
Just try below code because chrome has some issues in opening links.
<activity
android:name=".activity.ProfilePreviewActivity"
android:theme="#style/AppTheme.ActionBar.Transparent">
<!-- For chrome links -->
<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="appsdata2.cloudapp.net"
android:scheme="http"
android:pathPrefix="/"/>
</intent-filter>
<!-- For adb -->
<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="appsdata2.cloudapp.net"
android:scheme="http"/>
</intent-filter>
</activity>
Try to test the links form the browser
Related
I am trying to setup applinks in my android app. In my manifest file I have something like this:
<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:scheme="https"
android:host="myapp.example.com" />
</intent-filter>
So my question is where EXACTLY will the app try to download the assetlinks.json file:
a - https://myapp.example.com/.well-know/assetlinks.json
b - https://example.com/.well-know/assetlinks.json
c - https://www.example.com/.well-know/assetlinks.json
Thanks for your help
According to this Google Guide, it'll try to download from:
https://myapp.example.com/.well-known/assetlinks.json
Not able to get QR code link to open my app, it always loads in browser.
I have added a intent filter in Manifest file as below -
When I have the link in as SMS message, https://pages.smart.link/abc and I click on that, it shows disambiguous dialog with my app as one of the options to open it.
<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="pages.smart.link"
android:pathPrefix="/abc"
android:scheme="https" />
</intent-filter>
But if generate this link through QR code, it loads the URL in web browser - tested on Samsung Galaxy S8+
SMS option does NOT work if I have host as "myapp" with final url as myapp://pages.smart.link/abc
myapp host works fine if launch it through command line as below -
adb shell am start -W -a android.intent.action.VIEW -d
"myapp://pages.smart.link/abc" com.abc.myapp
<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="pages.smart.link"
android:pathPrefix="/abc"
android:scheme="myapp" />
</intent-filter>
When i publish preview version, play store tip:
You must use at least one APK that maps to the "example.com" site via the network "intent-filter".
It no problem on develop version.
<activity android:name=".MainActivity">
<meta-data
android:name="default-url"
android:value="https://example.com/"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</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.com"
android:pathPattern="/"
android:scheme="https"/>
<data android:scheme="http"/>
</intent-filter>
</activity>
because it is the test phase, so the online version of the installation App has not added default url. add default-url to installation App manifest.xml it will be ok.
I need to open my application when clicked the URL Link in E-mail, Message or Browser applications. So, see the my code for this feature:
<activity
android:name=".ui.main.MainActivity"
android:configChanges="orientation"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="https" />
<data android:scheme="https" android:host="www.mysite.org"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.APP_EMAIL"/>
<category android:name="android.intent.category.APP_MESSAGING"/>
<category android:name="android.intent.category.APP_BROWSER"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
This code is sufficient and works on some mobile devices, especially devices with android versions 5.0, 6.0 and 7.0 but does not work on versions 7.1 and 8.0. Why does this happen? Is it a permission problem?
Ex: Your url will be something like https://example.com and you have the intent filter in Android Manifest as below:
<activity
android:name="com.droid.MainActivity"
android:label="#string/app_name" >
<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="example.com"
android:scheme="https" />
</intent-filter>
</activity>
Use the URL Mapping editor to easily add URL intent filters to your Activities with Android App Links (Android Studio > Tools > Android App Links).
After reading changes in Android O I came to the conclusion that the problem is described as follows
URIs cannot contain empty labels. Previously, the platform supported a
workaround to accept empty labels in host names, which is an illegal
use of URIs. This workaround was for compatibility with older libcore
releases. Developers using the API incorrectly would see an ADB
message: "URI example..com has empty labels in the hostname. This is
malformed and will not be accepted in future Android releases."
Android 8.0 removes this workaround; the system returns null for
malformed URIs.
So try adding android:label="string resource" to your intent-filter syntax so the user will see it in the alternatives menu.
I am integrating paypal express checkout to my android studio project.
Added dependencies compile 'com.braintreepayments.api:braintree:2.+'
Added below code in manifest.xml
<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
android:launchMode="singleTask">
<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="${applicationId}.braintree" />
</intent-filter>
</activity>
Finally calling paypal fragment using below code
BraintreeFragment mBraintreeFragment = BraintreeFragment.newInstance(PayActivity.this, tokenValue);
PayPalRequest request = new PayPalRequest(amount.getText().toString())
.currencyCode("USD");
PayPal.requestOneTimePayment(mBraintreeFragment, request);
But the app is not redirecting to the paypal screen.
Can you guys please let me know what else i need to do to achieve this.
Thanks.
<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
android:launchMode="singleTask">
<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="com.myhomework.myhomework.braintree" />
</intent-filter>
</activity>
your data android:scheme = should be equal to ua package name.braintree.. and if your packagename or package id has capitalised letters please use small