diff --git a/bin/push/push_remind.py b/bin/push/push_remind.py index 6182757b5..376bbd417 100644 --- a/bin/push/push_remind.py +++ b/bin/push/push_remind.py @@ -1,6 +1,7 @@ import arrow import json import logging +logging.basicConfig(level=logging.INFO) import os import requests import sys @@ -55,7 +56,6 @@ def bin_users_by_lang(uuid_list, langs, lang_key='phone_lang'): if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) logging.debug(f"STUDY_CONFIG is {STUDY_CONFIG}") STUDY_CONFIG = os.getenv('STUDY_CONFIG', "stage-study") @@ -68,12 +68,12 @@ def bin_users_by_lang(uuid_list, langs, lang_key='phone_lang'): sys.exit(1) dynamic_config = json.loads(r.text) - logging.debug(f"Successfully downloaded config with version {dynamic_config['version']} "\ + logging.info(f"Successfully downloaded config with version {dynamic_config['version']} "\ f"for {dynamic_config['intro']['translated_text']['en']['deployment_name']} "\ f"and data collection URL {dynamic_config['server']['connectUrl']}") if "reminderSchemes" in dynamic_config: - logging.debug("Found flexible notification configuration, skipping server-side push") + logging.info("Found flexible notification configuration, skipping server-side push") sys.exit(0) # get push notification config (if not present in dynamic_config, use default) @@ -99,9 +99,9 @@ def bin_users_by_lang(uuid_list, langs, lang_key='phone_lang'): # for each language, send a push notification to the selected users in that language for lang, uuids_to_notify in filtered_uuids_by_lang.items(): if len(uuids_to_notify) == 0: - logging.debug(f"No users to notify in lang {lang}") + logging.info(f"No users to notify in lang {lang}") continue - logging.debug(f"Sending push notifications to {len(uuids_to_notify)} users in lang {lang}") + logging.info(f"Sending push notifications to {len(uuids_to_notify)} users in lang {lang}") json_data = { "title": push_config["title"][lang], "message": push_config["message"][lang], diff --git a/emission/net/ext_service/push/notify_interface_impl/firebase.py b/emission/net/ext_service/push/notify_interface_impl/firebase.py index 501bdbeac..d0b0671f2 100644 --- a/emission/net/ext_service/push/notify_interface_impl/firebase.py +++ b/emission/net/ext_service/push/notify_interface_impl/firebase.py @@ -23,6 +23,7 @@ def get_interface(push_config): class FirebasePush(pni.NotifyInterface): def __init__(self, push_config): self.service_account_file = push_config.get("PUSH_SERVICE_ACCOUNT_FILE") + self.server_auth_token = push_config.get("PUSH_SERVER_AUTH_TOKEN") self.project_id = push_config.get("PUSH_PROJECT_ID") if "PUSH_APP_PACKAGE_NAME" in push_config: self.app_package_name = push_config.get("PUSH_APP_PACKAGE_NAME")