3

I have implemented deep linking into my android application, Everything is working fine except for getting query parameters from the URL.

I am following the instructions at this link to get parameters.

The URL looks like this:

myapp://path/want?a=123&b=345

I am doing something like this:

deeplink :- myapp://path/want?a=first&b=second

Uri uri = getIntent().getData();
String valueOne = uri.getQueryParameter("a");
String valueTwo = uri.getQueryParameter("b");

I am getting the correct value of "valueOne" but getting null for "valueTwo", and I can't figure out why.

TylerH
  • 20,799
  • 66
  • 75
  • 101
shivam
  • 445
  • 1
  • 8
  • 22

1 Answers1

7

It's been awhile.. hope this can help somebody:

I hit the same issue recently.

  • If testing a deep link in command line adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d "http://test.com/service1?param1=value1&param2=value2" only first query parameter is kept. (&param2=value2 is dropped) Looks like a bug.
  • If testing a deep link by clicking the highlighted link in gmail (in my case I use google keep note) all parameters are being passed as expected
Gord
  • 161
  • 2
  • 6