File tree Expand file tree Collapse file tree 2 files changed +23
-27
lines changed
android/app/src/main/java/com/zulipmobile/notifications Expand file tree Collapse file tree 2 files changed +23
-27
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ package com.zulipmobile.notifications
2
+
3
+ import com.zulipmobile.notifications.onReceived
4
+ import com.google.firebase.messaging.FirebaseMessagingService
5
+ import com.google.firebase.messaging.RemoteMessage
6
+ import com.facebook.react.bridge.ReactContext
7
+ import com.facebook.react.ReactApplication
8
+ import com.zulipmobile.notifications.NotificationsModule
9
+
10
+ class FcmListenerService : FirebaseMessagingService () {
11
+ override fun onMessageReceived (message : RemoteMessage ) {
12
+ onReceived(this , message.data)
13
+ }
14
+
15
+ override fun onNewToken (token : String ) {
16
+ super .onNewToken(token)
17
+ val reactContext = (application as ReactApplication )
18
+ .reactNativeHost
19
+ .reactInstanceManager
20
+ .currentReactContext
21
+ NotificationsModule .emitToken(reactContext, token)
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments