-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
52 lines (49 loc) · 1.48 KB
/
App.js
File metadata and controls
52 lines (49 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React, {useEffect} from 'react';
// import type {Node} from 'react';
import {StatusBar, PermissionsAndroid, Platform} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import Homescreen from './src/screens/Homescreen';
import AmbulanceScreen from './src/screens/AmbulanceScreen';
import LoadingPage from './src/screens/LoadingPage';
import RouteMap from './src/components/RouteMap';
const App: () => React$Node = () => {
// Permission Access
const androidPermission = async () => {
// Amplify.configure(awsconfig);
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
{
title: 'Parvah App Camera Permission',
message: 'Parvah App needs access to your location ',
buttonNeutral: 'Ask Me Later',
buttonNegative: 'Cancel',
buttonPositive: 'OK',
},
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log('You can use the location');
} else {
console.log('location permission denied');
}
} catch (err) {
console.warn(err);
}
};
useEffect(() => {
// Good!
if (Platform.os === 'android') {
androidPermission();
} else {
//
} // Side-effect
}, []);
return (
<>
<StatusBar barStyle="dark-content" />
{/* <Icon name="rocket" size={30} color="#900" /> */}
<LoadingPage />
</>
);
};
export default HomeMap;