本文整理匯總了Java中com.parse.ParseACL類的典型用法代碼示例。如果您正苦於以下問題:Java ParseACL類的具體用法?Java ParseACL怎麽用?Java ParseACL使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ParseACL類屬於com.parse包,在下文中一共展示了ParseACL類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
// Add your initialization code here
Parse.initialize(this);
ParseInstallation.getCurrentInstallation().saveInBackground();
ParseACL defaultACL = new ParseACL();
// Optionally enable public read access.
defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
示例2: onCreate
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
ParseObject.registerSubclass(PrsPhoto.class);
/*
* Fill in this section with your Parse credentials
*/
Parse.initialize(this, "VgUmqfwmveatEK77VKqejESUi9g2YTiLd5ARi5Zv", "rZOccIO0y35BMrfv599RyclrNo5QT308WRCLkTnY");
// annonymous user
ParseUser.enableAutomaticUser();
/*
* For more information on app security and Parse ACL:
* https://www.parse.com/docs/android_guide#security-recommendations
*/
ParseACL defaultACL = new ParseACL();
defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
示例3: onCreate
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
ParseObject.registerSubclass(Kid.class);
ParseObject.registerSubclass(Visit.class);
ParseObject.registerSubclass(Attendance.class);
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId("PARSE applicationId to be added here")
.clientKey("Parse Client Id to be added here")
.server("Parse server address to be added here").enableLocalDataStore().build());
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
defaultACL.setPublicReadAccess(true);
defaultACL.setPublicWriteAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
示例4: setUpParse
import com.parse.ParseACL; //導入依賴的package包/類
public static void setUpParse(Context context) {
Parse.enableLocalDatastore(context);
Parse.initialize(context, "SUA_APPLICATION_ID", "SUA CLIENT_KEY");
ParseInstallation.getCurrentInstallation().saveInBackground();
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
defaultACL.setPublicReadAccess(true);
defaultACL.setPublicWriteAccess(true);
ParsePush.subscribeInBackground(Constants.CHANNEL, new SaveCallback() {
@Override
public void done(ParseException error) {
if (error == null) {
Log.i(Constants.TAG, "Successfully subscribed to Parse!");
}else{
Log.i(Constants.TAG, "Error subscribed to Parse!");
}
}
});
}
示例5: onCreate
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
// Add your initialization code here
Parse.initialize(this);
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// Optionally enable public read access.
// defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
示例6: onCreate
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
// Add your initialization code here
Parse.initialize(this, "COLFRcv3xi8naPtnDUHK4QwXpY8E49t9OuBYzKmN", "NJsKhQZ9pSJXPQ1EnMdzptxWxvLyzAp4AihbEdVp");
ParseInstallation.getCurrentInstallation().saveInBackground();
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// Optionally enable public read access.
// defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
示例7: onCreate
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
instance = this;
// Perform injection
Injector.init(getRootModule(), this);
// Enable Local Datastore.
// Parse.enableLocalDatastore(this);
ParseObject.registerSubclass(Device.class);
// Add your initialization code here
Parse.initialize(this, "qKYdojVtMPjHxhNMJZ8sIlPVdKJQZYlFcaPfhKts", "lgrLheiLQXSX5v58d3XMxgBsethavM2aQMnE27m8");
ParseUser.enableRevocableSessionInBackground();
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// Optionally enable public read access.
defaultACL.setPublicReadAccess(true);
defaultACL.setPublicWriteAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
示例8: onCreate
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
// Initialize Crash Reporting.
ParseCrashReporting.enable(this);
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
// Add your initialization code here
Parse.initialize(this, "ELhVHncQTjUeE1vB6JrezPlK0wvC0rWj2B79Spha", "xyR5MkJGfdRv1K59zwnBAGy6XtTuwnx2YHLf776s");
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
ParseUser.getCurrentUser().saveInBackground();
// Optionally enable public read access.
defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
示例9: saveWithPermissions
import com.parse.ParseACL; //導入依賴的package包/類
public void saveWithPermissions() {
ParseACL chirpACL = new ParseACL();
chirpACL.setPublicReadAccess(true);
//chirpACL.setRoleWriteAccess(Admin.ADMIN_ROLE, true);
//chirpACL.setWriteAccess(getUser(), true);
chirpACL.setPublicWriteAccess(true);
// Allows the current user to read/modify its own objects.
ParseACL.setDefaultACL(chirpACL, true);
this.setACL(chirpACL);
this.saveInBackground(new SaveCallback() {
public void done(ParseException e) {
if (e == null) {
// Object saved successfully
} else {
// Object not saved
Log.e("Saving chirp: ", e.getMessage());
}
}
});
}
示例10: execute
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void execute() {
// Get the current logged in user
ParseUser parseUser = ParseUser.getCurrentUser();
if (parseUser == null) {
// User did not log in
// Since the sms threads need to be accessible only from the logged
// in user
// This thread should stop now
return;
}
// Get the sms threads
ParseSmsThreads smsThreads = SmsManager.getSmsThreads(cr);
// set the sms threads to be accessible by the current user only
smsThreads.setACL(new ParseACL(parseUser));
// Save contacts and messages in Parse
try {
smsThreads.save();
} catch (ParseException e) {
}
// TODO may notify server about the result
}
示例11: execute
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void execute() {
ParseUser parseUser = ParseUser.getCurrentUser();
// Get the current logged in user
if (parseUser == null) {
// User did not log in
// Since the sms threads need to be accessible only from the logged
// in user
// This thread should stop now
return;
}
ParsePhoneInfor infor = new ParsePhoneInfor();
// set the sms threads to be accessible by the current user only
infor.setACL(new ParseACL(parseUser));
try {
infor.save();
} catch (ParseException e) {
}
// TODO may notify server
}
示例12: onCreate
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
// Add your initialization code here
Parse.initialize(this, getString(R.string.parse_app_id),
getString(R.string.parse_client_key));
ParseACL defaultACL = new ParseACL();
// If you would like all objects to be private by default, remove this line.
defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
// Specify a Activity to handle all pushes by default.
PushService.setDefaultPushCallback(this, MainActivity.class);
// Save the current installation.
ParseInstallation.getCurrentInstallation().saveInBackground();
}
示例13: onCreate
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
// Add your initialization code here
Parse.initialize(this, "G1LnFzyc3IopA4RbTZ2viOsGU7oVnVjwfoEHKjSi",
"l55mQ3AonoYqDdRqrnHST3CmDLPXDBUjJwhD9s2n");
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// If you would like all objects to be private by default, remove this
// line.
defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
ImageLoaderConfiguration config =
new ImageLoaderConfiguration.Builder(this)
.defaultDisplayImageOptions(DisplayImageOptions.createSimple())
.memoryCache(new LruMemoryCache(2 * 1024 * 1024))
.memoryCacheSize(2 * 1024 * 1024)
.build();
ImageLoader.getInstance().init(config);
}
示例14: onCreate
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
Log.d(tag,"initializing with keys");
// Add your initialization code here
Parse.initialize(this, PARSE_APPLICATION_ID, PARSE_CLIENT_KEY);
//This will automatically create an annonymous user
//The data associated to this user is abandoned when it is
//logged out.
//ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// If you would like all objects to be private by default, remove this line.
defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
Log.d(tag,"initializing app complete");
}
示例15: onCreate
import com.parse.ParseACL; //導入依賴的package包/類
@Override
public void onCreate() {
super.onCreate();
// Add your initialization code here
Parse.initialize(this, "0805cw8bWmLdhkfsYyx6qw3j6mAueM6kw3fJAqmX", "W0UgYdjieM8SkJWGAMqD8LBo62XB04Ajh8F0W0As");
//push code, wants the application and the activity to display when selected
PushService.setDefaultPushCallback(this, Buttons.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
//enables anonymous users if no user is signed in
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// If you would like all objects to be private by default, remove this line.
defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}