Add deep link support to apps (For MIT AI2 and its distros)
Deep Link feature is one of most requested feature on all app inventor distros.This extension enables you to add deep link support to your app without coding and modifying manifest file.The only thing you have to do is to add your own scheme and host.
Deeplinks are a concept that help users navigate between the web and applications. They are basically URLs which navigate users directly to the specific content in applications.
Learn More on Medium
This is the quite complicated part because you should be familiar with Java and XML to do this.You can find a lot of tutorials on Internet to add deep links support.Kindly note that it will be not easier for you if you are a AI2 user.
But as you know my Custom WebView extension is able to add your app in browser's list so I modified its source in such a way that your app will only appear in browser's list for specific links.
So lets get started.
1.Open DeepLink.java file.
2.Navigate to UsesActivities
annotation.
You will see something like this:
Lets breakdown each element.
(i) UsesActivities
defines which activities will be added in Manifest file by Compiler.
(ii) ActvityElement
adds activity element.
(iii) IntentFilterElement
adds intent filter to activity.
(iv) ActionElement
adds action element to intent filter.
(v) CategoryElement
specifies category in activity element.
(vi) DataElement
specifies data elements in activity.
Now you have to add your desired scheme
and host
in DataElement
.
I have defined two of them:
In above case, your app will be triggered if user clicks a link which starts with one of the following:
1.appinventor://DeepLink
2.https://community.kodular.io
.
3.https://DeepLink
4.appinventor://community.appinventor.mit.edu
First one is called uri link and latter is url link.If you want to remove support of anyone from your app then simply comment(add // before line) and compiler will ignore that line.
1.Use Extension Template to compile Java files
2.Use Appy Builder Code Editor to compile files
3.Use this website to get aix with desired deep links support
4.Contact me with Java files in case you are unable to setup environment or compile files
Note
If you want to use AppyBuilder Code Editor then you will have to change few things which are as follows:
1.Remove package name
2.
Replace above line with com.appybuilder.
+ your email without @ part+ DeepLink$DeepActivity
It opens Screen1 of your app with the URL as start value.
To check how it works, I opened browser and tried to load Kodular Community.Here is what I got:
1.TutsPlus Tutorial
2.Guide by Shreyash on how to setup environment