Skip to content

Instantly share code, notes, and snippets.

@hiranya911
Created December 25, 2018 21:09
Show Gist options
  • Save hiranya911/8f834dbd794cc56d706520f1dc74a86c to your computer and use it in GitHub Desktop.
Save hiranya911/8f834dbd794cc56d706520f1dc74a86c to your computer and use it in GitHub Desktop.
private suspend fun savePref(currency: String, min: Double, max: Double) {
val instanceId = FirebaseInstanceId.getInstance().instanceId.await()
val data = mapOf(
"${currency}_min" to min,
"${currency}_max" to max,
"token" to instanceId.token
)
db.collection("prefs").document(instanceId.id)
.set(data, SetOptions.merge()).await()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment