Merge pull request #1 from EmmanuelMinistriesInternational/expo47
Expo47
This commit is contained in:
39
App.js
39
App.js
@@ -2,7 +2,6 @@ import { StatusBar } from 'expo-status-bar';
|
||||
import React, { useState, useRef, useEffect } from 'react';
|
||||
import { NavigationContainer } from '@react-navigation/native';
|
||||
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
||||
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
|
||||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
||||
import { Provider as PaperProvider, DefaultTheme, } from 'react-native-paper';
|
||||
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
||||
@@ -33,14 +32,27 @@ const theme = {
|
||||
};
|
||||
|
||||
Notifications.setNotificationHandler({
|
||||
handleNotification: async () => ({
|
||||
shouldShowAlert: true,
|
||||
shouldPlaySound: false,
|
||||
shouldSetBadge: false,
|
||||
}),
|
||||
handleNotification: async () => {
|
||||
//console.log("notif background");
|
||||
return {
|
||||
shouldShowAlert: true,
|
||||
shouldPlaySound: true,
|
||||
shouldSetBadge: true,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
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;
|
||||
if (Device.isDevice) {
|
||||
const { status: existingStatus } = await Notifications.getPermissionsAsync();
|
||||
@@ -53,21 +65,10 @@ async function registerForPushNotificationsAsync() {
|
||||
alert('Failed to get push token for push notification!');
|
||||
return;
|
||||
}
|
||||
token = (await Notifications.getExpoPushTokenAsync()).data;
|
||||
console.log(token);
|
||||
token = (await Notifications.getExpoPushTokenAsync({ projectId: "c2bb4d4e-4d4d-4f34-a873-7cad78c6023c", })).data;
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -89,11 +90,13 @@ const MainNavigation = () => {
|
||||
|
||||
// This listener is fired whenever a notification is received while the app is foregrounded
|
||||
notificationListener.current = Notifications.addNotificationReceivedListener(notification => {
|
||||
//console.log("got notif", 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)
|
||||
responseListener.current = Notifications.addNotificationResponseReceivedListener(response => {
|
||||
//console.log("got notif click", notification)
|
||||
console.log(response);
|
||||
});
|
||||
|
||||
|
||||
17
app.json
17
app.json
@@ -22,13 +22,24 @@
|
||||
},
|
||||
"android": {
|
||||
"adaptiveIcon": {
|
||||
"foregroundImage": "./assets/adaptive-icon.png",
|
||||
"foregroundImage": "./assets/icon.png",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
},
|
||||
"package": "com.emi.social"
|
||||
"package": "com.emi.social",
|
||||
"googleServicesFile": "./google-services.json"
|
||||
},
|
||||
"web": {
|
||||
"favicon": "./assets/favicon.png"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"eas": {
|
||||
"projectId": "c2bb4d4e-4d4d-4f34-a873-7cad78c6023c"
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
[
|
||||
"expo-notifications"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
18
eas.json
Normal file
18
eas.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"cli": {
|
||||
"version": ">= 2.9.0"
|
||||
},
|
||||
"build": {
|
||||
"development": {
|
||||
"developmentClient": true,
|
||||
"distribution": "internal"
|
||||
},
|
||||
"preview": {
|
||||
"distribution": "internal"
|
||||
},
|
||||
"production": {}
|
||||
},
|
||||
"submit": {
|
||||
"production": {}
|
||||
}
|
||||
}
|
||||
39
google-services.json
Normal file
39
google-services.json
Normal file
@@ -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"
|
||||
}
|
||||
3098
package-lock.json
generated
3098
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
35
package.json
35
package.json
@@ -11,34 +11,35 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@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/material-bottom-tabs": "^6.1.1",
|
||||
"@react-navigation/native": "^6.0.8",
|
||||
"@react-navigation/native-stack": "^6.5.0",
|
||||
"expo": "^46.0.0",
|
||||
"expo-av": "~12.0.4",
|
||||
"expo-device": "~4.3.0",
|
||||
"expo-notifications": "~0.16.1",
|
||||
"expo-status-bar": "~1.4.0",
|
||||
"expo-updates": "~0.14.7",
|
||||
"assert": "^2.0.0",
|
||||
"expo": "^47.0.8",
|
||||
"expo-av": "~13.0.2",
|
||||
"expo-dev-client": "~2.0.1",
|
||||
"expo-device": "~5.0.0",
|
||||
"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",
|
||||
"react": "18.0.0",
|
||||
"react-dom": "18.0.0",
|
||||
"react-google-material-icons": "^1.0.4",
|
||||
"react-native": "0.69.6",
|
||||
"react": "18.1.0",
|
||||
"react-dom": "18.1.0",
|
||||
"react-native": "0.70.5",
|
||||
"react-native-autoheight-webview": "^1.6.1",
|
||||
"react-native-hyperlink": "0.0.19",
|
||||
"react-native-paper": "^4.11.2",
|
||||
"react-native-safe-area-context": "4.3.1",
|
||||
"react-native-screens": "~3.15.0",
|
||||
"react-native-safe-area-context": "4.4.1",
|
||||
"react-native-screens": "~3.18.0",
|
||||
"react-native-vector-icons": "^9.1.0",
|
||||
"react-native-web": "~0.18.7",
|
||||
"react-native-webview": "11.23.0",
|
||||
"valtio": "^1.4.0",
|
||||
"expo-image-picker": "~13.3.1"
|
||||
"react-native-webview": "11.23.1",
|
||||
"valtio": "^1.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.18.6"
|
||||
"@babel/core": "^7.19.3"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user