If someone shares http://myappAdurl.com from facebook than if another one clicks link, if application exist on that device, my app should be open,
I added following line to my manifest but I could not get the result, not working.
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".TinyUrlTest"
android:label="#string/title_activity_tiny_url_test"
android:launchMode="singleTask" >
<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" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.myappAdurl.com"
android:path="/images"
android:scheme="http" />
</intent-filter>
<intent-filter>
<action android:name="www.myappAdurl.com" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
</application>
I also tried below project but it opens link such as com.commonsware.android.MY_ACTION
https://github.com/commonsguy/cw-advandroid/tree/master/Introspection/URLHandler
ok found that,
if i give
android:pathPattern="/*.*"
inside data element, then it opens everything
Related
I am trying to recognize the following as a deep link in android
wc:1a15e8b5-8470-47fa-985f-cf11b4c89067#1?bridge=https%3A%2F%2Fbridge.walletconnect.org&key=f92fb2ed74d628a6a286e416e4df2fbfa88d58e6826007c021b9f5920567cdd5
I have set up my AndroidManifest to be as follows:
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize|screenLayout|layoutDirection|keyboard|keyboardHidden"
android:launchMode="singleTask"
android:theme="#style/AppTheme.Launcher"
android:windowSoftInputMode="stateHidden|adjustPan|adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<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:scheme="wc" />
</intent-filter>
</activity>
However when I try to scan the relevant qr with the camera app, nothing happens.
What am I missing?
I have an app on GooglePlay, but the Open button is missing. It just says Uninstall.
This is my mainfest.xml:
<application
android:name=".preview_refresh"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher_round"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Login_Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<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.url.com"
android:path="/launch"
android:scheme="https" />
</intent-filter>
</activity>
</application>
I figured out, the problem is:
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
But I have these lines in my code. When I remove:
<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.url.com"
android:path="/launch"
android:scheme="https" />
the open button is shown.
How can I fix it? I need these tags to open my app via link.
EDIT
I solved my problem, but now I have a new question:
Why do I have to separate the <intent-filter>? It's very confusing, because it shouldn't make any difference.
Ok, now I figured it out. The solution is to separate the <intent-filter>. Like this:
<activity android:name=".Login_Activity">
<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" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.urlk.com"
android:path="/launch"
android:scheme="https" />
</intent-filter>
</activity>
After installing an app via the run command on Android Studio, the app launches correctly, I can see it in the applications list and account manager.
The problem is that it doesn't show up at all in the app launcher. (I have Google Launcher installed on the Nexus 5 device which I am testing on and everything was working fine before 6.0.1).
App name is "Pumpkin".
Here is the manifest
And here's the screenshot where Pumpkin's supposed to fit.
Your Intent-Filter seems to be wrong. Change to:
<activity
android:name="com.pumpkin.activities.SplashScreenActivity"
android:label="#string/app_name"
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="pumpkin.com" android:host="open" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
Add this intent filter to your splash screen activity:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
your deep link
https://sureassure.com
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Main2Activity">
<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" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="sureassure.com" // website name
/>
</intent-filter>
</activity>
</application>
How can I create a custom protocol in Android?
I have tried this code:
<activity android:name=".MyActivity" android:label="#string/app_name">
<!-- open the app when a foo://www.example.com link is clicked -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="foo" />
</intent-filter>
Register this in Manifest file and call in browser like this foo://hello but it not open my app .
I remember having similar problem a while back. Hope my solution will help you solve yours.
Add android:exported="true" and move <data android:scheme="foo" />
on top.
<activity android:name=".MyActivity" android:label="#string/app_name"
android:exported="true">
<!-- open the app when a foo://www.example.com link is clicked -->
<intent-filter>
<data android:scheme="foo" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Here is what I am trying to set up: My Android app requires email confirmation. They register using my app, and then an email is sent to them with a link. I want to have that link open the app directly, but I've been told it's better to have the link open page on my web site that in turn opens the app using a redirect. The link also sends the user's email address and a verification code.
Okay, so, do that, my understanding is that I need to add this code to my AndroidManifest.xml (where MYAPP is the name of my web site):
<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="MYAPP.com" android:path="/confirmation.html" />
</intent-filter>
And then my web site has a page with this in the <head> (where MYAPP is the name of my app):
meta http-equiv="refresh" content="0;URL=MYAPP://?verification=' . $_GET["verification"] . '&email=' . $_GET["email"] . '"/>
It's not working, and I'm possibly making multiple mistakes.
First question is, where does my <intent-filter> go? I've only read that it goes within the <activity> tags, but in my AndroidManifest.xml, I have two <activity> tags:
<activity android:label="#string/app_name" android:name=".MYAPP" android:screenOrientation="unspecified" android:configChanges="locale|keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="com.phonegap.DroidGap">
<intent-filter />
</activity>
I tried adding my <intent-filter> in one, but that doesn't seem to work:
<activity android:label="#string/app_name" android:name=".MYAPP" android:screenOrientation="unspecified" android:configChanges="locale|keyboard|keyboardHidden|orientation|screenSize">
<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" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="MYAPP.com" android:path="/confirmation.html" />
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="com.phonegap.DroidGap">
<intent-filter />
</activity>
Where do I put my <intent-filter>?
Is the rest of my code, especially my redirect URL, okay?
Please note I am a beginner and I am using Phonegap to build this app, so please do not assume I know a great deal about Android app development. Thanks for your understanding.
Inside you activity tags like this:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".My_Activity_Name"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application
In this code of yours, where is the starting intent-filter tag for the last activity:
<activity android:label="#string/app_name" android:name=".MYAPP" android:screenOrientation="unspecified" android:configChanges="locale|keyboard|keyboardHidden|orientation|screenSize">
<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" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="MYAPP.com" android:path="/confirmation.html" />
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="com.phonegap.DroidGap">
<intent-filter />
</activity>
Turns out that I had my intent filter in the right place.
The reason it wasn't working was simply because I needed an extra line to account for https links.
So my code now looks like this:
<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="MYAPP.com" android:path="/confirmation.html" />
<data android:scheme="https" android:host="MYAPP.com" android:path="/confirmation.html" />
</intent-filter>