Skip to content

Instantly share code, notes, and snippets.

@edwardinubuntu
Created March 28, 2015 02:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwardinubuntu/0d5dbd333b70b166fa1d to your computer and use it in GitHub Desktop.
Save edwardinubuntu/0d5dbd333b70b166fa1d to your computer and use it in GitHub Desktop.
Parse Setup
@Override
public void onCreate() {
super.onCreate();
// UserVoice
Config config = new Config("lovingheart.uservoice.com");
config.setForumId(244034);
config.setTopicId(50280);
UserVoice.init(config, this);
// Flurry
FlurryAgent.onStartSession(this, "Y4FDRZ32XVJ6V264G7XH");
// Active App
AppEventsLogger.activateApp(getApplicationContext(), getString(R.string.app_id));
// GA
AnalyticsManager.getInstance().Initialize(getApplicationContext());
ImageLoaderConfiguration imageLoaderConfiguration = new ImageLoaderConfiguration.Builder(getApplicationContext())
.build();
ImageLoader.getInstance().init(imageLoaderConfiguration);
// Parse
Parse.initialize(this, ParseSettings.PARSE_API_TOKEN, ParseSettings.PARSE_API_TOKEN_2);
// Crashlytics
Crashlytics.start(this);
ParseObject.registerSubclass(Flag.class);
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// Optionally enable public read access while disabling public write access.
defaultACL.setPublicReadAccess(true);
defaultACL.setPublicWriteAccess(false);
ParseACL.setDefaultACL(defaultACL, true);
if (ParseUser.getCurrentUser() != null && ParseUser.getCurrentUser().getString(ParseObjectManager.USER_NAME) != null) {
// Save the current Installation to Parse.
PushService.setDefaultPushCallback(this, MainActivity.class);
ParseInstallation parseInstallation = ParseInstallation.getCurrentInstallation();
parseInstallation.put("language", Locale.getDefault().getLanguage());
parseInstallation.put("user", ParseUser.getCurrentUser());
parseInstallation.saveInBackground();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment