This app is a mobile version of our page available at https://dsek.se. The app is "simply" a WebView wrapper around https://dsek.se. There are some extra features regarding deep-linking, notifications, dark/light mode and app-specific information which are added by the app.
The goal is, and probably should always be, to keep the app AS SIMPLE AS POSSIBLE. This way ALMOST ALL updates can be done purely by releasing a new version of the site and no changes needs to be done by the app.
To communicate events and data between the app and website native window events are used. For example, the event appSendPushNotification is dispatched containing the notification token from the app.
- Build with
npm run deploy:androidornpm run deploy:android:local(from package.json) - Wait for the build to complete
- Submit the app
- Make sure you have a google-service-account.json file, follow steps here if you dont: https://github.com/expo/fyi/blob/main/creating-google-service-account.md
- We already have a service account, just go to google cloud platform and save it in the root directory (should not be committed).
- Run
npm run submit:android
- Download the
.aabfile (it will be in the project root directory if built locally) - Go to Google Play Console
- Go to "Production" > "Create New Release"
- Upload the file and add relevant changelog notes
- Send to review and wait for it to finish
- Build with
npm run deploy:ios(from package.json) - Login with our apple account
- Wait for the build to complete
- Submit
- Run
npm run submit:ios - Login with our apple account
- Download the
.ipafile (it will be in the project root directory if built locally) - Use the "transporter" app (only available on MacOS) to upload the
.ipafile to App Store Connect. - On app store connect:
- Go to "My Apps"
- Go to "D-sektionen"
- Create a new version next to "iOS App"
- Go down to "Builds" and select the newest built version (might take some minutes to appear after upload)
- It will say "Missing Compliance", click "Manage" and answer the questions. As of writing the answers are "Standard encryption algorithms instead of, or in addition to, using or accessing the encryption within Apple's operating system" and "Not available in France"
- Under "What's new in this version" add some changelog notes
- Click "Save" and "Add to review", then "Send to review"
- Wait for review to complete. (It happens that we get rejected, usually just small fixes though)
Using the scripts (from package.json) that end in :local it is possible to build locally instead of building on Expo's servers. To set this up follow the guide on https://docs.expo.dev/get-started/set-up-your-environment/?mode=development-build&buildEnv=local&platform=android&device=physical except npx expo install expo-dev-client
The scripts npx expo run:android and npx expo run:ios (specifically expo prebuild) will generate an android/ or ios/ directory. This will cause eas build to complain about bare workflow. To fix this, simply remove the android/ or ios/ directory.
Using expo-updates we can send updates to devices without requiring them to update their app via their app store. Only javascript updates can be sent, no native code changes. See expo-updates own documentation for more detailed information.
Updates can be sent running npm run send-update, pick an update message (latest commit message by default), then waiting for the process to complete. That's it, the update will now be installed the next time each user restarts their app.
If you want to test a feature, you can run npm run preview (or npm run preview:ios or npm run preview:android), get a build that you can install locally on a device.
Afterwards just call npm run preview-update to test an update.