Is there a way to retrieve the parameters in my cusom url app myapp:// ?

BarrySumpter

Active Member
Licensed User
Longtime User
Is there a way to retrieve the parameters included in my custom url app myapp:// ?

I have a custom URL app called myapp.

I can execute myapp by url myapp:// as follows:

B4X:
Dim i As Intent
TheLink = "myapp://"       ' this works with an app that has a custom URL of myapp
i.Initialize(i.ACTION_VIEW, TheLink)
StartActivity(i)
When myapp application fires off
is there a way to retrieve any parameters that I want to use?

As in the following code that sends the parameter BarCode=12345678.

How does myapp actually retrieve the parameter of BarCode=12345678?

B4X:
Dim i As Intent
TheLink = "myapp://BarCode=12345678"   ' this works with an app that has a custom URL of myapp
i.Initialize(i.ACTION_VIEW, TheLink)
StartActivity(i)
Usually there is something like $_Post["BarCode"] parameter array.
But I can't find a reference to it in b4a.

tia
 
Last edited:

NJDude

Expert
Licensed User
Longtime User
One way of doing it:
B4X:
Dim TheLink As String
Dim i As Intent

TheLink = "myapp://BarCode=12345678"   ' this works with an app that has a custom URL of myapp

TheLink = TheLink.Replace("myapp://", "")

i.Initialize(i.ACTION_VIEW, TheLink)

StartActivity(i)
 
Upvote 0
Top