-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support fcm tokens for iOS phones as well (#768)
* Support fcm tokens for iOS phones as well By default, the FCM plugin generates FCM tokens for both android and iOS. I don't like this on principle because it makes it harder to migrate to a different push service later. So we typically configure the app to generate APNS tokens and map on the server side. But that now requires editing GoogleServices.plist (FCM is the default) and it is easy to forget to do that. However, others may also not have this concern, and it does simplify the server side logic significantly to not have to do the mapping. So I now support FCM on both platforms, and add a config option to specify whether we are using APNS or FCM for iOS. If we are using FCM, we can skip the entire mapping logic * Fix the default push configuration Otherwise the tests fail * Fix the sample push configuration in the tests as well I don't know why the test generates this file when we also copy it from `bin/deploy/push_conf.py` But not going to get into that complexity now. * Add a new test - Pass in the `apns` token type in one more location - Add a new test for the FCM token type to ensure that the mapping shortcut works properly
- Loading branch information
Showing
4 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"provider": "firebase", | ||
"server_auth_token": "Get from firebase console", | ||
"app_package_name": "full package name from config.xml. e.g. edu.berkeley.eecs.emission or edu.berkeley.eecs.embase. Defaults to edu.berkeley.eecs.embase" | ||
"app_package_name": "full package name from config.xml. e.g. edu.berkeley.eecs.emission or edu.berkeley.eecs.embase. Defaults to edu.berkeley.eecs.embase", | ||
"ios_token_format": "apns" | ||
} |
This file contains 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 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