Browse Source

added push notification request (#11)

Co-authored-by: Vitalik Yatsenko <vitalik@noreply.localhost>
Reviewed-on: #11
Co-authored-by: YaroslavBerkuta <yaroslavberkuta@gmail.com>
Co-committed-by: YaroslavBerkuta <yaroslavberkuta@gmail.com>
pull/16/head
YaroslavBerkuta 10 months ago committed by Vitalik Yatsenko
parent
commit
3f0aabbe9a
  1. 5
      src/services/system/notification.service.ts

5
src/services/system/notification.service.ts

@ -4,7 +4,7 @@ import { INotification } from '@/shared/interfaces' @@ -4,7 +4,7 @@ import { INotification } from '@/shared/interfaces'
import { NotificationKeys, RouteKey } from '@/shared/enums'
import { SelectChat } from '@/store/chats'
import { simpleDispatch } from '@/store/store-helpers'
import { AppState, Platform } from 'react-native'
import { AppState, PermissionsAndroid, Platform } from 'react-native'
import OneSignal from 'react-native-onesignal'
import { DeviceInfoService } from './device-info.service'
import { navigate } from './navigation.service'
@ -140,6 +140,9 @@ export const init = async () => { @@ -140,6 +140,9 @@ export const init = async () => {
},
)
} else {
PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,
)
OneSignal.getDeviceState()
.then(device => {
resolve(device)

Loading…
Cancel
Save