6

I am providing a feed which is consumed by both desktop and mobile apps which contains links to images, users, and tags on Instagram. When these links are clicked on iOS, I want them to open in the Instagram app.

Currently if I have a link like this: https://www.instagram.com/p/BK8f1rigadE/

If I click it in iOS, the Instagram app does open, just briefly. It then seems to launch Safari to the page, which includes an "open in app" link to open it back up in the app. That link uses the "instagram://" protocol to trigger the app to open. I'm aware of that method, but that's not what I'm after.

I'm on iOS 10 with the latest Instagram app. I feel like this used to work, so I'm wondering if it's just a bug in iOS or Instagram that will be fixed eventually.

Links to twitter.com open properly in the Twitter app... that's the kind of behavior I'm after.

Josh Santangelo
  • 918
  • 3
  • 11
  • 22

5 Answers5

6

I found a service called URL Genius (via this blog post) that solves this exact problem, and provides click metrics, too.

I don't like relying on an external service for such an important link, but it's easy, works well, and the basic service is free. I will probably set a reminder for myself to check that this still works every month or so...

0Seven
  • 85
  • 2
  • 5
4

Links like this work to open the app: instagram://media?id=1346423547953773636_401375631

However I want a regular http link, which opens a browser on desktop, and the app on mobile. Not sure if it exists.

Josh Santangelo
  • 918
  • 3
  • 11
  • 22
1

From my knowledge, the only supported links into Instagram are described here

I'm not sure what the link you're attempting to use represents: /p/id_here seems like a post? You likely need to use:

https://www.instagram.com/media?id=id_here

The documentation I linked shows the "deeplink" approach (instagram://) which I understand you're avoiding, but the same paths should work through the Universal Link approach, at least from my experience.

BHendricks
  • 4,423
  • 6
  • 32
  • 59
  • What's a Universal Link? This doesn't do it. https://www.instagram.com/media?id=BK8f1rigadE – Josh Santangelo Oct 03 '16 at 01:14
  • Universal links: https://developer.apple.com/ios/universal-links/ how are you generating that ID? Not sure what methodology you're using to get that media ID. – BHendricks Oct 03 '16 at 10:38
  • It's just a media ID from their API. If you go to a user page like instagram.com/endquote and click an image, you'll end up at a URL with that ID. – Josh Santangelo Oct 03 '16 at 21:33
  • I'm guessing Facebook and Instagram don't support universal links, but rather, you *have* to use URL with their custom URL scheme (`facebook` or `instagram`? Anyone have success with Universal links? – nekonari Oct 22 '16 at 00:51
  • I have a video in my library, I have a url, how to get a media id ? – Arpit B Parekh Jul 10 '17 at 12:40
0

Had the same problem. For me was solved by simply uninstalling and reinstalling the problematic app.

(Instagram 171.0 - iOS 14.3 - iPhone 11 Pro)

Jumme
  • 1
  • 1
0

On iOS you must first add the instagram url scheme in the LSApplicationQueriesSchemes key of the info.plist file:

<key>LSApplicationQueriesSchemes</key>
<array>    
    <string>instagram</string> 
</array>

then you can open the url of the post using the link:

instagram://media?id=POST_MEDIA_ID

POST_MEDIA_ID can be found by looking at the page source, you will find a tag like this:

<meta property="al:ios:url" content="instagram://media?id=POST_MEDIA_ID"/>

Obviously, the Instagram app must be installed on the device, otherwise the link will not work.