Skip to content

Commit

Permalink
chore: include PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
OS-ricardomoreirasilva committed Jul 10, 2024
1 parent bf08214 commit 6676470
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.outsystems.firebase.cloudmessaging

import android.Manifest
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
Expand Down Expand Up @@ -44,7 +45,6 @@ class OSFirebaseCloudMessaging : CordovaImplementation() {
private const val NOTIFICATION_PERMISSION_REQUEST_CODE = 123123
const val FCM_EXPLICIT_NOTIFICATION = "com.outsystems.fcm.notification"
const val GOOGLE_MESSAGE_ID = "google.message_id"
const val POST_NOTIFICATIONS_PERMISSION = "android.permission.POST_NOTIFICATIONS"
}

override fun initialize(cordova: CordovaInterface, webView: CordovaWebView) {
Expand Down Expand Up @@ -259,11 +259,11 @@ class OSFirebaseCloudMessaging : CordovaImplementation() {
flow = MutableSharedFlow(replay = 1)

// if it doesn't have permission, request it
val hasPermission = checkPermission(POST_NOTIFICATIONS_PERMISSION)
val hasPermission = checkPermission(Manifest.permission.POST_NOTIFICATIONS)
if (hasPermission) {
flow?.emit(OSFCMPermissionEvents.Granted)
} else {
requestPermission(NOTIFICATION_PERMISSION_REQUEST_CODE, POST_NOTIFICATIONS_PERMISSION)
requestPermission(NOTIFICATION_PERMISSION_REQUEST_CODE, Manifest.permission.POST_NOTIFICATIONS)
}

flow?.collect {
Expand Down

0 comments on commit 6676470

Please sign in to comment.