So basically what I want is when the user clicks on a button on a mobile browser :
Any solution/overview/idea/source would be highly appreciated.
NOTE: I want to do it using JavaScript or React and not java
Big THANKS for the help in advance !!
What you trying to do is called deeplinking, you can achieve that by accessing URI protocol which is owned by your android application
For example:
example://www.myapp.com/anystring
To set your app available for URI opens. Add this receiver to your android manifest:
<receiver android:name=".DeepLinkReceiver">
<intent-filter >
<data android:scheme="example" android:host="www.myapp.com" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</receiver>
In browser side just call this method:
window.open('example://www.myapp.com/anystring');
It will open window containing this string as url, so browser will automatically ask user to be redirected to your app