Closed ceoy closed 9 months ago
Attention: 15 lines
in your changes are missing coverage. Please review.
Comparison is base (
7d28052
) 69.51% compared to head (a8bfcd5
) 70.28%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
will reopen after i've fixed tests
@jamaalscarlett @jleclanche Any sense of when this might be reviewed? Would be really great to have FCM v1 support merged in soon with the legacy API going away in 2024/06/20
@ceoy nice work. In your changes to the docs, you have:
firebase_app = firebase_admin.initialize_app()
PUSH_NOTIFICATIONS_SETTINGS = {
# Load and process all PUSH_NOTIFICATIONS_SETTINGS using the AppConfig manager.
"CONFIG": "push_notifications.conf.AppConfig",
# collection of all defined applications
"APPLICATIONS": {
"my_fcm_app": {
# PLATFORM (required) determines what additional settings are required.
"PLATFORM": "FCM",
# FCM settings
"FIREBASE_APP": firebase_app,
},
"my_ios_app": {
# PLATFORM (required) determines what additional settings are required.
"PLATFORM": "APNS",
# required APNS setting
"CERTIFICATE": "/path/to/your/certificate.pem",
},
"my_wns_app": {
# PLATFORM (required) determines what additional settings are required.
"PLATFORM": "WNS",
# required WNS settings
"PACKAGE_SECURITY_ID": "[your package security id, e.g: 'ms-app://e-3-4-6234...']",
"SECRET_KEY": "[your app secret key, e.g.: 'KDiejnLKDUWodsjmewuSZkk']",
},
}
Would this allow for setting up and initializing multiple firebase_admin apps, each with different service account credentials and then being to dynamically choose which app to send the push with at the time of sending the message? Or would this work some other way? I'm trying to get a sense for how we can use multiple Firebase apps with this.
Yes, exactly.
This part is basically the same as before (old documentation here https://github.com/jazzband/django-push-notifications), you just need to set the FIREBASE_APP
instead of an API_KEY
.
The config is then selected depending on the value of the application_id
field in the GCMDevice
model.
Excellent, thanks @ceoy
very nice job!! @ceoy
@ceoy any idea why the python 3.6 test is failing?
@ceoy any idea why the python 3.6 test is failing?
not sure, i have some time tomorrow to check 👀
@jamaalscarlett fixed now, bit of a weird issue and there is probably a better way to fix it 😆
Thanks @ceoy for this PR. Very nice work.
@ceoy, good work out here! thanks for sending in this patch, re-running the pipeline all test now passes with the new update 👍🏼
cc: @jamaalscarlett
Use new FCM v1 API by using firebase_admin SDK.
Resolves #546