Created
April 13, 2020 23:32
-
-
Save androuino/24ab771b8781e90b9a5cbc7f3eb12201 to your computer and use it in GitHub Desktop.
This is how I initialize my parse server in my application
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
Parse.initialize( | |
Parse.Configuration.Builder(this) | |
.applicationId(Constant.APP_ID) | |
.clientKey(null) // no client key needed in Parse open source | |
.server(Constant.HOST) // http://talk.us-west-2.elasticbeanstalk.com/parse/ | |
.clientBuilder(builder) | |
.build() | |
) | |
FirebaseInstanceId.getInstance().instanceId.addOnSuccessListener { | |
val token = it.token | |
if (token.isNotEmpty()) | |
Timber.tag(TAG).d(token) | |
} | |
val installation = ParseInstallation.getCurrentInstallation() | |
installation.put("user", "androuino") | |
installation.put("GCMSenderId", "myID") | |
installation.saveInBackground { e -> | |
if (e == null) | |
Timber.tag(TAG).d(installation.deviceToken) | |
else | |
Timber.tag(TAG).e(e) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment