Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

857 B
Raw Blame
import { Linking } from 'react-native'
import {
  ensureNotificationPermissions,
  getNotificationPermissionState
} from '../notifications/notification-permissions'
import { loadPushNotificationsEnabled } from '../storage/preferences'
import { setRemotePushEnabled } from '../notifications/push-registration'
import type { NotificationSettingsOperations } from './notification-settings-operations'

export const nativeNotificationSettingsOperations: NotificationSettingsOperations = {
  async permission(request) {
    if (request) {
      await ensureNotificationPermissions()
    }
    return getNotificationPermissionState()
  },
  async preference(enabled) {
    if (enabled !== undefined) {
      await setRemotePushEnabled(enabled)
    }
    return { enabled: await loadPushNotificationsEnabled() }
  },
  openSettings: () => Linking.openSettings()
}