I'm trying to implement deeplinks in my, so users will be able to open the application from a browser. So, I've added deeplinks in my application in a Manifest.xml. And this code is working from adb, but when I'm trying to open this link in browser, the application does not opens. What can cause this error? I can even can't see an Intent in my code
<activity
android:name=".ui.main.MainActivity"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</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="http"
android:host="example.com"
android:pathPrefix="/"/>
</intent-filter>
</activity>
Use Firebase deep link ( Hope Help-full )
https://firebase.google.com/docs/dynamic-links
Related
I am trying to make my android app open when the user presses on a link to our website.
I was following this documentation but it is not working for me as it always opens the browser instead of asking if I would like to continue with the browser or the app. What am I doing wrong?
here is my manifest
<activity
android:name=".presentation.MainActivity"
android:exported="true"
android:label="#string/app_name"
android:theme="#style/Theme.LegendaryCollectionsAndroid.NoActionBar"
android:allowTaskReparenting="true"
>
<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.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data
android:host="www.legendarycollections.net"
android:path="/reset"
android:scheme="https"></data>
</intent-filter>
</activity>
check your website association here.
Launch app when click on url if app installed on device. if app not installed on device, open playstore.
<activity android:name=".ui.NewsCardActivity">
<intent-filter>
<data android:scheme="app" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
You have to deep link your app, add following lines in activity (Manifiest.xml) which you want to launch
<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="screen" android:scheme="appname"/>
</intent-filter>
in browser when ever you click appname://screen your app activity will be launched,
replace appname and screen as per your requirement
Note if you type this url in browser it will search in google ,for this to work you have to write link in html page
Some text
If not working the add android:exported="true" in activity
<activity
android:name=".activity.MainActivity"
android:exported="true">
I had setup intent filter in manifest.xml, such as follows:
<activity
android:name="indexgifto.android.ui.viewcontrollers.SplashScreenActivity"
android:label="#string/application_name"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustNothing"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:screenOrientation="portrait" >
<intent-filter>
<data android:scheme="gifto"/>
<data android:scheme="http" />
<data android:host="www.gifto.net"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
When I execute 'am start http://www.gifto.net/go.php?c=xlh201' application successfully opens with required data. But, when same URL opened via Chrome, just server page opens. In the android 4 in both cases my app was able to start from this url. What I must fix in android 6?
Chrome for Android, versions 25 and later, you should implement a user gesture to launch the app via a custom scheme, or use the “intent:” syntax described in this article.
https://developer.chrome.com/multidevice/android/intents
this worked for me you to try once if worked for u.
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:host="www.youtube.com" android:scheme="http" android:pathPrefix="http"></data>
</intent-filter>
I want from the android browser be able to launch my application if it's installed, or launch my website in the other case.
So in order to make it work, I put :
<activity android:name=".MMLogin" android:label="MeetMe" android:theme="#android:style/Theme.NoTitleBar" android:screenOrientation="portrait">
<intent-filter>
<data android:scheme="http" android:host="meet-me.com" android:path="/signin" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
in the Manifest, and I created a dummy link to test; and it's not working.
I've tried with and without: BROWSABLE and DEFAULT
I've tried with meetme://datas and change the scheme; nothing worked.
I used threads on stackoverflow like :
Launch custom android application from android browser
What am I doing wrong, or is there a special thing to do to make it work ?
My application suppports from API 7.
Cheers
I used :
Intent Filter to Launch My Activity when custom URI is clicked, I think what was missing is this block :
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/myapp" />
</intent-filter>
There are many answers in stackoverflow showing how to lauch app from a web browser ,but I am not sure what went wrong with my code, that never seems to be doing the intended.
I am trying to launch my app by a URL from any other app like web browser,initially
my manifest file looks like this
<activity android:name=".Main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="http" android:host="ebay.com" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
And When I typed http://ebay.com in the browser that never started my app.Obviously,how does the browser know about my app?,then i tried the other way around and added another Activity called MyActivity and altered the manifest file as
<activity android:name=".Main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MyActivity">
<intent-filter>
<data android:scheme="http" android:host="ebay.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>
and tried in my Main Activity
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse("http://mycityway.com")));
Thus producing the intended result.I can also start another application Activity using this method.
But most of the answers here says that the later is possible.What is the mistake i am doing,I couldn't launch my app from browser.Please guide me.
And When I typed http://ebay.com in the browser that never started my
app.
It gets started when a matching link is clicked not when you type the url in the browser.
Try it by sending yourself an email containing http://ebay.com and click the link in the email application.