SuccessChanges

Summary

  1. More fixes to push notification code (commit: 1b0f3fb18d06189ce066c13c4a4ad47dc059199e) (details)
Commit 1b0f3fb18d06189ce066c13c4a4ad47dc059199e by shankari
More fixes to push notification code
It turns out that firebase, which used to not return mappings for
android tokens, now returns mappings for all tokens. And the tokens
returned in the android case are actually invalid, which breaks push on
android.
So we can no longer use the return value from firebase to determine
whether a particular token is android or iOS - instead we need to start
by pre-categorizing tokens, and only mapping iOS tokens.
Fortunately, at the time that we started storing our own tokens, we also
started storing the current platform, so we have this data.
This means that the change is largely mechanical. We need to start with
retrieving a map of device tokens, separated into iOS and android,
instead of a merged list. And then we need to propogate that change
through out the downstream code.
We can remove the part which assumes that if there is no mapping, it is
android since we will only ever map iOS tokens.
Also, recall that firebase android push notifications are not displayed
unless they have associated json data (e.g.
8e306fb9be532d995cabc4c28e6907fd95dcacb4), so we change the
`push_to_users.py` code to pass in the title and message as part of the
json data.
With this, manually created push notifications work on both android and
iOS.
Testing done:
- imported profiles containing tokens from production systems
- generated manual pushes for android and iOS using
`bin/push/push_to_users.py`
(commit: 1b0f3fb18d06189ce066c13c4a4ad47dc059199e)
The file was modifiedemission/net/ext_service/push/notify_interface_impl/firebase.py (diff)
The file was modifiedemission/net/ext_service/push/notify_usage.py (diff)
The file was modifiedemission/net/ext_service/push/notify_interface.py (diff)
The file was modifiedemission/net/ext_service/push/notify_queries.py (diff)
The file was modifiedbin/push/push_to_users.py (diff)