Skip to content

Commit

Permalink
fix(wallet-mobile): Request android permissions only on android (#3806)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljscript authored Jan 31, 2025
1 parent 71f5814 commit 59fd491
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import messaging from '@react-native-firebase/messaging'
import React from 'react'
import {PermissionsAndroid} from 'react-native'
import {PermissionsAndroid, Platform} from 'react-native'
import {Notifications} from 'react-native-notifications'

import {logger} from '../../../../kernel/logger/logger'
Expand All @@ -15,7 +15,9 @@ let initialized = false
const initPushNotifications = () => {
if (initialized) return
initialized = true
PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS)
if (Platform.OS === 'android') {
PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS)
}

const unsubscribeFromForegroundMessage = messaging().onMessage((remoteMessage) => {
const {notification} = remoteMessage
Expand Down

0 comments on commit 59fd491

Please sign in to comment.