Instagram

The code  snippet below will demonstrate Instagram posting example:
Texture2D tex = new Texture2D( width, height, TextureFormat.RGB24, false );
IOSSocialManager.Instance.InstagramPost(imageForPosting, "I am posting from my app");

We can also find out posting result by subscribing to the OnInstagramPostResult action. 

IOSSocialManager.OnInstagramPostResult += HandleOnInstagramPostResult;
void HandleOnInstagramPostResult (ISN_Result result){
	if (result.IsSucceeded) {
		IOSNativePopUpManager.showMessage ("Posting example", "Post Success!");
	} else {
		IOSNativePopUpManager.showMessage ("Posting example", "Post Failed :( Errod code: " + result.Error.Code);
	}
}

In case if an error has occurred, the result.Error.Code will contain one of the following error codes:

  • 1 - The wasn't installed on a device.
  • 2 - The user cancelled posting.
  • 3 - The system version error.
  • 4 - The internal exception.

 

Note: With the latest Instagram app the image caption will be ignored. Instagram provides documentation on iOS hooks. This documentation does not make any mention of a caption parameter. It means that this doesn't seem to be an officially supported use case. But caption parameter was working correctly with the previous Instagram app version. Now they are probably sticking with the same policy as Facebook. "Users should share only own thoughts"  and any text provided by developer will be ignored. However, we can always put some text on  the image we are sharing :) This behavior may change in future, so keep your sharing text.