I need to know how to make a link open an Instagram page in an app if the app is installed on a smartphone.
A simple way such as www.instagram.com/example
links you to page by browser, which is not what I want.
How do I achieve this?
To do that go to Settings -> Apps -> scroll down to the app that you don't want URLs to open in -> Tap on 'Open by Default' and select always Ask. So next time you click on a url it won't open in any app directly it will ask you and you choose it to open in Chrome.
1. Simply open your personal Instagram profile by clicking your username in the upper-right corner of the page. 2. At the top of the page, in your browser's address bar, is your profile URL.
It worked for me.
try {
// mediaLink is something like "https://instagram.com/p/6GgFE9JKzm/" or
// "https://instagram.com/_u/sembozdemir"
Uri uri = Uri.parse(mediaLink);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.setPackage("com.instagram.android");
startActivity(intent);
} catch (ActivityNotFoundException e) {
Log.e(TAG, e.getMessage());
}
Try this :
Works 100% <a href="instagram://user?username=untitled.tiff">untitled.tiff</a>
Launching instagram from the browser. To launch instagram form a link it should be enough to provide a link as:
<a href="http://instagram.com/p/<picture id>">look at this instagram picture</a>
example: look at this instagram picture
<a href="http://instagram.com/p/0nUyKnMJw4">look at this instagram picture</a>
Try opening that link on an android device. Also, keep in mind instagram must be installed on the device. For users replace the "p" with "_u" and the picture id with the username.
Why will this work? The instagram application has an intent listener for http and https browses
<data android:host="instagram.com" android:pathPrefix="/p/" android:scheme="http"/>
<data android:host="instagram.com" android:pathPrefix="/p/" android:scheme="https"/>
<data android:host="instagram.com" android:pathPrefix="/_u/" android:scheme="http"/>
<data android:host="instagram.com" android:pathPrefix="/_u/" android:scheme="https"/>
<data android:host="instagram.com" android:pathPrefix="/_uid/" android:scheme="http"/>
<data android:host="instagram.com" android:pathPrefix="/_uid/" android:scheme="https"/>
<data android:host="instagram.com" android:pathPrefix="/_n/" android:scheme="http"/>
<data android:host="instagram.com" android:pathPrefix="/_n/" android:scheme="https"/>
Edit: It apears I had an old Manifest file.
You can open by android intent on browser anchor link. You can get detailed information here
<a href="intent://instagram.com/#Intent;package=com.instagram.android;scheme=https;end">Open Instagram</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With