-
Notifications
You must be signed in to change notification settings - Fork 10
Dev & Prod Notifications #5229
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
Merged
Merged
Dev & Prod Notifications #5229
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c3218da
init
brettedw f35598c
dev&prod scripts
brettedw a566d78
test prod
brettedw 556e936
new target
brettedw d9a0678
read me updates
brettedw eaa5b4e
clarity
brettedw 13919e5
scripts
brettedw 59781e8
actions
brettedw 1be6637
sha
brettedw f8bf3cb
version bump
brettedw 3ab176d
use script
brettedw 8942f64
remove build from shared action
brettedw 0a8859b
build readme
brettedw 4f0c64d
google play fingerprint
brettedw e8869c4
readme change
brettedw aaeb387
minor readme change
brettedw c733f52
Update mobile/asa-go/Notifications.md
brettedw 3a0db12
notifications.md tweak
brettedw 4d2f6d8
Merge branch 'main' into task/firebase-dev-prod
brettedw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| # Notifications | ||
|
|
||
| Short reference for the ASA Go mobile notification setup. | ||
|
|
||
| ## iOS app IDs | ||
|
|
||
| We have two iOS app variants: | ||
|
|
||
| - Prod bundle ID: `ca.bc.gov.asago` | ||
| - Dev bundle ID: `ca.bc.gov.asago.dev` | ||
|
|
||
| These bundle IDs must match the Firebase iOS app registration exactly. | ||
|
|
||
| ## Android app IDs | ||
|
|
||
| We also have two Android app variants: | ||
|
|
||
| - Prod application ID: `ca.bc.gov.asago` | ||
| - Dev application ID: `ca.bc.gov.asago.dev` | ||
|
|
||
| These application IDs must match the Firebase Android app registration exactly. | ||
|
|
||
| ## Firebase dev vs prod | ||
|
|
||
| Current mapping: | ||
|
|
||
| - Prod plist `BUNDLE_ID`: `ca.bc.gov.asago` | ||
| - Dev plist `BUNDLE_ID`: `ca.bc.gov.asago.dev` | ||
|
|
||
| If the wrong plist is used, Firebase Messaging will not be configured for the installed app correctly. | ||
|
|
||
| The same rule applies on Android: if the wrong `google-services.json` is used, Firebase Messaging will not be configured for the installed app correctly. | ||
|
|
||
| ## GoogleService-Info.plist | ||
|
|
||
| `GoogleService-Info.plist` is the iOS Firebase app config file. | ||
|
|
||
| It tells the app which Firebase project/app to talk to, including: | ||
|
|
||
| - Firebase project ID | ||
| - iOS app ID | ||
| - sender ID | ||
| - API key | ||
| - expected iOS bundle ID | ||
|
|
||
| It is required locally in the iOS project. | ||
|
|
||
| ## google-services.json | ||
|
|
||
| `google-services.json` is the Android Firebase app config file. | ||
|
|
||
| It tells the Android app which Firebase project/app to talk to, including: | ||
|
|
||
| - Firebase project ID | ||
| - Android app ID | ||
| - sender ID | ||
| - API key | ||
| - expected Android application ID | ||
|
|
||
| It is required locally in the Android project. | ||
|
|
||
| ## Google Play App Signing | ||
|
|
||
| When distributing via the Play Store, Google re-signs your APK with their own App Signing Key rather than your local upload key. Firebase needs the SHA-1 of this key registered to validate the app's identity when requesting FCM tokens. | ||
| To get it: Play Console -> Test and release -> App Integrity -> App signing → copy the SHA-1 and add it to the app in Firebase Console under Project Settings. | ||
|
|
||
| ## APNs auth key | ||
|
|
||
| The APNs auth key is the Apple push key used by Firebase to send iOS notifications through APNs. | ||
|
|
||
| Important points: | ||
|
|
||
| - It is only uploaded in Firebase Console. | ||
| - It can be used for both development and production APNs delivery. | ||
|
|
||
| Because we have separate Firebase setups for dev and prod, make sure the Firebase project used by each app has APNs configured. | ||
|
|
||
| ## What lives where | ||
|
|
||
| We use different Firebase app configs for prod and dev on both platforms. | ||
|
|
||
| - Prod Firebase plist: `ios/App/App/Firebase/Prod/GoogleService-Info.plist` | ||
| - Dev Firebase plist: `ios/App/App/Firebase/Dev/GoogleService-Info.plist` | ||
| - Prod Android config: `android/app/src/prod/google-services.json` | ||
| - Dev Android config: `android/app/src/dev/google-services.json` | ||
|
|
||
| In the app folder: | ||
|
|
||
| - iOS bundle IDs | ||
| - Android application IDs / flavors | ||
| - Xcode targets/schemes (`ASA Go` and `ASA Go Dev`) | ||
| - `GoogleService-Info.plist` | ||
| - `google-services.json` | ||
| - Capacitor config | ||
|
|
||
| In Firebase Console: | ||
|
|
||
| - APNs auth key upload for iOS | ||
| - Android SHA-1 upload for Android | ||
| - Firebase app registration for each bundle ID | ||
|
|
||
| ## Why we use separate app IDs | ||
|
|
||
| This repo uses separate app IDs for dev and prod instead of trying to inject only Firebase config into one app identity. | ||
|
|
||
| This lets dev and prod be installed on the same device at the same time. It also keeps dev push notifications separate from | ||
| prod and makes the Firebase app registration clearer, because each app variant has its own app ID. | ||
|
|
||
| On iOS, the current implementation uses separate Xcode targets and separate `Info.plist` files for those app identities. | ||
|
|
||
| ## Running dev vs prod | ||
|
|
||
| `capacitor.config.ts` switches between dev and prod using `APP_ENV`. | ||
|
|
||
| Examples: | ||
|
|
||
| ```bash | ||
| APP_ENV=dev yarn cap:sync:ios:dev | ||
| APP_ENV=prod yarn cap:sync:ios:prod | ||
| ``` | ||
|
|
||
| For live reload: | ||
|
|
||
| ```bash | ||
| APP_ENV=dev ionic capacitor run ios -l --external | ||
| APP_ENV=prod ionic capacitor run ios -l --external | ||
| APP_ENV=dev ionic capacitor run android -l --external | ||
| APP_ENV=prod ionic capacitor run android -l --external | ||
| ``` | ||
|
|
||
| On iOS, `APP_ENV=dev` selects the `ASA Go Dev` scheme and `APP_ENV=prod` selects `ASA Go`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.