Skip to content

Commit 29000d2

Browse files
author
Bas Buijsen
committed
throw error for subscribing on js
1 parent 24268d5 commit 29000d2

File tree

1 file changed

+2
-0
lines changed
  • firebase-messaging/src/jsMain/kotlin/dev/gitlive/firebase/messaging

1 file changed

+2
-0
lines changed

firebase-messaging/src/jsMain/kotlin/dev/gitlive/firebase/messaging/messaging.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ actual class FirebaseMessaging(val js: Messaging) {
1313
actual fun subscribeToTopic(topic: String) {
1414
// This is not supported in the JS SDK
1515
// https://firebase.google.com/docs/reference/js/messaging_.md#@firebase/messaging
16+
throw NotImplementedError("Subscribing to topics is not supported in the JS SDK")
1617
}
1718

1819
actual fun unsubscribeFromTopic(topic: String) {
1920
// This is not supported in the JS SDK
2021
// https://firebase.google.com/docs/reference/js/messaging_.md#@firebase/messaging
22+
throw NotImplementedError("Unsubscribing from topics is not supported in the JS SDK")
2123
}
2224

2325
actual suspend fun getToken(): String = dev.gitlive.firebase.messaging.externals.getToken(js).await()

0 commit comments

Comments
 (0)