Skip to content

Commit ca3ce44

Browse files
committed
initial full project commit
1 parent 4f18e49 commit ca3ce44

File tree

18,392 files changed

+3185084
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

18,392 files changed

+3185084
-2
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ npm-debug.*
99
*.orig.*
1010
web-build/
1111
*.hprof
12-
android/app/build/
1312
# macOS
1413
.DS_Store
14+
# android
15+
android/app/debug.keystore
1516
android/.idea/*
16-
android/.gradle/*
17+
android/.gradle/*
18+
android/app/build/

App.tsx

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { StatusBar } from 'expo-status-bar';
2+
import React from 'react';
3+
import Constants from 'expo-constants';
4+
import * as Notifications from 'expo-notifications';
5+
import { SafeAreaProvider } from 'react-native-safe-area-context';
6+
// Enable for firebase
7+
// import messaging from '@react-native-firebase/messaging';
8+
9+
import useCachedResources from './hooks/useCachedResources';
10+
import useColorScheme from './hooks/useColorScheme';
11+
import Navigation from './navigation';
12+
13+
Notifications.setNotificationHandler({
14+
handleNotification: async () => ({
15+
shouldShowAlert: true,
16+
shouldPlaySound: false,
17+
shouldSetBadge: false,
18+
}),
19+
});
20+
21+
class AppSetup extends React.Component {
22+
state = {
23+
colorScheme: this.props.colorScheme
24+
};
25+
26+
async componentDidMount() {
27+
// enable for firebase
28+
// await requestUserPermission();
29+
}
30+
31+
render() {
32+
const colorScheme = this.state.colorScheme;
33+
return (
34+
<SafeAreaProvider>
35+
<Navigation colorScheme={colorScheme} />
36+
<StatusBar />
37+
</SafeAreaProvider>
38+
);
39+
}
40+
}
41+
export default function App() {
42+
const isLoadingComplete = useCachedResources();
43+
const colorScheme = useColorScheme();
44+
if (!isLoadingComplete) {
45+
return null;
46+
} else {
47+
return (
48+
<AppSetup colorScheme={colorScheme} />
49+
);
50+
}
51+
}
52+
53+
// enable for firebase
54+
// async function requestUserPermission() {
55+
// const authStatus = await messaging().requestPermission();
56+
// const enabled =
57+
// authStatus === messaging.AuthorizationStatus.AUTHORIZED ||
58+
// authStatus === messaging.AuthorizationStatus.PROVISIONAL;
59+
60+
// if (enabled) {
61+
// getFcmToken();
62+
// }
63+
// }
64+
65+
66+
// async function getFcmToken() {
67+
// const fcmToken = await messaging().getToken();
68+
// if (fcmToken) {
69+
// console.log(fcmToken);
70+
// console.log("Your Firebase Token is:", fcmToken);
71+
// } else {
72+
// console.log("Failed", "No token received");
73+
// }
74+
// }

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Farhan Kathawala
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
# React Native Webview Template With Menu
3+
4+
This template is to provide a boiler plate in making an application for both iOS and Android utilizing a navigation and displaying webviews per page.
5+
6+
Uses: React Native 0.63, React Navigation 5.0, Typescript
7+
8+
This project utilized Expo v39 resources and was ejected. It includes a lot of resources such as location and notification handles autolinked into the project.
9+
10+
Sets up for you: menu title, drawer navigation, tests (with jest), hooks, deep linking, custom font support, splash screen, dark/light mode support.
11+
12+
# Preview
13+
14+
<img src="preview/ios-home.png" alt="ios home" width="250"/>
15+
<img src="preview/ios-nav.png" alt="ios nav" width="250"/>
16+
<img src="preview/android-home.png" alt="android home" width="250"/>
17+
<img src="preview/android-nav.png" alt="android nav" width="250"/>
18+
19+
20+
# Installation
21+
22+
We recommend using `react-native-rename` to rename your project to what you'd like. Afterwhich, go through the proper procedure for both iOS and Android to change your resource names.
23+
24+
Simply run a `npm install` on first go around and then for iOS run `pod install` under the `ios` directory. After, you should be able to run `react-native run ios` or `android` to start up the app right away!
25+
26+
This README expects you already know how to setup and use `react-native`.
27+
28+
## Android
29+
30+
I did attempt to remove `expo-location` as if you attempt to deploy to the android play store, it will complain you are request location services and see to provide details as to why. Though, the app does not use location, the fact it was present in the binary, you wouldn't be able to deploy your app if you were not needing location services. With this in mind, you'll want to re-add `expo-location` or a similiar location service plugin or use your own. Since this project was a eject of `expo` it included a lot of handy auto-linked modules.
31+
32+
# License
33+
34+
[MIT License](https://opensource.org/licenses/MIT)

android/app/BUCK

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# To learn about Buck see [Docs](https://buckbuild.com/).
2+
# To run your application with Buck:
3+
# - install Buck
4+
# - `npm start` - to start the packager
5+
# - `cd android`
6+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8+
# - `buck install -r android/app` - compile, install and run application
9+
#
10+
11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
13+
lib_deps = []
14+
15+
create_aar_targets(glob(["libs/*.aar"]))
16+
17+
create_jar_targets(glob(["libs/*.jar"]))
18+
19+
android_library(
20+
name = "all-libs",
21+
exported_deps = lib_deps,
22+
)
23+
24+
android_library(
25+
name = "app-code",
26+
srcs = glob([
27+
"src/main/java/**/*.java",
28+
]),
29+
deps = [
30+
":all-libs",
31+
":build_config",
32+
":res",
33+
],
34+
)
35+
36+
android_build_config(
37+
name = "build_config",
38+
package = "com.exampleapp",
39+
)
40+
41+
android_resource(
42+
name = "res",
43+
package = "com.exampleapp",
44+
res = "src/main/res",
45+
)
46+
47+
android_binary(
48+
name = "app",
49+
keystore = "//android/keystores:debug",
50+
manifest = "src/main/AndroidManifest.xml",
51+
package_type = "debug",
52+
deps = [
53+
":app-code",
54+
],
55+
)

0 commit comments

Comments
 (0)