I managed to open the Twitter
and Facebook
user profile from my app. But I can not find any references to Instagram
.
Is There a way to open Instagram
in order to show a user profile like in twitter or facebook?
For instance, in order to get the Intent
to launch the twitter application I do:
public Intent getOpenTwitterIntent(Context context) {
try {
return new Intent(Intent.ACTION_VIEW,
Uri.parse("twitter://user?screen_name="
.concat(twitterUsername)));
} catch (Exception e) {
return new Intent(
Intent.ACTION_VIEW,
Uri.parse("https://twitter.com/#!/".concat(twitterUsername)));
}
}
How can I achive something similar with Instagram
?
Thanks in advance.
To open directly instagram app to a user profile :
So far I couldn't find a way to show user's profile directly.. but there is a way around..
Found this solution from Instagram Manifest from GitHub
This will open particular image post by the user in the app. From the page app user can open the profile with the link inside.
If you want to open recent post or something , you can use Instagram API
This is not we want exactly , but the better option now... i guess :)
Unfortunately, at this time you cannot open the Instagram app to go directly to a user profile. You can however open a certain photo in the Instagram app.
The following code that I have provided will open a certain photo inside of the Instagram app. If no Instagram app is installed, it will open a user profile inside of the browser.
I made it very easy for this code to be edited for your own purposes. Set the "String pictureId" to the id of the picture that you want to display and set the "String pageName" to the user name of your Instagram account.
The user name part is obvious but if you need help to get your picture id look at this picture.
After a brief search and trying what we all know "WON'T WORK" I got this to work
This should start your default browser and ... there you go. The answer is "instagram.com" + "/UserName".
Here is a method to get the
Intent
to open the Instagram app to the user's profile page: