Merge pull request #1 from EmmanuelMinistriesInternational/expo47
Expo47
This commit is contained in:
@@ -2,7 +2,6 @@ import { StatusBar } from 'expo-status-bar';
|
|||||||
import React, { useState, useRef, useEffect } from 'react';
|
import React, { useState, useRef, useEffect } from 'react';
|
||||||
import { NavigationContainer } from '@react-navigation/native';
|
import { NavigationContainer } from '@react-navigation/native';
|
||||||
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
||||||
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
|
|
||||||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
||||||
import { Provider as PaperProvider, DefaultTheme, } from 'react-native-paper';
|
import { Provider as PaperProvider, DefaultTheme, } from 'react-native-paper';
|
||||||
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
||||||
@@ -33,14 +32,27 @@ const theme = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Notifications.setNotificationHandler({
|
Notifications.setNotificationHandler({
|
||||||
handleNotification: async () => ({
|
handleNotification: async () => {
|
||||||
|
//console.log("notif background");
|
||||||
|
return {
|
||||||
shouldShowAlert: true,
|
shouldShowAlert: true,
|
||||||
shouldPlaySound: false,
|
shouldPlaySound: true,
|
||||||
shouldSetBadge: false,
|
shouldSetBadge: true,
|
||||||
}),
|
};
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
async function registerForPushNotificationsAsync() {
|
async function registerForPushNotificationsAsync() {
|
||||||
|
|
||||||
|
if (Platform.OS === 'android') {
|
||||||
|
Notifications.setNotificationChannelAsync('default', {
|
||||||
|
name: 'default',
|
||||||
|
importance: Notifications.AndroidImportance.MAX,
|
||||||
|
vibrationPattern: [0, 250, 250, 250],
|
||||||
|
lightColor: '#FF231F7C',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let token;
|
let token;
|
||||||
if (Device.isDevice) {
|
if (Device.isDevice) {
|
||||||
const { status: existingStatus } = await Notifications.getPermissionsAsync();
|
const { status: existingStatus } = await Notifications.getPermissionsAsync();
|
||||||
@@ -53,21 +65,10 @@ async function registerForPushNotificationsAsync() {
|
|||||||
alert('Failed to get push token for push notification!');
|
alert('Failed to get push token for push notification!');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
token = (await Notifications.getExpoPushTokenAsync()).data;
|
token = (await Notifications.getExpoPushTokenAsync({ projectId: "c2bb4d4e-4d4d-4f34-a873-7cad78c6023c", })).data;
|
||||||
console.log(token);
|
|
||||||
} else {
|
} else {
|
||||||
alert('Must use physical device for Push Notifications');
|
alert('Must use physical device for Push Notifications');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Platform.OS === 'android') {
|
|
||||||
Notifications.setNotificationChannelAsync('default', {
|
|
||||||
name: 'default',
|
|
||||||
importance: Notifications.AndroidImportance.MAX,
|
|
||||||
vibrationPattern: [0, 250, 250, 250],
|
|
||||||
lightColor: '#FF231F7C',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
console.log(token);
|
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,11 +90,13 @@ const MainNavigation = () => {
|
|||||||
|
|
||||||
// This listener is fired whenever a notification is received while the app is foregrounded
|
// This listener is fired whenever a notification is received while the app is foregrounded
|
||||||
notificationListener.current = Notifications.addNotificationReceivedListener(notification => {
|
notificationListener.current = Notifications.addNotificationReceivedListener(notification => {
|
||||||
|
//console.log("got notif", notification)
|
||||||
setNotification(notification);
|
setNotification(notification);
|
||||||
});
|
});
|
||||||
|
|
||||||
// This listener is fired whenever a user taps on or interacts with a notification (works when app is foregrounded, backgrounded, or killed)
|
// This listener is fired whenever a user taps on or interacts with a notification (works when app is foregrounded, backgrounded, or killed)
|
||||||
responseListener.current = Notifications.addNotificationResponseReceivedListener(response => {
|
responseListener.current = Notifications.addNotificationResponseReceivedListener(response => {
|
||||||
|
//console.log("got notif click", notification)
|
||||||
console.log(response);
|
console.log(response);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -22,13 +22,24 @@
|
|||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
"adaptiveIcon": {
|
"adaptiveIcon": {
|
||||||
"foregroundImage": "./assets/adaptive-icon.png",
|
"foregroundImage": "./assets/icon.png",
|
||||||
"backgroundColor": "#FFFFFF"
|
"backgroundColor": "#FFFFFF"
|
||||||
},
|
},
|
||||||
"package": "com.emi.social"
|
"package": "com.emi.social",
|
||||||
|
"googleServicesFile": "./google-services.json"
|
||||||
},
|
},
|
||||||
"web": {
|
"web": {
|
||||||
"favicon": "./assets/favicon.png"
|
"favicon": "./assets/favicon.png"
|
||||||
}
|
},
|
||||||
|
"extra": {
|
||||||
|
"eas": {
|
||||||
|
"projectId": "c2bb4d4e-4d4d-4f34-a873-7cad78c6023c"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
[
|
||||||
|
"expo-notifications"
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"cli": {
|
||||||
|
"version": ">= 2.9.0"
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"development": {
|
||||||
|
"developmentClient": true,
|
||||||
|
"distribution": "internal"
|
||||||
|
},
|
||||||
|
"preview": {
|
||||||
|
"distribution": "internal"
|
||||||
|
},
|
||||||
|
"production": {}
|
||||||
|
},
|
||||||
|
"submit": {
|
||||||
|
"production": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "587556762784",
|
||||||
|
"project_id": "emi-fellowship",
|
||||||
|
"storage_bucket": "emi-fellowship.appspot.com"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:587556762784:android:cada5e527a14e29ffec5c5",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.emi.social"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "587556762784-811ic14vvl67kbsins591ers2kgm77oo.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyA95FY2PNl2v7tH4o795dLO4lgmovKbuBc"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "587556762784-811ic14vvl67kbsins591ers2kgm77oo.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
Generated
+1517
-1599
File diff suppressed because it is too large
Load Diff
+18
-17
@@ -11,34 +11,35 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-native-async-storage/async-storage": "~1.17.3",
|
"@react-native-async-storage/async-storage": "~1.17.3",
|
||||||
|
"@react-native-firebase/app": "^16.4.6",
|
||||||
"@react-navigation/bottom-tabs": "^6.2.0",
|
"@react-navigation/bottom-tabs": "^6.2.0",
|
||||||
"@react-navigation/material-bottom-tabs": "^6.1.1",
|
|
||||||
"@react-navigation/native": "^6.0.8",
|
"@react-navigation/native": "^6.0.8",
|
||||||
"@react-navigation/native-stack": "^6.5.0",
|
"@react-navigation/native-stack": "^6.5.0",
|
||||||
"expo": "^46.0.0",
|
"assert": "^2.0.0",
|
||||||
"expo-av": "~12.0.4",
|
"expo": "^47.0.8",
|
||||||
"expo-device": "~4.3.0",
|
"expo-av": "~13.0.2",
|
||||||
"expo-notifications": "~0.16.1",
|
"expo-dev-client": "~2.0.1",
|
||||||
"expo-status-bar": "~1.4.0",
|
"expo-device": "~5.0.0",
|
||||||
"expo-updates": "~0.14.7",
|
"expo-image-picker": "~14.0.2",
|
||||||
|
"expo-notifications": "~0.17.0",
|
||||||
|
"expo-status-bar": "~1.4.2",
|
||||||
|
"expo-updates": "~0.15.6",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"react": "18.0.0",
|
"react": "18.1.0",
|
||||||
"react-dom": "18.0.0",
|
"react-dom": "18.1.0",
|
||||||
"react-google-material-icons": "^1.0.4",
|
"react-native": "0.70.5",
|
||||||
"react-native": "0.69.6",
|
|
||||||
"react-native-autoheight-webview": "^1.6.1",
|
"react-native-autoheight-webview": "^1.6.1",
|
||||||
"react-native-hyperlink": "0.0.19",
|
"react-native-hyperlink": "0.0.19",
|
||||||
"react-native-paper": "^4.11.2",
|
"react-native-paper": "^4.11.2",
|
||||||
"react-native-safe-area-context": "4.3.1",
|
"react-native-safe-area-context": "4.4.1",
|
||||||
"react-native-screens": "~3.15.0",
|
"react-native-screens": "~3.18.0",
|
||||||
"react-native-vector-icons": "^9.1.0",
|
"react-native-vector-icons": "^9.1.0",
|
||||||
"react-native-web": "~0.18.7",
|
"react-native-web": "~0.18.7",
|
||||||
"react-native-webview": "11.23.0",
|
"react-native-webview": "11.23.1",
|
||||||
"valtio": "^1.4.0",
|
"valtio": "^1.4.0"
|
||||||
"expo-image-picker": "~13.3.1"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.18.6"
|
"@babel/core": "^7.19.3"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user