Creating Deep Links to Application Content

649 views
Skip to first unread message

Riski Idrus

unread,
Mar 30, 2021, 10:45:00 PM3/30/21
to DroidScript
Hi, How to Deep Link to App Content? Can it?

Alan Hendry

unread,
Apr 4, 2021, 10:46:48 AM4/4/21
to DroidScript
Hi,
What are you trying to link from and link to?
Native app, HTML app, etc
Regards, ah

Riski Idrus

unread,
Apr 4, 2021, 10:52:42 AM4/4/21
to DroidScript
HTML application. I integrated it with my firebase web application. I have to handle the verification code in the application, how do I do that?

Alan Hendry

unread,
Apr 4, 2021, 11:13:05 AM4/4/21
to DroidScript
Hi,
I don't know anything about Firebase.
If you search this Group for Firebase there are a bunch of posts it may be worth reading.
Regards, ah

Riski Idrus

unread,
Apr 4, 2021, 11:28:24 AM4/4/21
to DroidScript
You don't seem to understand what I mean. I will simplify my question.
Here's the picture:

My User clicks the "Sign In With Google" button within My Applications.
Then I Redirect Users To Chrome For A Faster And Safer Sign In.
After the Login Process is Complete, I Get an Access Token from the Login Provider that I Use (Google Oauth),
What I Want Is How Do I Send The User Back Into My Application While Including The Access Token That The User Got Earlier?
I Found One Suitable Function In DroidScript, But I'm Not Sure:

var int = app.GetIntent ();

Regards.

Steve Garman

unread,
Apr 4, 2021, 11:58:37 AM4/4/21
to DroidScript
If you have a way to send an intent to your app's packagename from your authorization routine, you can include the details you need, such as an access token in the extras

you then capture it in a JavaScript OnData() function in your app and parse the extras

Take a look at the "Receive Intent" sample in DroidScript
Message has been deleted

Riski Idrus

unread,
Apr 5, 2021, 6:20:33 AM4/5/21
to DroidScript
I used this method for a while, but how do I automatically send the user back to the app when the sign-in process is complete? I tried the following, but it didn't work:

<script>window.location = 'android-app://com.myapp.id/MyApp/';</script>

Or can you make this Google Sign plugin for DroidScript? I am not very proficient in the Java programming language. In my opinion, this is the best way and it would be a shame if this plugin is not in DroidScript.


Pada Senin, 05 April 2021 pukul 18.11.10 UTC+8 Dave menulis:
We do not currently support Android's deep linking functionality, maybe you could store the token temprarily in Firebase and fetch it from your app?

You might want to look at using this component instead of using Chrome for your logins too:-   https://ds.justplayer.de/uploads/72

Dave

unread,
Apr 5, 2021, 6:29:41 AM4/5/21
to DroidScript
If you use that plugin (https://ds.justplayer.de/uploads/72) then once the user has logged in, it should send the user back to your app, when they press the back key.

BTW: We are going to launch a simple OAuth service very soon as part of our CloudStore offerring.  We are using it ourselves for the Chat extension.

Dave

unread,
Apr 5, 2021, 7:30:18 AM4/5/21
to DroidScript
I forgot... It looks like we do actually support deep linking via the build.json file  (using the 'urlHost' and 'urlPathPrefix' fields)

Something like this should do it:-

{
    "manifest" : 
    { 
        "urlHost" : "www.mysite.com",
        "urlPathPrefix" : "/myapp" 
    }
}

I don't think the urlHost needs to be a real web site, so you could experiment with that.

Dave

unread,
Apr 5, 2021, 7:34:01 AM4/5/21
to DroidScript
Note: You can intercept URLs in emails and launch your app using that technique too (I use that for handling password resets for one of my customers)

Dave

unread,
Apr 5, 2021, 7:39:10 AM4/5/21
to DroidScript
You should be able to get information about the clicked url using the OnData() callback in DS (Intent data)
Message has been deleted

Chris

unread,
Apr 17, 2021, 2:17:00 PM4/17/21
to DroidScript
Hi Dave, do you have any simply example code for of any of this?

I am aiming to get receive arbitrary data in OnData() from someone clicking a hyperlink, so for example, a user is in Google Chrome, they click a hyperlink and it opens the app, sending the arbitrary data (part of the URL) to the app in an intent.... 

Thank you :) 
On Monday, April 5, 2021 at 12:34:01 PM UTC+1 Dave wrote:

