Skip to content

Instantly share code, notes, and snippets.

View brownbl1's full-sized avatar

Ben Brown brownbl1

  • Bentley Systems
  • Lancaster, PA
View GitHub Profile
import { Util, Permissions, Notifications, Constants } from 'expo'
export const registerForPushNotificationsAsync = async () => {
const { status: existingStatus } = await Permissions.getAsync(
Permissions.NOTIFICATIONS
)
let finalStatus = existingStatus
if (existingStatus !== 'granted') {
const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS)