Onesignal wordpress 通知获取 post 数据到 android 应用程序
Onesignal wordpress notification get post data to android app
我正在使用在我的 android 应用程序中实现的 onesignal 通知插件 wordpress 一切正常问题是我想要当用户点击通知时我想要获得 wordpress 网站 post '完整的内容数据(post 标题 + post 描述)...我知道 json return 推送内容 "additional data" 但它仅包含 post 标题和 url post(不满足 post 描述和作者等完整数据)!
我将探索这些数据以操纵 post 细节的 activity(不包含任何网络视图!)
我问了 onesignal 团队,他们让我直接使用 onesignal_send_notification_filter($fields, $new_status, $old_status 修改插件 php 代码, $post)
我需要帮助来解决它
谢谢!
onesignal_send_notification_filter()
是一个 WordPress filter hook that allows extending our plugin's behavior without modifying our plugin's code. See this section of OneSignal's documentation 以获取更多信息,包括开始示例代码。
在回调中,您可以访问 $post 对象,该对象 comes with these fields,包括 post_content
字段。
我正在使用在我的 android 应用程序中实现的 onesignal 通知插件 wordpress 一切正常问题是我想要当用户点击通知时我想要获得 wordpress 网站 post '完整的内容数据(post 标题 + post 描述)...我知道 json return 推送内容 "additional data" 但它仅包含 post 标题和 url post(不满足 post 描述和作者等完整数据)!
我将探索这些数据以操纵 post 细节的 activity(不包含任何网络视图!)
我问了 onesignal 团队,他们让我直接使用 onesignal_send_notification_filter($fields, $new_status, $old_status 修改插件 php 代码, $post)
我需要帮助来解决它
谢谢!
onesignal_send_notification_filter()
是一个 WordPress filter hook that allows extending our plugin's behavior without modifying our plugin's code. See this section of OneSignal's documentation 以获取更多信息,包括开始示例代码。
在回调中,您可以访问 $post 对象,该对象 comes with these fields,包括 post_content
字段。