0
我尝试使用云代码获取当前用户。解析|云代码当前用户
var verificationCode = (Math.floor(Math.random()*900000)) + 100000 ;
var user = Parse.User.current();
user.set("phoneVerificationCode", verificationCode);
user.save();
当我在Xcode中调用方法。
PFCloud.callFunctionInBackground("sendVerificationCode", withParameters:["phoneNumber": phoneNumberText])
其发送,但我得到这个错误:
Error: TypeError: Cannot call method 'set' of null
我该怎么办?
再次提醒你的'user.set'可能会出现问题。 – 2014-12-13 07:01:21
这个班级是“用户”的权利?和是的,关键“phoneVerificationCode”是好的。 – user1809478 2014-12-13 07:10:36
您无法从cloude代码获取当前用户。当前用户在本地保存在客户端。欲了解更多信息,请参阅此链接https://parse.com/docs/js_guide#users-current – Vigen 2014-12-13 21:45:02