Ir al contenido
Menú
Se marcó esta pregunta

I use chrome browser and the host is 127.0.0.1:8069, I followed the module's instructions but in the part to get the "Server key" because Messaging Cloud has stopped working since June 20, so I use the new method: OAuth2, and the message seems to have been sent, I get a response of "{'name': 'projects/odoo-notifi/messages/4d05ba65-1325-4eae-984b-b439bcf79e7c'}" and on the /messaging page /report is also updated with the "send" count but in the browser I don't receive any notification


Here is the code I edited to test the new method, and my browser allow notifications

def _notify_thread(self, message,def _notify_thread(self, message, msg_vals=False, **kwargs):
res = super(MailThread, self)._notify_thread(message,
msg_vals=msg_vals,
**kwargs)
if self.env.company.push_notification and self.env.user.has_group(
'base.group_user'):
try:
service_account_file = 'C:\odoo-notifi-firebase-adminsdk-zwako-d135847d90.json'
project_id = 'odoo-notifi'
push_service = FCMNotification(service_account_file=service_account_file,project_id=project_id)
fcm_token2 = "eRJNBwQ59SBm-hTOK2G....................WdvlXfZmL16HjF88J4MspnTqaP887aifeC53O-lHPp"
response = push_service.notify(
fcm_token=fcm_token2,
notification_title='Send by test',
notification_body='Hello',
timeout=5
)
print(response)
except Exception:
pass
return res
Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
3
may 24
1715
3
dic 24
1717
5
jul 25
2287
1
may 25
1018
1
feb 25
1215