Parse invalid session token (Code: 209, Version: 1.7.1)

我的梦境 提交于 2019-11-30 04:18:52
Ronaldoh1

Delete the app from the simulator or your phone, then rebuild and re-run the app. Sometimes an old token gets cached. I just solved this problem for my app.

Check out this page: https://parse.com/tutorials/session-migration-tutorial

Most likely your app was using legacy session tokens. You can migrate to revocable session tokens by adding this to your app delegate right after you set the app id and client key.

    [PFUser enableRevocableSessionInBackground];

Parse's website has a section on handling this error that might be of more help to you: https://www.parse.com/docs/ios_guide#sessions-handleerror/iOS

Some of the answers posted were temporary fixes - however the problem could reoccur later if a user logged out and tried to log back in again - I think this was due to me allowing anonymous users also - the only way I could clear it is to call [pfuser logout] prior to log in

R_Developer

I think there some more steps need to be followed:

  1. You have to add [FBSDKAppEvents activateApp] in applicationDidBecomeActive.

  2. You should write
    return [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; in method didFinishLaunchingWithOptions in AppDelegate.

Trying above steps should work for you.

With revocable sessions, your current session token could become invalid if its corresponding Session object is deleted from the Parse Cloud. This could happen if you implement a Session Manager UI that lets users log out of other devices, or if you manually delete the session via Cloud Code, REST API, or Data Browser. Sessions could also be deleted due to automatic expiration (if configured in app settings). When a device’s session token no longer corresponds to a Session object on the Parse Cloud, all API requests from that device will fail with “Error 209: invalid session token”.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!