ios - requestTestAccountTokensWithArraysOfPermissions FBSDK 4.x -
i'm trying return created facebook test user using:
let manager = fbsdktestusersmanager.sharedinstanceforappid(myappid, appsecret: myappsecret) manager.requesttestaccounttokenswitharraysofpermissions(nil, createifnotfound: false) { (objects: [anyobject]!, error: nserror!) -> void in if error != nil { // oops, error } else { if let token = objects[0] as? fbsdkaccesstoken { //do token } }
but instead of getting access token, objects[0] contains nsnull object. test users created in code , show on developers.facebook.com in app's dashboard
running same code "createifnotfound: true" works famously, btw
any appreciated
well, never work. ended rolling own, using code in "fbsdktestusermanager.m" starting point.
let graphpath = "\(myappid)/accounts/test-users" var params = ["limit": "5"] let tokenstring = "\(myappid)|\(mappsecret)" let request = fbsdkgraphrequest(graphpath: graphpath, parameters: params, tokenstring: appaccesstoken(), version: nil, httpmethod: nil) request.startwithcompletionhandler { (connection: fbsdkgraphrequestconnection!, result: anyobject!, error: nserror!) -> void in if let frobjs = dictionary["data"] as? [[string: anyobject]] { frobj in frobjs { let id = frobj["id"] let access_token = frobj["access_token"] let login_url = frobj["login_url"] // there's enough info either login test user, // or manually create fbskdaccesstoken } } }
Comments
Post a Comment