在 android 中,我在后端使用 Parse 和 back4app.com,每当我在返回保存回调中使用 myParseobject.saveInBackground() 时,我都会收到错误消息,指出 ParseException:只有 ACL 可以存储在ACL key
如果有人对此有任何想法,请分享。
最佳答案
每当您使用 saveInBackground() 方法保存 ParseObject 时,您需要执行 YourParseObject.setAcl(your_Acl_Object_here); 您可以从下面找到工作代码,
对于公共(public)访问你可以这样写,
ParseUser currentUser = ParseUser.getCurrentUser();
ParseACL acl = new ParseACL(currentUser);
acl.setPublicReadAccess(true);
YourParseObject.setACL(acl);
如果您只想使用 CurrentUser 访问权限,您可以这样写,
ParseUser currentUser = ParseUser.getCurrentUser();
ParseACL acl = new ParseACL();
acl.setReadAccess(currentUser,true);
acl.setWriteAccess(currentUser,true);
YourParseObject.setACL(acl);
关于key - 运行时异常 : only ACLs can be stored in the ACL key in android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42831154/