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?
Related
I should be able to show different activities of my application in the android sharesheet like the example image shown below.
Should I add a new activity? And how is it configured in androidmanifest.xml?
This is the MainActivity part of the androidmanifest.xml, where I have added intent to receive text and images. Now only one icon is shown in the sharesheet.
android:name=".MainActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="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.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
You can add multiple activities and for each activity add an intent filter. You can add label attribute for <intent-filter> to provide a custom label for each activity <intent-filter android:label="My Label 1">
<activity android:name=".BroadcastReceiverActivity1" >
<intent-filter android:label="My Label 1">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
<activity android:name=".BroadcastReceiverActivity2" >
<intent-filter android:label="My Label 2">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
My problem is that I set my manifest but visiting the website still just loads it in chrome and doesn't open the app. Here's my manifest code for the main activity:
<activity
android:name=".activity.MainActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait">
<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:scheme="https" android:host="www.example.com" />
</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>
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>
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