Skip to content

Commit

Permalink
changed project name to memorii-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Propo41 committed Apr 5, 2024
1 parent 40f2d2c commit ac432b3
Show file tree
Hide file tree
Showing 69 changed files with 1,862 additions and 80 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,4 @@ web-build/
dist/

# firebase
google-services.json
src/config/conf.ts
google-services.json
14 changes: 10 additions & 4 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AppNavigator } from './src/navigation';
import { palette, typography } from './src/theme';
import { NavRoutes } from './src/config/routes';
import { GoogleSignin } from '@react-native-google-signin/google-signin';
import { FIREBASE_WEB_CLIENT_ID } from './src/config/conf';
import CustomToast from './src/components/CustomToast';
import { FirebaseApp } from './src/models/FirebaseApp';
import { Cache } from './src/models/Cache';
Expand Down Expand Up @@ -38,9 +37,16 @@ export default function App() {
const [appInfo, setAppInfo] = useState<_AppInfo>();

useEffect(() => {
GoogleSignin.configure({
webClientId: FIREBASE_WEB_CLIENT_ID,
});
const googleServices = require('./google-services.json');
// Note: Before triggering a sign-in request, you must initialize the Google SDK using your any required scopes
// and the webClientId, which can be found in the `android/app/google-services.json` file as the `client/oauth_client/client_id` property.
// Make sure to pick the client_id with `client_type: 3`
const oAuthClient = googleServices.client[0].oauth_client.find((client: any) => client.client_type === 3);
if (oAuthClient) {
GoogleSignin.configure({
webClientId: oAuthClient.client_id,
});
}
}, []);

useEffect(() => {
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,33 @@ npx expo run:android # run the app in an emulator

#### Building the apk:

The apk should be created through the expo cli. For that, you must have an Expo account. Then go to: https://expo.dev/accounts/minkstudios/projects, and create a new project with the name `memorii-sync`.

By default, the `google-services.json` file is added to gitignore. So, it won't be uploaded to expo when you start the build process. There are 2 ways this can be avoided:

1. Adding it as a secret. Check: https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and-use-it-in-my-app-config
2. Removing the `google-services.json` from gitignore. This is the simplest way.

```bash
npm install -g eas-cli
eas login

eas init --id <id> # you can find the id in the expo dashboard after creating a new project
eas build -p android --profile preview
```

#### Generating SHA-1
The SHA-1 needs to be placed both in the expo project and the firebase project

```bash
cd android
./gradlew signingReport
```
For the google sign-in to work properly, you must copy the SHA-1 value from your expo project to your firebase project. You can find the expo project's SHA-1 under `Project Settings > Credentials`

#### Important eas commands
```bash
eas whoami
eas configure
eas login

eas init --id <eas-project-id> # resets the id

Expand Down
21 changes: 21 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# OSX
#
.DS_Store

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# Bundle artifacts
*.jsbundle
55 changes: 55 additions & 0 deletions android/app/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#

load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")

lib_deps = []

create_aar_targets(glob(["libs/*.aar"]))

create_jar_targets(glob(["libs/*.jar"]))

android_library(
name = "all-libs",
exported_deps = lib_deps,
)

android_library(
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)

android_build_config(
name = "build_config",
package = "com.minkstudios.memoriisync",
)

android_resource(
name = "res",
package = "com.minkstudios.memoriisync",
res = "src/main/res",
)

android_binary(
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)
Loading

0 comments on commit ac432b3

Please sign in to comment.