Greetings, esteemed public! Today we are going to learn how to cloach without any tools at hand, with one line of code. However, this magic will work only for Android devices, but it's already pretty good, isn't it?
The essence of our gestures will be the use of the Intent mechanism, built into the Android OS, and allowing you to run different applications by placing a specially formed link inside the HTML code of the page.
WARNING: Everything described below works ONLY for Android with version less than 11! For older versions I have not yet нашёл🤷♂️
We will be launching the Chrome browser. Here's how it will work:
- We post somewhere on the White-A special link with Intent
2. a user from fb clicks on an ad on White
3. it "kicks out" from the internal fb browser and opens a regular Chrome browser with black
Now consider the format of the special Intent link:
- A link must always start with "protocol". intent://. Roughly, as you write http://
- Then comes the address of the site we want to show the user, in this case stackoverflow.com, this part ends by writing the word #Intent;
- Here you write the scheme, either http or https, as you need
- At the end you specify the package, for us it is always Chrome and the keyword end
And finally, a complete example of how to use it:
Place the file with this code somewhere on hosting or in the constructor, throw yourself a link in your Facebook messenger. We click the link and see Google Chrome open and we are shown stackoverflow.com.
There are a lot of options, but watch out for traffic losses!
And I remind you that the project is alive only by your prayers and donations, so click the link and pour into the plus ;-)