Skip to content

Commit

Permalink
Merge branch 'kc/33-add-firebase-appcheck' into test5
Browse files Browse the repository at this point in the history
  • Loading branch information
technoplato committed Dec 17, 2024
2 parents 4c6b666 + fa8b6f5 commit 298a9a0
Show file tree
Hide file tree
Showing 28 changed files with 1,467 additions and 322 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,16 @@ ios/Converse.xcworkspace/xcshareddata/swiftpm/Package.resolved

# Reassure output directory
.reassure

# Firebase Config files
# Advice from Firebase founding engineer: https://stackoverflow.com/a/44937513/2441420
# TLDR: safe to commit publicly, but recommended to gitignore
ios/GoogleService-Info.plist
ios/GoogleService-Info-preview.plist
ios/GoogleService-Info-dev.plist

android/google-services.json
android/google-services-preview.json
android/google-services-dev.json
ios/Google Services/GoogleService-Info-prod.plist
ios/Google Services/GoogleService-Info.plist
5 changes: 5 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { privySecureStorage } from "./utils/keychain/helpers";
import { initSentry } from "./utils/sentry";
import "./utils/splash/splash";
import "./features/notifications/utils";
import { setupAppAttest } from "@utils/appCheck";

LogBox.ignoreLogs([
"Privy: Expected status code 200, received 400", // Privy
Expand All @@ -65,6 +66,10 @@ const App = () => {
const styles = useStyles();
const debugRef = useRef();

useEffect(() => {
setupAppAttest();
}, []);

useCoinbaseWalletListener(true, coinbaseUrl);

useEffect(() => {
Expand Down
40 changes: 34 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ Until then Converse web will only show 1 to 1 conversations and the majority of
Web support is an end goal and the team is happy to fix any issues that are reported

### Install JS/React Native Dependencies

```
yarn
```

### Building the Web App

```
yarn start
```
Expand All @@ -72,13 +74,15 @@ yarn start
```

# Linting

```
yarn lint
```

# Testing

## Running Jest tests

Before running the tests make sure that you have a `.env` file setup with the variables variable set

```sh
Expand All @@ -88,13 +92,15 @@ yarn test
## Running Performance Tests

Capture baselines for performance tests

```sh
yarn test:perf:baseline
```

Make changes to the code to see the performance impact

Run the performance tests again to see the changes

```sh
yarn test:perf
```
Expand All @@ -103,22 +109,22 @@ yarn test:perf

Frames are expected to follow the Open Frames Standard https://github.com/open-frames/standard



# Release Processes

### Main Branch

Represents the current production code.

### Release Branches

Each release branch is based off of `main` or the release branch before it. It is used to prepare and stabilize the code for a specific release version (e.g., `release/2.0.8`).

### Feature Branches

Feature branches are longer-lived features or refactors expected to take additional time. They should be based off of the targeted feature release branch.

This structure allows code to flow **from `main` to release branches to feature branches**.


![Merge Diagram](docs/image.png)

---
Expand All @@ -128,6 +134,7 @@ This structure allows code to flow **from `main` to release branches to feature
Assuming your branch is `feature/scw`, and your feature is targeted for release `2.1.0`, follow these steps to rebase:

1. First, checkout the feature branch:

```bash
git fetch origin
git branch feature/scw -D
Expand All @@ -141,7 +148,28 @@ Assuming your branch is `feature/scw`, and your feature is targeted for release
```

### Exceptions

There are certain times where this flow does not work as intended. For example:
* Build scripts: These may need to be run off of the default main branch instead of feature or release branches.
* Read me updates: These are not required to be on a branch and can be committed directly to main.
* Bug fixes that can be OTA updated: These can be committed directly to main to perform an OTA update.

- Build scripts: These may need to be run off of the default main branch instead of feature or release branches.
- Read me updates: These are not required to be on a branch and can be committed directly to main.
- Bug fixes that can be OTA updated: These can be committed directly to main to perform an OTA update.

## Firebase Configuration

Firebase config files are not stored in git for security. New team members need to:

1. Obtain the Firebase config files from the private repository at https://github.com/ephemeraHQ/converse-app-env
2. Copy them into the correct locations:

iOS:

- ios/Google Services/GoogleService-Info.plist (prod)
- ios/Google Service-Info-preview.plist (preview)
- ios/Google Service-Info-prod.plist (dev)

Android:

TODO

These files are required for building the app but are kept secure outside of version control.
9 changes: 9 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,28 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
},
version: appBuildNumbers.expo.version,
assetBundlePatterns: ["**/*"],
plugins: [
"@react-native-firebase/app-check",
// https://github.com/invertase/react-native-firebase/issues/6332#issuecomment-1172950523
// ["expo-build-properties", { ios: { useFrameworks: "static" } }],
],
ios: {
supportsTablet: true,
buildNumber: appBuildNumbers.expo.ios.buildNumber,
bundleIdentifier: "com.converse.dev",
config: {
usesNonExemptEncryption: false,
},
},
android: {
package: "com.converse.dev",
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon.png",
backgroundColor: "#FFFFFF",
},
versionCode: appBuildNumbers.expo.android.versionCode,
// TODO(lustig): dynamically set this based on env in Android PR for AppCheck
googleServicesFile: "./android/google-services.json",
},
web: {
favicon: "./assets/favicon.png",
Expand Down
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"expo": {
"version": "2.1.0",
"ios": {
"buildNumber": "40"
"buildNumber": "41"
},
"android": {
"versionCode": 239
"versionCode": 240
}
}
}
7 changes: 6 additions & 1 deletion config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ const ENV = {
),
alphaGroupChatUrl:
"https://converse.xyz/group-invite/UDv3aYZONQGc6_XPJY6Ch",
appCheckDebugToken: isAndroid
? undefined
: process.env.EXPO_PUBLIC_FIREBASE_APP_CHECK_DEBUG_TOKEN_IOS,
},
preview: {
...defaultConfig,
Expand All @@ -88,6 +91,7 @@ const ENV = {
].flatMap((domain) => [`https://${domain}`, `http://${domain}`, domain]),
alphaGroupChatUrl:
"https://converse.xyz/group-invite/eQAvo-WvwrdBTsHINuSMJ",
appCheckDebugToken: undefined,
},
prod: {
...defaultConfig,
Expand Down Expand Up @@ -121,10 +125,11 @@ const ENV = {
},
alphaGroupChatUrl:
"https://converse.xyz/group-invite/eQAvo-WvwrdBTsHINuSMJ",
appCheckDebugToken: undefined,
},
} as const;

const getConfig = () => {
export const getConfig = () => {
if (__DEV__) {
return ENV.dev;
} else if (Constants.expoConfig?.extra?.ENV === "preview") {
Expand Down
3 changes: 0 additions & 3 deletions eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"developmentClient": true,
"distribution": "internal",
"channel": "development",
"env": {
"EXPO_ENV": "dev"
},
"node": "20.15.1",
"ios": {
"cocoapods": "1.14.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import Avatar from "@components/Avatar";
import { useCallback, useMemo } from "react";
import { StyleSheet, TouchableOpacity, View } from "react-native";

import { usePreferredInboxAddress } from "@hooks/usePreferredInboxAddress";
import { usePreferredInboxName } from "@hooks/usePreferredInboxName";
import { useInboxProfileSocialsQuery } from "@queries/useInboxProfileSocialsQuery";
import { useAppTheme } from "@theme/useAppTheme";
import { InboxId } from "@xmtp/react-native-sdk";
import { useCurrentAccount } from "../../../data/store/accountsStore";
Expand Down
Loading

0 comments on commit 298a9a0

Please sign in to comment.