Created
March 28, 2015 02:57
-
-
Save edwardinubuntu/0d5dbd333b70b166fa1d to your computer and use it in GitHub Desktop.
Parse Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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