File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
android/src/main/java/com/cryptoticket/reactnativepushnotification Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -148,11 +148,12 @@ class PushNotificationModule(reactContext: ReactApplicationContext) : ReactConte
148148 try {
149149 FirebaseMessaging .getInstance().token
150150 .addOnCompleteListener(OnCompleteListener { task ->
151- if (! task.isSuccessful) {
151+ if (task.isSuccessful) {
152+ val token = task.result
153+ promise.resolve(token)
154+ } else {
152155 promise.reject(" E_FIREBASE_DEVICE_TOKEN" , " Unable to retrieve device FCM token" )
153156 }
154- val token = task.result
155- promise.resolve(token)
156157 })
157158 } catch (err: IOException ) {
158159 promise.reject(" E_FIREBASE_DEVICE_TOKEN" , " Firebase instance is not available" );
Original file line number Diff line number Diff line change 11{
22 "name" : " @cryptoticket/react-native-push-notification" ,
3- "version" : " 1.4.1 " ,
3+ "version" : " 1.4.2 " ,
44 "description" : " React native package that manages push notifications" ,
55 "main" : " index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments