The code snippet below will demonstrate Instagram posting example:
AndroidInstagramManager.instance.Share(imageForPosting);
//Or with text
AndroidInstagramManager.instance.Share(imageForPosting, "I am posting from my app");
We can also find out posting result by subscribing to the OnPostingCompleteAction action.
AndroidInstagramManager.instance.OnPostingCompleteAction += OnPostingCompleteAction;
void OnPostingCompleteAction (InstagramPostResult result) {
if(result == InstagramPostResult.RESULT_OK) {
Debug.Log("Posting Successful");
} else {
Debug.Log("Posting failed with error code " + result.ToString());
}
}
Available result codes:
public enum InstagramPostResult {
RESULT_OK,
NO_APPLICATION_INSTALLED,
USER_CANCELLED,
SYSTEM_VERSION_ERROR,
INTERNAL_EXCEPTION
}