React-native-share: How to make Instagram post to feed?

Created on 5 Sep 2019  路  3Comments  路  Source: react-native-share/react-native-share

Ask your Question

I'm trying to post to Instagram, but I can't make it work properly on either platform.

Here's my call:

Share.shareSingle({
    url: 'https://myserver.url',
    social: Share.Social.INSTAGRAM,
})

What happens on iOS

Device: iPhone 6S, iOS 12.2

It opens AppStore.

IMG_6768

What happens on Android

Device: Sony Xperia Z5 Compact, Android 7.1.1

It opens the app, but in DMs.

Screenshot_20190905-075949

good first issue ios question

Most helpful comment

Ok, so I think I figured it out. Instagram needs image upload (NOTE: it needs to be jpeg as well!) so giving a remote link like I did above does not work.

I use https://github.com/joltup/rn-fetch-blob to download the file then I put the local path as the url (url: 'file://' + response.path()). Then it works.

All 3 comments

Did you tried sharing a url to see if this opens the feed?

Ok, so I think I figured it out. Instagram needs image upload (NOTE: it needs to be jpeg as well!) so giving a remote link like I did above does not work.

I use https://github.com/joltup/rn-fetch-blob to download the file then I put the local path as the url (url: 'file://' + response.path()). Then it works.

That's great!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vikjovanov picture vikjovanov  路  3Comments

alemarra89 picture alemarra89  路  3Comments

naveedmastan picture naveedmastan  路  3Comments

crivera picture crivera  路  3Comments

rohitgoyal picture rohitgoyal  路  3Comments