-
Notifications
You must be signed in to change notification settings - Fork 159
/
messaging.kt
36 lines (30 loc) · 991 Bytes
/
messaging.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package dev.gitlive.firebase.messaging
import dev.gitlive.firebase.Firebase
import dev.gitlive.firebase.FirebaseApp
/** Returns the [FirebaseMessaging] instance of the default [FirebaseApp]. */
public expect val Firebase.messaging: FirebaseMessaging
/**
* Top level [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/)
* singleton that provides methods for subscribing to topics and sending upstream messages.
*/
public expect class FirebaseMessaging {
/**
* Subscribe to a topic.
* @param topic The topic to subscribe to.
*/
public fun subscribeToTopic(topic: String)
/**
* Unsubscribe from a topic.
* @param topic The topic to unsubscribe from.
*/
public fun unsubscribeFromTopic(topic: String)
/**
* Get FCM token for client
* @return [String] FCM token
*/
public suspend fun getToken(): String
/**
* Delete FCM token for client
*/
public suspend fun deleteToken()
}