如何使用适用于 Android 的 Python SDK 在 Firebase 中发送应用内通知 | iOS系统

发布于 2025-01-09 02:50:48 字数 666 浏览 4 评论 0原文

我已成功集成适用于 Android/iOS 通知的 Firebase Python SDK。现在我想使用 firebase python sdk 发送应用内通知。我在 Firebase 官方文档中找不到任何相关代码。这是我用于发送推送通知的代码,运行良好。

_message = messaging.Message(
    notification=messaging.Notification(
        title=show_title,
        body=episode_title,
        image=image_url,
    ),
    apns=messaging.APNSConfig(
        payload=messaging.APNSPayload(
            aps=messaging.Aps(
                mutable_content=1
            )
        ),
        fcm_options=messaging.APNSFCMOptions(
            image=image_url
        )
    ),
    token=registration_token,
    data=data,
)

如果我可以使用 Firebase python sdk 进行应用内通知,请告诉我。谢谢

I've successfully integrated Firebase Python SDK for Android/iOS notifications. Now I want to send in-app notification using firebase python sdk. I couldn't find any code for this on Firebase official documentation. Here is my code for sending push notification which is working fine.

_message = messaging.Message(
    notification=messaging.Notification(
        title=show_title,
        body=episode_title,
        image=image_url,
    ),
    apns=messaging.APNSConfig(
        payload=messaging.APNSPayload(
            aps=messaging.Aps(
                mutable_content=1
            )
        ),
        fcm_options=messaging.APNSFCMOptions(
            image=image_url
        )
    ),
    token=registration_token,
    data=data,
)

Please do let me know IF somehow I can use Firebase python sdk for in-app notification. Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撩心不撩汉 2025-01-16 02:50:48

虽然可以以编程方式触发应用内消息,这只能在应用程序内部完成。由于存在应用内消息,因此没有 API 可以直接从服务器端代码触发它们。

可以做的是:

  1. 从Python代码向设备发送FCM数据消息,
  2. 在设备上的应用程序代码中接收它,然后
  3. 通过客户端触发应用内消息的显示端API。

While it is possible to trigger an in-app message programmatically, this can only be done from inside the application. Since there are in-app messages, there is no API to directly trigger them from server-side code.

What you can do is:

  1. send an FCM data message from your Python code to the device,
  2. receive it in your application code on the device, and then
  3. trigger the display of an in-app message through the client-side API.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文