how to send deep link url with fcm firebase admin in python

Viewed 251

with HTTPS requests I send messages like this

request.setRawHeader("Content-Type","application/json");
request.setRawHeader("Authorization",...);
QJsonObject notification;
notification["title"]=user_data["username"].toString();
notification["body"]=message;
notification["link"]="https://url.com/goto?user="+user_data["username"].toString();
QJsonObject msg;
msg["notification"]=notification;
msg.insert("registration_ids",tokens);
QJsonDocument doc(msg);
QNetworkReply *reply  = mgr->post(request,doc.toJson());

And the deep link works by clicking on the notification in android, but in python, with firebase admin SDK I can't send a message with the deep link

Python

_notification= messaging.Notification(
                body=self.message_body(),
                title=self.message_title(),
                image=self.__image,

            )
web_notification = messaging.WebpushNotification(
               body=self.message_body(),
                title=self.message_title(),
                image=self.__image,
            )
_option = messaging.WebpushFCMOptions(
                link=self.__link
            )
_web = messaging.WebpushConfig(
                fcm_options=_option,
                notification=web_notification
            )
_message = messaging.MulticastMessage(
                notification=_notification,
                tokens=_sending_token,
                data={'click_action':self.__link},
                webpush=_web

            )
0 Answers
Related