How to share an image from your app to Instagram Stories without implementing any SDK?
Using social media is clearly one of the best options for apps to acquire new users and improve brand awareness. Speaking of social media, Instagram is growing so fast that it has reached to 1 billion monthly active users! This is a huge opportunity for app developers because there are many ways for you to use Instagram as a way to market your app.
People like to share on social media, but not everything worth to share with your friends or followers. So before you spend time on building a social sharing feature or even the whole app, make sure the app you are working on something that people want and they like enough that they will share with their friends. If you got that right, let’s begin!
I am going to show all steps referencing the social media app that I’ve built this feature into. The feature lets people share their profiles on their Instagram story.
Please skip step one if you already have a UIImage that is ready to share.
Step 1: Create an image
You will need an image file to transfer over to Instagram app. In our app, this is a custom image that is uniquely created for each users upon sharing.
imagePath, username, photoURL variables needs to be filled with data. imagePath is our main image, username is the authenticated user’s username and photoURL is the authenticated user’s photoURL.
Here’s what it generates:
You will need to play around with the values when implementing into your own app.
Step 2: Share the generated image on Instagram Stories.
You will need to save the image first before you can pass it to Instagram app, so make sure you ask for the needed permissions from the user.
Here’s how to save the generated UIImage to user’s photo library and share it on Instagram.
Here’s how it all works: