Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion backend/database/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ def sync_query():
try:
query = users_ref.where(filter=FieldFilter('time_zone', 'in', chunk))
for doc in query.stream():
if (filter == 'fcm_token'):
if 'fcm_token' not in doc.to_dict():
continue
if filter == 'fcm_token':
token = doc.get('fcm_token')
else:
token = doc.id, doc.get('fcm_token')
Expand Down
2 changes: 1 addition & 1 deletion backend/utils/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def send_batch(batch_users):
token=token
) for token in batch_users
]
return messaging.send_all(messages)
return messaging.send_each(messages)

tasks = []
for i in range(num_batches):
Expand Down
4 changes: 2 additions & 2 deletions backend/utils/other/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ async def _send_bulk_summary_notification(users: list):

async def send_daily_notification():
try:
morning_alert_title = "Don\'t forget to wear Friend today"
morning_alert_body = "Wear your friend and capture your memories today."
morning_alert_title = "Don\'t forget to wear Omi today"
morning_alert_body = "Wear your omi and capture your memories today."
morning_target_time = "08:00"

await _send_notification_for_time(morning_target_time, morning_alert_title, morning_alert_body)
Expand Down