Skip to content

Instantly share code, notes, and snippets.

@androuino
Created April 13, 2020 23:32
Show Gist options
  • Save androuino/24ab771b8781e90b9a5cbc7f3eb12201 to your computer and use it in GitHub Desktop.
Save androuino/24ab771b8781e90b9a5cbc7f3eb12201 to your computer and use it in GitHub Desktop.
This is how I initialize my parse server in my application
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