Instagram

The code  snippet below will demonstrate Instagram posting example:

ISN_Instagram.Post(screenshot);

We can also find out posting result

ISN_Instagram.Post(screenshot, HandleOnInstagramPostResult);

void HandleOnInstagramPostResult(SA_Result result) {
    if (result.IsSucceeded) {
        Debug.Log("Post Success!");
    } else {
        Debug.Log("Post Failed! Error 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.