fix(mobile): address code review findings in mobile app config and tests
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
+8
-3
@@ -43,7 +43,7 @@ npm install -g eas-cli
|
|||||||
# Log in to Expo
|
# Log in to Expo
|
||||||
eas login
|
eas login
|
||||||
|
|
||||||
# Configure your project (one-time)
|
# Configure your project (one-time) – updates app.json with the EAS project ID
|
||||||
eas init
|
eas init
|
||||||
|
|
||||||
# Build for iOS
|
# Build for iOS
|
||||||
@@ -56,16 +56,21 @@ eas build --platform android
|
|||||||
eas build --platform all
|
eas build --platform all
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> **After running `eas init`:** update the `extra.eas.projectId` field in `app.json` with the value printed by the command.
|
||||||
|
|
||||||
### iOS-specific
|
### iOS-specific
|
||||||
|
|
||||||
- An Apple Developer account is required for TestFlight and App Store distribution
|
- An Apple Developer account is required for TestFlight and App Store distribution
|
||||||
- Update `eas.json` with your `appleId`, `ascAppId`, and `appleTeamId`
|
- Update `eas.json` → `submit.production.ios` with:
|
||||||
|
- `appleId`: your Apple ID email address
|
||||||
|
- `ascAppId`: App Store Connect → App Information → Apple ID
|
||||||
|
- `appleTeamId`: Apple Developer portal → Membership → Team ID
|
||||||
- Camera, photo library, and push notification usage descriptions are configured in `app.json`
|
- Camera, photo library, and push notification usage descriptions are configured in `app.json`
|
||||||
|
|
||||||
### Android-specific
|
### Android-specific
|
||||||
|
|
||||||
- Add a `google-services.json` file (from Firebase Console) to the `mobile/` directory for push notification support
|
- Add a `google-services.json` file (from Firebase Console) to the `mobile/` directory for push notification support
|
||||||
- Update `eas.json` with the path to your Google Play service account key
|
- For Play Store submission: create a service account in Google Play Console, download the JSON key as `google-play-service-account.json`, and update `eas.json`
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,5 @@ module.exports = function (api) {
|
|||||||
api.cache(true);
|
api.cache(true);
|
||||||
return {
|
return {
|
||||||
presets: ["babel-preset-expo"],
|
presets: ["babel-preset-expo"],
|
||||||
plugins: [
|
|
||||||
[
|
|
||||||
"module-resolver",
|
|
||||||
{
|
|
||||||
root: ["./"],
|
|
||||||
alias: {
|
|
||||||
"@": "./src",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"react-native-reanimated/plugin",
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"lib": ["ESNext", "dom"],
|
"lib": ["ESNext"],
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "node",
|
||||||
"allowImportingTsExtensions": true,
|
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|||||||
@@ -494,6 +494,7 @@ class TestPushNotificationUtility:
|
|||||||
with patch("app.utils.push_notification.send_expo_push_notification") as mock_send:
|
with patch("app.utils.push_notification.send_expo_push_notification") as mock_send:
|
||||||
send_push_to_owner("user@example.com", "Title", "Body")
|
send_push_to_owner("user@example.com", "Title", "Body")
|
||||||
mock_send.assert_not_called()
|
mock_send.assert_not_called()
|
||||||
|
mock_session.close.assert_called_once()
|
||||||
|
|
||||||
def test_send_push_to_owner_with_devices(self):
|
def test_send_push_to_owner_with_devices(self):
|
||||||
"""send_push_to_owner calls send_expo_push_notification with device tokens."""
|
"""send_push_to_owner calls send_expo_push_notification with device tokens."""
|
||||||
|
|||||||
Reference in New Issue
Block a user