Skip to content

Instantly share code, notes, and snippets.

@PetkevichPavel
Last active August 28, 2019 15:30
Show Gist options
  • Save PetkevichPavel/c4c83d79f0bdd5bac5d216938e1f7c64 to your computer and use it in GitHub Desktop.
Save PetkevichPavel/c4c83d79f0bdd5bac5d216938e1f7c64 to your computer and use it in GitHub Desktop.
AN_Cloud Function: Application class.
override fun onCreate() {
super.onCreate()
initFirebase()
this.getRCF().setDefaultRC()
}
private fun initFirebase() {
FirebaseApp.initializeApp(this)
firebaseRemoteConfig = FirebaseRemoteConfig.getInstance()
val configSettings = FirebaseRemoteConfigSettings.Builder()
.setFetchTimeoutInSeconds(0)
.setMinimumFetchIntervalInSeconds(0)
.build()
firebaseRemoteConfig?.setConfigSettingsAsync(configSettings)
FirebaseMessaging.getInstance().subscribeToTopic(PUSH_RC)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment