zumzum zumzum -5 years ago 227
iOS Question

iOS Instagram login get Instagram user id?

I am writing an iOS app that needs to do some basic work against the "Instagram API". To login a user I simply hit the "URL":

I do this through a web view. I am able to login the user and get the access token from "Instagram".

So my question is:

I want to be able to know the "Instagram userId" of the user I just logged in.

How can I get the user id?

Answer Source

The user_id is in the first part of access_token

xxxxx.xxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxx

user_id = access_token.split(".")[0];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download