Skip to content

Commit

Permalink
feat: firebase notifications and launchdarkly
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarkhanzadian committed Feb 13, 2025
1 parent aefd3e5 commit aeec844
Show file tree
Hide file tree
Showing 45 changed files with 4,255 additions and 762 deletions.
6 changes: 6 additions & 0 deletions .github/actions/provision/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ runs:
registry-url: 'https://registry.npmjs.org/'
cache: 'pnpm'

- name: Add env variable files
run: |
echo "$GOOGLE_SERVICES_JSON_B64" | base64 --decode > apps/mobile/android/app/google-services.json
echo "$GOOGLE_SERVICE_INFO_PLIST_B64" | base64 --decode > apps/mobile/ios/leatherwalletmobile/GoogleService-Info.plist
shell: bash

- name: Install dependencies
run: pnpm install
shell: bash
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ leather-styles
**/.env
coverage
architecture/*.svg
GoogleService-Info.plist
google-services.json
1 change: 1 addition & 0 deletions apps/mobile/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export EXPO_PUBLIC_LAUNCH_DARKLY=""
10 changes: 10 additions & 0 deletions apps/mobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ Running on Android device
- Install [Expo app from Google Play](https://play.google.com/store/apps/details?id=host.exp.exponent&pli=1) on your device.
- Scan the QR code that is going to be shown in the terminal after running the expo server in the next section

#### Credentials

1. When running `pnpm run ios` or `pnpm run android`, you are going to be prompted for the firebase login.
That is essential for building the app and it is needed for firebase push notifications
2. You would also need to have .env setup.
You can either do it yourself using .env.example file or you can use 1password cli to download it from the vault.
To do that you would need to run `pnpm run 1password:env:dev` to install the .env file.

To make sure you have 1password cli installed and signed in on your machine, follow these instructions: https://developer.1password.com/docs/cli/get-started

### Running the application

- `pnpm run start` if you want to test the app on your personal Android or iOS device
Expand Down
2 changes: 2 additions & 0 deletions apps/mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,5 @@ dependencies {

apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
applyNativeModulesAppBuildGradle(project)

apply plugin: 'com.google.gms.google-services'
2 changes: 1 addition & 1 deletion apps/mobile/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
Expand Down
1 change: 1 addition & 0 deletions apps/mobile/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath('com.android.tools.build:gradle')
classpath('com.facebook.react:react-native-gradle-plugin')
Expand Down
20 changes: 13 additions & 7 deletions apps/mobile/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"assetBundlePatterns": ["**/*"],
"ios": {
"googleServicesFile": "./GoogleService-Info.plist",
"entitlements": {
"aps-environment": "production"
},
"infoPlist": {
"UIBackgroundModes": ["remote-notification", "fetch"]
},
"bundleIdentifier": "io.leather.mobilewallet",
"supportsTablet": false,
"splash": {
Expand All @@ -28,6 +33,7 @@
}
},
"android": {
"googleServicesFile": "./google-services.json",
"icon": "./src/assets/icon.png",
"adaptiveIcon": {
"foregroundImage": "./src/assets/adaptive-icon.png",
Expand Down Expand Up @@ -64,17 +70,17 @@
[
"expo-asset",
{
"assets": [
"src/scripts/injected-provider.js"
]
"assets": ["src/scripts/injected-provider.js"]
}
],
[
"expo-dev-client",
{
"launchMode": "most-recent"
}
]
],
"@react-native-firebase/app",
"@react-native-firebase/messaging"
],
"extra": {
"router": {
Expand Down
4 changes: 4 additions & 0 deletions apps/mobile/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ target 'leatherwalletmobile' do
use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']

pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
Expand Down
Loading

0 comments on commit aeec844

Please sign in to comment.