So Facebook have recently updated their API to a newly versioned system. v1.0 and v2.0 or old calls can remain using the unversioned mode.
Since the new api was released, im having trouble with the facebook.login command whereby when i make a second call to get extended permissions, i get
May 4 14:07:46 Craigs-iPad MyGameName[3064] <Error>: +[FBSession isPublishPermission:]: unrecognized selector sent to class 0x38a2ac
May 4 14:07:46 Craigs-iPad UIKitApplication:net.mycompany.myproduct[0x18be][3064] <Notice>: Generic error: NSInvalidArgumentException: +[FBSession isPublishPermission:]: unrecognized selector sent to class 0x38a2ac
May 4 14:07:46 Craigs-iPad UIKitApplication:net.mycompany.myproduct[0x18be][3064] <Notice>: (
May 4 14:07:46 Craigs-iPad UIKitApplication:net.mycompany.myproduct[0x18be][3064] <Notice>: 0 CoreFoundation 0x37fee8a7 __exceptionPreprocess + 186
May 4 14:07:46 Craigs-iPad UIKitApplication:net.mycompany.myproduct[0x18be][3064] <Notice>: 1 libobjc.A.dylib 0x3331f259 objc_exception_throw + 32
May 4 14:07:46 Craigs-iPad UIKitApplication:net.mycompany.myproduct[0x18be][3064] <Notice>: 2 CoreFoundation 0x37ff192f +[NSObject doesNotRecognizeSelector:] + 174
May 4 14:07:46 Craigs-iPad UIKitApplication:net.mycompany.myproduct[0x18be][3064] <Notice>: 3 CoreFoundation 0x37ff0915 ___forwarding___ + 300
May 4 14:07:46 Craigs-iPad UIKitApplication:net.mycompany.myproduct[0x18be][3064] <Notice>: 4 CoreFoundation 0x37f4b650 _CF_forwarding_prep_0 + 48
May 4 14:07:46 Craigs-iPad UIKitApplication:net.mycompany.myproduct[0x18be][3064] <Notice>: 5 MyGameName 0x001d8409 _ZNK6Corona12IOSFBConnect5LoginEPKcPS2_i + 264
May 4 14:07:46 Craigs-iPad UIKitApplication:net.mycompany.myproduct[0x18be][3064] <Notice>: 6 MyGameName 0x001da461 _ZN6Corona15FacebookLibrary5loginEP9lua_State + 204
<there are more entries which i can post if needed>
Now prior to the new fb sdk release this has been working fine for me. My app is still in development (was about to start final testing cycle), i have been using the FB -> DevPortal -> Roles -> Test Users. Now it seems that any new test users i create will generate this error when i try to login with them, regardless of what API version i specify that they are using (you can set API level when you turn on Authorize Test Users for This App? setting when creating the test user). Leaving that setting off completely also has the same effect.
Older test users that i created prior to the fb upgrade and have logged in with before still work fine.
The error occurs when i request the “publish_actions” permission after i have logged in.
It is my understanding that you generally need to request extended permissions after the login call by issuing a second login request for the extended permissions. So my code effectively does the following
– calls login initially with no params
facebook.login( fbAppID, facebookListener )
– once the listener returns that the login was successful i query the available permissions for the access token by doing the following
network.request( “https://graph.facebook.com/me/permissions?access_token=” … tostring(fbAccessToken), “GET”, verifyPermissionsListener, myParams )
I then check the returned permissions and if publish_actions isn’t available i then ask for it by doing
facebook.login( fbAppID, facebookListener, { “publish_actions” } )
This is the point where the above error occurs, as soon as i make that second login call.
As mentioned, this was working fine for me previously, i have been doing alot of testing and deveopment work using the fb api over the last month without any problems, and have 7 older test users that all work fine using this method, its only since the new api was released that any new test users i create wont work.
All of the above was done with the latest public release, build 2189a. I have also downloaded the latest daily build 2295 and got the same result (i only gave it one try on this build with a test user set for v2 api).
Please advise on
-
am I going about requesting extended permissions in the correct way,
-
what is the cause of the error shown above
-
is there more work to come in the daily builds to support the new fb v2.0 api as it would be preferable to switch over to that before releasing if it wont cause too many delays to my release.
Cheers
Craig