please, try it now
var user = Backendless.UserService.login($scope.user.email, $scope.user.password, true);
var currentUser = Backendless.LocalCache.get( "current-user" );
console.log(currentUser);
Hello,
Yesterday’s “currentUser” was returning the object correctly but today it returns “undefined”. Did you change anything?
Raul,
Please see my response here:
http://support.backendless.com/t/only-backendless-user-accepted-backendless-min-js45#comment-2705
It explains how to get the current user object.
Regards,
Mark
Working fine now
I require your attention urgently.
Mark. The API is failing again. When i invoke the service with this code:
if(Backendless.UserService.isValidLogin()===true)
{
var userObjectId = Backendless.UserService.loggedInUser();
console.log(userObjectId);
user = Backendless.Data.of( Backendless.User ).findById(userObjectId);
}
Backendless.UserService.isValidLogin() returns true…
this returns undefined
Backendless.UserService.loggedInUser();
Then this returns an error saying “Invalid value for the “value” argument” . The argument must contain only string or object values
user = Backendless.Data.of( Backendless.User ).findById(userObjectId);
My app is in production on the stores and my clients are receiving this error upon registering in the app and using it again. It was working previously, it was a change on the server side.
Hi Nicolas!
Please check your code again. We have updated library on site.
Sorry for this inconvenience.
Regards,
Kate.
Hi Kate
It is still not working
If you want download the app https://play.google.com/store/apps/details?id=sitmap.cometealguito_1
https://itunes.apple.com/us/app/comete-alguito/id988105085?mt=8
Register yourself (click on the person icon) and then register. Close the app and then reopen it
BTW, you meant that you adjusted the code on Backendless and the code above is no longer useful or that you made the previous method work as it was again?
We updated this library on our site: http://api.backendless.com/sdk/js/latest/backendless.js
(also you can use this lib too: http://backendless.com/sdk/js/2.0.2/backendless.js).
Your app works with one of these libs?
I have a sales meeting right now. I’ll try as soon as I exit it.
The thing is that if it works with the Backendless api that is online and it is a problem of lack of backwards compatibility with the previous app version I’ll have to recompile my app and send it for approval to the Appstore, where the average time for approval of any new version of an app is 9 days. That means my users and all the marketing campaign I’m doing now will be left with an useless up for 9 days.
I can confirm that the error is solved with the new Backendless version (latest). Yet, i am left with the big problem of the 9 days wait, which i honestly cannot accept.
Nicolas,
Please clarify what you meant by “error is solved”? Your app started working again without any changes? Or you still had to make changes on your side?
Regards,
Mark
The error still occurs within the app. If I change the Backendless.js in my development version it works great. Yet, my published app which has the previously running version does not work.
I am instructing the team to revert the changes. This will go in effect in about 6 hours. I will be personally looking into this incident.
Could you please let me know under what conditions the error occurs (right now) in the app? I’d like to come up with ideas for a workaround.
My sincere apologies for the inconvenience this has caused.
Regards,
Mark
Mark. I sincerely appreciate your commitment to give the best technical support possible. The app will start to be used again by customers after 10 am (GMT -5).
Right now when a customer who has registered in the app tries to use the app again he or she is presented with an ‘unexpected error’ mesaage as the app tries to load the person’s profile from the backendless service service (above code). This leaves the app unusable as he/she cannot load his account to login again, nor can they proceed within the app to make a payment (the main functionality of the app)
Tonight I’ll send the app with the new .js to the Appstore so they publish it asap and you can roll your changes.
Once again. I appreciate your excelente support despite the incident.
Best regards,
Nicolas .
Nicolas,
Before you republish the app, please check if it works with a specific version of the script. Using /latest is not a good idea. We strive to avoid backward compatibility changes, but as the practice shows these accidents happen.
Specific versions of the script are available at:
http://backendless.com/sdk/js/2.0/backendless.js
http://backendless.com/sdk/js/2.0.1/backendless.js
http://backendless.com/sdk/js/2.0.2/backendless.js
These will not be changing in the future.
Please let me know if any one of these work for you, so we can plan our course of action better.
Regards,
Mark