Chris

unread,
Apr 17, 2021, 2:20:33 PM4/17/21
to DroidScript
https://t.me/testing

Telegram uses this, for example, with URLs formatted as follows: tg://resolve?domain=testing

Does this build.json example relate to this use-case?

I'm trying to do the same as in the Telegram example above, for a Droidscript app ... is this possible currently?

Thank you
On Monday, April 5, 2021 at 12:30:18 PM UTC+1 Dave wrote:

Dave

unread,
Apr 19, 2021, 11:21:07 AM4/19/21
to DroidScript
Hi Chris,

Using the above json file should allow you to intercept links with a given pattern and send users to your apps (you will have to build an APK to test it).   Have you tried it yet?

The next beta release of DS will allow the use of arbitary url schemes, so you will be able to use myapp:// style schemes as well.

Regards
David

Chris

unread,
May 2, 2021, 2:42:16 PM5/2/21
to DroidScript
It works! :)  .. brilliant. Thank you :D


Just sharing the following in case it helps (this is what I used):

Using the latest beta (a compiled APK):

build.json: 

{
    "manifest" : 
    { 
        "urlHost" : "*",
        "urlScheme" : "myscheme" 
    }
}

myscheme://arbitrarydata

-> app.GetIntent().data in OnData function





wheelie tips

unread,
Mar 22, 2022, 10:24:43 AM3/22/22
to DroidScript
this is great stuff!!

I followed the sample and got it to kinda work; here's what I've done:
the app package name is com.myname.url_scheme

the build.json contains:
{
    "manifest" :
    {
        "urlHost" : "*",
        "urlScheme" : "url_scheme"
    }
}

I was assuming the name of the urlScheme should be the name of the app, not sure if that's correct.

the only way I managed to have the app opened by clicking a link was to share the following link via email/telegram/whatsapp:

the app opened and the app.GetIntent().data returned the full link (https://com.myname.url_scheme/hello).

although it works I'm pretty sure this is not the correct way to implement it, can you pls give me some pointers on the proper way to create the deep link?

also, in Chris' post his link was:
myscheme://arbitrarydata 
assuming the correct way is implemented, is that the link one could share via email/telegram/whatsapp?

Cheers,
WT

Chisan Gelu

unread,
Jul 25, 2022, 8:43:20 AM7/25/22
to DroidScript
I tried last example bur didn.t work.....
build.json


{
    "manifest" :
    {
        "urlHost" : "*",
        "urlScheme" : "distanta" ,
   
    }
}

Right2TheV0id

unread,
Jul 26, 2022, 10:50:30 AM7/26/22
to DroidScript
Same here, is urlScheme ignored?
Generated apk manifest doesn't contain the urlScheme I defined, only the following (in this order):
    scheme='file'
    scheme='file'
    scheme='file'
    scheme='content'
    scheme='ds'
    scheme='ds'
    scheme='http'

More info:
API Level 30
DS 2.50
APKBuilder 2.50

Chisan Gelu

unread,
Jul 26, 2022, 2:47:38 PM7/26/22
to DroidScript
LAST EXAMPLE OF @wheeli...@gmail.com 
WORKED FOR ME!!!

{
    "manifest": {
        "urlHost": "da.me",
        "urlScheme": "https"
    }
}


And in settings allow app to open links!!!

Dave

unread,
Aug 2, 2022, 4:07:45 PM8/2/22
to DroidScript
Note: If you want to be even more specific you can use the 'urlPathPrefix' option to filter for certain paths like this:-
{
    "manifest": {
        "urlScheme": "https",
        "urlHost": "mywebsite",
         "urlPathPrefix": "/mobile"
    }
}

Then Android should offer to open your app instead of going to the website.

Chisan Gelu

unread,
Aug 9, 2022, 3:46:53 PM8/9/22
to DroidScript
Is there a method to implement this in .aab ....in .apk it works ok.....but in .aab dont works.

Chisan Gelu

unread,
Aug 10, 2022, 7:17:00 AM8/10/22
to DroidScript
???
Reply all
Reply to author
Forward
0 new messages