diff --git a/examples/RNOneSignalExpoExample/App.tsx b/examples/RNOneSignalExpoExample/App.tsx index cbc3569..69b03c8 100644 --- a/examples/RNOneSignalExpoExample/App.tsx +++ b/examples/RNOneSignalExpoExample/App.tsx @@ -1,13 +1,21 @@ +import React from 'react'; import { StatusBar } from 'expo-status-bar'; import { StyleSheet, Text, View } from 'react-native'; -import OneSignal from 'react-native-onesignal'; +import { LogLevel, OneSignal } from "react-native-onesignal"; const initOneSignal = () => { - OneSignal.setAppId("8fbf6c72-4b80-47a8-86ae-68de02259355"); - OneSignal.setLogLevel(6, 0); - OneSignal.promptForPushNotificationsWithUserResponse(response => { - console.log(response); - }); + OneSignal.initialize("8fbf6c72-4b80-47a8-86ae-68de02259355"); + OneSignal.Debug.setLogLevel(LogLevel.Verbose); + + // Also need to enable notifications to complete OneSignal setup + if (await OneSignal.Notifications.canRequestPermission()) { + let permission = OneSignal.Notifications.hasPermission(); + if (!permission) { + await OneSignal.Notifications.requestPermission(true); + } + } + OneSignal.setConsentRequired(true); + OneSignal.setConsentGiven(true); } export default function App() { diff --git a/examples/RNOneSignalExpoExample/app.json b/examples/RNOneSignalExpoExample/app.json index 5f0e7b3..a6a6484 100644 --- a/examples/RNOneSignalExpoExample/app.json +++ b/examples/RNOneSignalExpoExample/app.json @@ -2,7 +2,7 @@ "expo": { "name": "my-app", "slug": "my-app", - "version": "1.0.0", + "version": "1.0.1", "orientation": "portrait", "icon": "./assets/icon.png", "userInterfaceStyle": "light", diff --git a/examples/RNOneSignalExpoExample/eas.json b/examples/RNOneSignalExpoExample/eas.json index 44930a4..9aeb0d5 100644 --- a/examples/RNOneSignalExpoExample/eas.json +++ b/examples/RNOneSignalExpoExample/eas.json @@ -1,6 +1,6 @@ { "cli": { - "version": ">= 0.48.2" + "version": ">= 5.6.0" }, "build": { "development": { diff --git a/examples/RNOneSignalExpoExample/package.json b/examples/RNOneSignalExpoExample/package.json index 8b0082d..1f5e67a 100644 --- a/examples/RNOneSignalExpoExample/package.json +++ b/examples/RNOneSignalExpoExample/package.json @@ -1,6 +1,6 @@ { "name": "my-app", - "version": "1.0.0", + "version": "1.0.1", "scripts": { "start": "expo start --dev-client", "android": "expo run:android", @@ -9,22 +9,21 @@ "eject": "expo eject" }, "dependencies": { - "expo": "~45.0.0", - "expo-constants": "^13.1.1", - "expo-dev-client": "~0.9.5", - "expo-splash-screen": "~0.15.1", - "expo-status-bar": "~1.3.0", - "onesignal-expo-plugin": "^1.3.2", - "react": "17.0.2", - "react-dom": "17.0.2", - "react-native": "0.68.2", - "react-native-onesignal": "^4.4.1", - "react-native-web": "0.17.7" + "expo": "~49.0.15", + "expo-constants": "^14.4.2", + "expo-dev-client": "~2.4.12", + "expo-splash-screen": "~0.26.1", + "expo-status-bar": "~1.11.1", + "onesignal-expo-plugin": "^2.0.2", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-native": "0.72.6", + "react-native-onesignal": "^5.0.4", + "react-native-web": "0.19.6" }, "devDependencies": { - "@babel/core": "^7.12.9", - "@types/react": "~17.0.21", - "@types/react-native": "~0.66.13", + "@babel/core": "^7.20.0", + "@types/react": "~18.2.21", "typescript": "~4.3.5" }, "private": true diff --git a/examples/RNOneSignalExpoExample/tsconfig.json b/examples/RNOneSignalExpoExample/tsconfig.json index b9567f6..7886cc1 100644 --- a/examples/RNOneSignalExpoExample/tsconfig.json +++ b/examples/RNOneSignalExpoExample/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "expo/tsconfig.base", "compilerOptions": { + "jsx": "react", "strict": true } }