I'm trying to add yet another deep link to my android application, I want my URI to look like this : my_app://photos?id=147619727001201&edit=true. The problem is that the system doesn't recognize this URI, so I just get trimmed version of it (my_app://photos?id=147619727001201). I'm just curious how android system treats deep links, and if there is any way to make this URI work. I wan't to mention that everything works fine for my other URIs, which don't contain ampersand. Here is my intent filter :
<intent-filter android:label="My Item">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:path="/photos"
android:pathPattern="\?"
android:scheme="my_app" />
</intent-filter>
And here is my activity's on create method :
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Uri target = getIntent().getData();
}
after the following command :
adb shell am start -a android.intent.action.VIEW -d "my_app://photos?id=170262497002201&edit=true"
I get my_app://photos?id=170262497002201 in target.toString();
try this command instead:
adb shell am start -a android.intent.action.VIEW -d "my_app://photos?id=170262497002201%26edit=true"
The problem is bug in platform tools version 21 bug issue
You can also try escaping the '&' character by adding a '\' before it
For example:
adb shell am start -a android.intent.action.VIEW -d "fantasticapp://www/?cc=de\&tagset=123" robertoduran.isthegreatest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With