简体   繁体   English

如何将推送通知从 wordpress 发送到 android 应用程序?

[英]How to send push notifications from wordpress to android app?

I am using OneSignal to receive a notification, But I can't find out from the WordPress site to the android app.我正在使用 OneSignal 接收通知,但我无法从 WordPress 站点到 android 应用程序找到。 The app can receive notification from the dashboard to the android app it works great but I want a WordPress site to mobile app for every post.该应用程序可以从仪表板接收通知到它运行良好的 android 应用程序,但我希望每个帖子都有一个 WordPress 网站到移动应用程序。

OneSignal has a pretty good api and php SDK ( https://documentation.onesignal.com/reference/create-notification ) so you could just send the notification within the wp_insert_post hook. OneSignal 有一个非常好的 api 和 php SDK ( https://documentation.onesignal.com/reference/create-notification ) 所以你可以在 wp_insert_post 钩子内发送通知。 Make sure you only fire it when the post is created.确保仅在创建帖子时触发它。

You can use the following WordPress plugin to send push notification to the android app when a new post is published on your WordPress site当您的 WordPress 网站上发布新帖子时,您可以使用以下 WordPress 插件向 android 应用程序发送推送通知

https://github.com/dream-space/wp-fcm/ https://github.com/dream-space/wp-fcm/

This plugin also helps you to send a custom notification to your android app users此插件还可以帮助您向 Android 应用程序用户发送自定义通知

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM