You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
frompush_notifications.gcmimportsend_message# First param is "None" because no Registration_id is needed, the message will be sent to all devices subscribed to the topic.send_message(None, {"body": "Hello members of my_topic!"}, to="/topics/<my_topic>_here")
when I do as stated above, I get this error
send_message(None, {"body": "Hello members of my_topic!"},
TypeError: send_message() missing1requiredpositionalargument: 'cloud_type'
I look up the send_message function in site-packages, it is defined like this def send_message(registration_ids, data, cloud_type, application_id=None, **kwargs)
then I modify my arguments to send_message to contain my cloud_type and application_id thus:
send_message(None, {"body": "Hello members of my_topic!"}, cloud_type='FCM',
to="/topics/<my_topic_here>", application_id="my application id")
Yes, it solved it for me. But I am sending only to a single user and not an entire topic.
I can send to a single and multiple devices via the device.send_message method and it works. It is only when I try to send to users subscribed to my topics (see the directive in the screenshot) that I get that error.
from the documentation here https://github.com/jazzband/django-push-notifications
when I do as stated above, I get this error
I look up the send_message function in site-packages, it is defined like this
def send_message(registration_ids, data, cloud_type, application_id=None, **kwargs)
then I modify my arguments to send_message to contain my cloud_type and application_id thus:
I then get this error
here is my settings:
The text was updated successfully, but these errors were encountered: