Google Libraries Updates and migrated usage of _ensureIndex to createIndex
Pre-releaseUpdates
Compatibility with Meteor 2.4+
Migrated usage of _ensureIndex to createIndex
Firebase Admin to 10.0.0
Dropped support for Node 10.
View release notes for Firebase Admin: https://firebase.google.com/support/release-notes/admin/node#10.0.0
Firebase JS SDK to 9.1.3
View release notes for Firebase JS: https://firebase.google.com/support/release-notes/js
Internals:
Separated function for Web Push sending in order to explore a new paradigm. In the past we used to overwrite a web push token for a user and a user would end up getting a notification on the last device subscribed. Now we save all token approved by a user and send to all.
We now do a far better control of tokens and we delete tokens as users log out and get new tokens as they log in. Details and examples in the [...repo...]
Removed deprecated functions for FirebaseJS SDK (this is the component that we use to receive our messages). See the release notes.
Updated the service worker to use the latest Firebase libraries and import only relevant components. (reduce code download size).
The latest Firebase version expects a certain service worker name so we removed the client side registration since Firebase does that instead.
Syntax updates to match the new SDK for Firebase-Admin
Extend the Notification object to include
- click_action
apns: {
// https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_
apns
headers: {
'apns-topic': defaults.topic, // do not remove, required by apns-push-type === 'alert' or 'background' or 'location'
'apns-priority': mongoNote.priority || defaults.apnsPriority,
'apns-collapse-id': mongoNote.collapseKey,
'apns-push-type': mongoNote.apnsPushType || defaults.apnsPushType, // one of ['alert', 'background', 'location', 'voip' ... etc.]
// IOS makes it truly complicated. When type is 'background', priority must be 5. Check the url for more details.
},
...
}
payload: {
aps: {
// category: 'NEW_MESSAGE_CATEGORY',
}
}
Extend Push configuration to receive a MongoDB url so it can store Push data separately from Meteor data. A first step in separating concern (Push from Meteor)