@olav.morkrid, I don’t think it hurts to submit a bug report. About Apple, I doubt it will reject your apps because of this particular leak you found (unless your app accumulates this leak very quickly for some reason.) How often & how quickly do you add the 64 bytes to the memory during the time the user uses your app? If it adds up very rapidly and ends up crashing the app every time you run your app, then it would be a no go (meaning, Apple won’t approve it.) But if it takes hours and months of uninterrupted use of your app, then Apple probably won’t notice.
@Tom, here’s the update to my saga. I was able to sort out the user flow by removing facebook.logout entirely and calling facebook.login only once at the time of entry to the Scene C with rows & rows of FB friends (which the user enters from Scene B with FB Connect/Friends button. And sorry about changing the scene names – I felt I needed to introduce scene C to make my test case easier to understand.)
Anyhow, thanks to your detailed post on #47, I decided the evil is with using facebook.login for the multiple of facebook.request the app makes in a quick succession where the likelihood of user signing out in-between is almost nil. Taking this measure solved the CASE 2 & CASE 4 issue completely. It flows perfectly well, just like how I wanted to have it. With this fix, the user experience is very much the same as the successful user experience achieved with the CASE 4 using daily build 990.
THAT SAID… I don’t know how I may work around the last bit of problem. I still get Error Status 400 under the following scenario. Can you think of any reason why it’s still giving out this error? Is this a Corona bug, or is this a Facebook bug, or am I doing something wrong?
CASE 5: Error 400 (app built with1013, installed on a freshly wiped device with a new user)
1 (scene A): facebook.login( myAppID, myFBRegListener, { "“email”, “publish_actions” } )
* User skips the FB Connect button
2 (scene B): go to scene C
* Because the user has not supplied FB credentials, this scene displays FB Connect button
* Tapping on the FB Connect button transitions the scene to C (using storyboard API)
3 (scene C): facebook.login( myAppID, myFBLoginListener, { “email”, “publish_actions” } )
* Upon entering this scene, facebook.login( myAppID, myFBLoginListener, { “email”, “publish_actions” } ) is invoked.
* Upon successful login, facebook.request( “me” ) is invoked
* Upon successful receipt of the json object with the user data, the app saves the data
* Upon successful save, facebook.request( “me/friends” ) is invoked
* Upon fetching the friends list, the scene C successfully displays the friends list
4 (scene C): facebook.login( myAppID, FBPostListener )
* User taps on a friend
* If the friend is already registered with the app, the app initiates a match game between the players
* If the friend is not already registered with the app, facebook.login( myAppID, FBPostListener ) is invoked
* Upon successful login, facebook.showDialog( “feed”, attachment ) is invoked
5 (scene C): facebook.showDialog( “feed”, attachment )
* This brings up the FB dialog without a problem
* The user taps on Share button, and it posts on the friends wall.
* The user now exits scene C and returns to scene B
6 (scene B): go to scene C
* Now that the app has the user’s FB credential, the button changes from FB Connect to FB Friend
* Tapping on the FB Friend button sends the user to scene C again
7 (scene C): facebook.login( myAppID, myFBListener )
* Now that the app has the user’s FB credential, entering the scene invokes facebook.login( myAppID, myFBListener ) instead of facebook.login( myAppID, myFBLoginListener, { “email”, “publish_actions” } )
* Then the dreadful Error: HTTP status code: 400 shows up.
* User sees a message from the app stating that it could not log in to Facebook.
* Tapping on the message sends the user back to scene B.
8 (scene B & C)
* This turns into never ending loop – i.e., step 6 and step 7 can repeat over and over
* At this point, the user kills the app by tapping on home button, then double tapping on home button, and then closing the app.
9 (scene B) go to scene C
* After the app is restarted, the user goes straight to Scene B
* The app remembers the user’s FB credential and displays FB Friend button
* Tapping on the FB Friend button sends the user to scene C
10 (scene C): facebook.login( myAppID, myFBListener )
* Upon entering the scene, facebook.login( myAppID, myFBListener ) is invoked (just like step 7 above)
* Upon successful login, the listener invokes facebook.request( “me/friends” )
* Upon fetching the friends list, the scene C successfully displays the friends list
After this, moving between scenes B & C causes no error.
How do you think this problem can be solved?
I’m not sure if this means anything, but I also noticed something odd. ( Edit: Could this be related to the phantom Session Bug that haakon mentions in post #3…? ) After I had the never ending loop in step 8, I left the device idle for a while without killing it (mainly because I was writing up this post). And then before killing the app, I tapped on Friend button once again. It brought up FB permission screen. I don’t know why I didn’t tap on Okay for the permission request, but I didn’t. I just killed the app right there and then, which brought me to step 9. Anyhow, it still makes very little sense why Error 400 occurs. I just hope you can identify the issue here, because I can’t think of any work around that makes sense.
Naomi
Saga continues… This is getting really long, but here’s another case where it manifests exactly the same problem. I believe the issue is clear enough at this point, and I’d very much like to hear what you suggest I do with Facebook feature. It really isn’t going to work for me the way it behaves. (Unless, I suppose, I bring back that awkward facebook.logout calls or revert back to daily build 990.)
EDIT: CASE 6 actually works perfectly fine. It appears that I was testing some other path, thinking it was this particular path I was taking. Please see my update in post #55.
CASE 6: Error 400 (app built with1013, installed on a freshly wiped device)
1 (scene A): facebook.login( myAppID, myFBRegListener, { "“email”, “publish_actions” } )
* User taps on the FB Connect button, which invokes facebook.login( myAppID, myFBRegListener, { "“email”, “publish_actions” } )
* Upon successful login, facebook.request( “me” ) is invoked
* Upon successful receipt of the json object with the user data, the app saves the data and go to next scene (using storyboard API)
2 (scene D): facebook.login( myAppID, FBScoreListener )
* The user plays a few games and reaches a new high score.
* The user has a choice to post his/her score and see FB friends scores
* The user chooses to do so, and the app invokes facebook.login( myAppID, FBScoreListener )
* Upon successful login to FB, the app invokes facebook.request(“me/scores” , “POST”, attachment)
* Upon successful post to FB, the app invokes facebook.request(myAppID … “/scores”)
* Upon successful retrieval of score data json object from FB, the app displays the friends scores
* The user then proceed to play another game.
3 (scene D): facebook.login( myAppID, FBScoreListener )
* The user plays a game and beats the previous high score.
* The user chooses to post it to FB and see FB friends score, which invokes facebook.login( myAppID, FBScoreListener )
* Upon successful login to FB, the app invokes facebook.request(“me/scores” , “POST”, attachment)
* Upon successful post to FB, the app tries to invoke facebook.request(appID … “/scores”) but fails with Error: HTTP status code: 400
From then onward, the app performs all non-FB related tasks, but it returns Error 400 for anything FB. Accessing Friends List in Scene C fails with Error 400 as well.
However, once I kill and restart the app, everything normalizes, and posting high scores one game after the other no longer fails. Friends List in Scene C can also be accessed and used as expected.
There is a bug somewhere, but at this point, I’m pretty sure the bug is caused either by the updated Facebook SDK or by how Corona integrated it. [import]uid: 67217 topic_id: 34416 reply_id: 140589[/import]