Android Question Launch App from ulr and share data b4x?

ilan

Expert
Licensed User
Longtime User
hi

is it possible to create an url where the user clicks on it and if the app is installed it will open and a value is also sent via this url?
like youtube url does. user share a video via url link. if someone clicks on it it opens the youtube app and load the video.
is something like this possible in b4x language? so for b4a and b4i?

i found that it is possible for b4a using <intent-filter>
 

Alexander Stolte

Expert
Licensed User
Longtime User
i found that it is possible for b4a using <intent-filter>
Its working in B4I too:
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
Its working in B4I too:
perfect this is what i need. is there something similar for b4a?
share link that open app and send string.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Example when sending message with WhatsApp.

 
Upvote 0

ilan

Expert
Licensed User
Longtime User
thanks guys now the question is this.

what will happen if one user is on ios and send the url to user that is on android?
is it possible to create a universal url that will work on both platform?

EDIT: so i will explain what i mean.
the link should be shared using whatsapp and clicking on it should open the app and read the string that is shared with the url (like a id).
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
thanks guys now the question is this.

what will happen if one user is on ios and send the url to user that is on android?
is it possible to create a universal url that will work on both platform?

EDIT: so i will explain what i mean.
the link should be shared using whatsapp and clicking on it should open the app and read the string that is shared with the url (like a id).
Is the targeted app created by you?
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
what will happen if one user is on ios and send the url to user that is on android?
is it possible to create a universal url that will work on both platform?
In B4I you define a URL scheme e.g. b4x.com and then everything that is clicked with the link b4x.com opens your app.

The same in B4A:
Manifest:
AddActivityText("main",
<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT"></category>
   
   <data android:scheme="https" />
   <data android:host="yoururl.com" />
</intent-filter> )
then if a user opens a link with your url, then your app starts and in the main module check the intent like:
B4X:
If    Intenter.GetData.Contains("https://yoururl.com/") Then

I have the code from a project from 2018.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
thank you alexander,
how would the url look like?
Opening a App with a URL is one thing. And it´s working.

The other thing is that
which is the feature behind that what you are requesting here is deprecated now. Service shutdown next year.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
I want to share a link that will open a mobile app that is installed inside my phone.

what has my domain to do with that?
Sorry i dont follow up
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
like youtube url does. user share a video via url link. if someone clicks on it it opens the youtube app and load the video.
Isn't that exactly what you want? Youtube creates a shared link e.g. shared.youtube.com?videoid=2839347394

Youtube has registered the URL scheme youtube.com in their app, now whenever someone opens a link with youtube.com, the youtube app opens and they then read the intent and load the video from their backend based on the videoid.
 
Upvote 0
Top