its like schizod2k says, we expected it to return some kind of info or a confirmation that you had been logged in with the authtoken as described in the guide. You should remove this so others dont get confused by this as well.
so instead of using cloud.isLoggedIn I now have to figure out a different way to at least check for online connection before logging in and notifying the user that he needs to check his device connection if its off. Just logging in and assuming everything is fine like with authtoken is not an option. There are devices out there that isnt always online and the user must be notified else they just get mad and shout broken app and give you one star ratings
@schizoid2k, that’s probably my fault, when I wrote the guide. I missed it. I’ll see if we can get that revised.
@borgb, there are plenty of ways of checking for a network connection without depending on the cloud’s login. But if you think you’re logged in, you could hit one of the API’s like getting the users profile and see if that returns and error or not.
Thanks Rob… Your last comment also gives me an idea as well… We can check for connectivity by calling a cloud function to see if there is an error. That’s a workable solution for me.
so you dont use the authtoken to log in? but the manage cloud users guide say that is one of the ways of logging in? Its not that its a problem, using email and password instead works fine. Just want to have it clear Thanks!
When the user quits the game and returns later, I have a button “Last user” which should login the last player automatically (so he must not enter the email/password every time, as we have for the simulator - boring).
Once a user is registered and logged in, you can save the authToken
and, in future sessions of the app, log the user in using the token.
Alternatively, you can store the user’s email and password and use them
to log in the user as shown under Email/Password Login above.
If the login is successful, the authListener() function will be called with an event type of “sessionLoggedIn”.
</docs>
So in the docs you suggest we can store the emaail/password and then use it for later login, what I did because the session login does not work (if I call the above code no event is triggered).
yeah, what ubj3d says. I also have a function that logs in the previous user so they dont have to do the login/password every session. But that dosent work with the authtoken session login as described. so now I have to store e-mail/password until I can get authtoken to work.
I just got this working recently, and this is what I noticed. Maybe this will help. 1. Are you still calling cloud.init? I don’t see it in the little sample of code above, so just making sure. 2. For authToken, are you checking for event.type “sessionLoggedIn”? 3. If you are using storyboard, your require variable has to be the same name. I had cloud = require “cloud” in one scene and coronaCloud = require “cloud” in another scene. The authToken was not available in my scene with coronaCloud defined since I called the init with cloud. Hope this helps. If not, post your listener.
As strange as this is… logging in via authToken is no longer working for me.
I had no problem for several days, and now I have the exact same problem. My auth listener is never called when trying to log in via authToken. Loggin in via email/password does work as expected.
as stated above by me and others, nothing is happening. no error, no output, nothing. and I have tried it with cloud.debugEnabled = true
if this should work and others are getting this to work then it would be great to se some code of this. Currently I am saving email and password for login.
… then the event listener is called. Using the session login, the listener is never called.
I have Lua Glider, and placed a breakpoint inside ccLoginListener, and it is never trapped when using session login. I just tried it with build 2013.1095, and previously with 2013.1080