Google Drive API for iOS Swift

Discussion in 'iOS Programming' started by iosmike, Apr 30, 2016.

  1. iosmike macrumors newbie

    iosmike

    Joined:
    Apr 28, 2016
    Location:
    Toronto, Canada
    #1
    I followed the Google Drive API for iOS Quicstart and created a sample project, everything works ok. But when I did exactly the same thing to an existing project and ran on simulator. On simulator screen it shows:

    The operation couldn't be completed. (com.google.HTTPStatus error 401).

    In console it shows:

    Error data:
    {
    error = "unauthorized_client";
    "error_description" = Unauthorized
    }

    I searched and didn't find exactly the same error and other kinds of error help information didn't work out. Please give me a clue. Thanks!
     
  2. PhoneyDeveloper, Apr 30, 2016
    Last edited by a moderator: Apr 30, 2016

    PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    I often use the wikipedia HTTP Status Code page for info on return codes. https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

    401 usually means the user hasn't successfully logged in. It can also mean something like a token has expired or the app hasn't sent a valid app secret when attempting to log in.

    403 is similar. Usually the difference is that 401 can be fixed and 403 cannot be fixed. For instance if the user passes bad credentials that can be fixed but if the user is attempting to access a URL that it doesn't have permissions for this can't be fixed.
     
  3. iosmike thread starter macrumors newbie

    iosmike

    Joined:
    Apr 28, 2016
    Location:
    Toronto, Canada
    #3
    Thanks for the clue. Let me see if I can fix the problem.
     

Share This Page