Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: appcheck ios #1369

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 { 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 styles = useStyles();
const debugRef = useRef();

useEffect(() => {
setupAppAttest();
}, []);
technoplato marked this conversation as resolved.
Show resolved Hide resolved

useCoinbaseWalletListener(true, coinbaseUrl);

useEffect(() => {
Expand All @@ -72,10 +77,10 @@
}, []);

const showDebugMenu = useCallback(() => {
if (!debugRef.current || !(debugRef.current as any).showDebugMenu) {

Check warning on line 80 in App.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
return;
}
(debugRef.current as any).showDebugMenu();

Check warning on line 83 in App.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
}, []);

useEffect(() => {
Expand Down Expand Up @@ -119,7 +124,7 @@
const AppKeyboardProvider =
Platform.OS === "ios" ? KeyboardProvider : React.Fragment;

export default function AppWithProviders() {

Check warning on line 127 in App.tsx

View workflow job for this annotation

GitHub Actions / lint

Prefer named exports
const colorScheme = useColorScheme();

const paperTheme = useMemo(() => {
Expand All @@ -137,7 +142,7 @@
<ActionSheetProvider>
<ThemeProvider value={{ themeScheme, setThemeContextOverride }}>
<PaperProvider theme={paperTheme}>
<GestureHandlerRootView style={{ flex: 1 }}>

Check warning on line 145 in App.tsx

View workflow job for this annotation

GitHub Actions / lint

Inline style: { flex: 1 }
<BottomSheetModalProvider>
<PortalProvider>
<App />
Expand Down
21 changes: 15 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,9 @@ 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.
5 changes: 5 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@

import appBuildNumbers from "./app.json";

const env = process.env as any;

Check warning on line 6 in app.config.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
const isDev = env.EXPO_ENV === "dev";

warnOnce(
isDev && !(process.env as any).EXPO_PUBLIC_DEV_API_URI,

Check warning on line 10 in app.config.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
"\n\n🚧 Running the app without EXPO_PUBLIC_DEV_API_URI setup\n\n"
);

const isPreview = env.EXPO_ENV === "preview";
const isProduction = !isDev && !isPreview;

export default ({ config }: ConfigContext): ExpoConfig => ({

Check warning on line 17 in app.config.ts

View workflow job for this annotation

GitHub Actions / lint

Prefer named exports
...config,
name: isDev ? "Converse DEV" : isPreview ? "Converse PREVIEW" : "Converse",
scheme: isDev ? "converse-dev" : isPreview ? "converse-preview" : "converse",
Expand All @@ -33,19 +33,24 @@
},
version: appBuildNumbers.expo.version,
assetBundlePatterns: ["**/*"],
plugins: ["@react-native-firebase/app-check"],
ios: {
supportsTablet: true,
buildNumber: appBuildNumbers.expo.ios.buildNumber,
bundleIdentifier: "com.converse.dev",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Hardcoded development bundle identifier may cause issues in production

The bundle identifier is hardcoded to "com.converse.dev" for both iOS and Android. This should be environment-specific to support different builds.

Consider using environment variables or the existing environment checks:

- bundleIdentifier: "com.converse.dev",
+ bundleIdentifier: isDev ? "com.converse.dev" : isPreview ? "com.converse.preview" : "com.converse",

Similar change needed for Android package name.

Also applies to: 46-46

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
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DependencyFlavor, DependencyFlavors } from "./flavors.type";

export function determineDependencyFlavor(): DependencyFlavor {
// @ts-ignore
if (typeof jest !== "undefined" || process.env.JEST_WORKER_ID !== undefined) {
return DependencyFlavors.jest;
}
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,14 +2,14 @@ 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";
import { navigate } from "../../../utils/navigation";
import { getPreferredInboxAvatar } from "../../../utils/profile";
import { usePreferredInboxAddress } from "@/hooks/usePreferredInboxAddress";
import { usePreferredInboxName } from "@/hooks/usePreferredInboxName";
import { useInboxProfileSocialsQuery } from "@/queries/useInboxProfileSocialsQuery";

type MessageSenderAvatarDumbProps = {
// hasNextMessageInSeries: boolean;
Expand Down
Loading
Loading