【问题标题】:How to send push notification by using php to android如何使用php向android发送推送通知
【发布时间】:2015-11-23 02:26:04
【问题描述】:

我正在尝试从 PHP 服务器向我的应用程序发送推送通知。 但我不明白某些事情,比如我需要制作 PHP 服务器。 我有我的应用程序。我配置了所有东西。 我在 phonegap 中创建了我的应用程序。 我有 API KEY、Project NO. 和 Registration Key。

我已经关注了这篇文章:

Google Cloud Messaging GCM for Android and Push Notifications

Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL

Push notifications with PhoneGap and Android

但仍然无法创建 php 页面来发送通知。 我可以使用推送机器人发送通知。 但我想创建自己的 PHP 页面来发送推送通知。 请帮我解决一下这个。 非常感谢您的帮助。

提前致谢

【问题讨论】:

  • 到目前为止您尝试过哪些 PHP 代码?
  • 文章中的那个:适用于 Android 和推送通知的 Google Cloud Messaging GCM
  • 您在哪里遇到问题?您遇到什么错误?我们无法根据“它不起作用”为您提供帮助。
  • 您是否尝试过按照答案?

标签: php android cordova phonegap-plugins


【解决方案1】:

关于发送 Android 推送通知look at this gist 的 PHP 代码的一个很好的示例。

为了始终拥有更新版本的注册令牌,您应该编写另一个 php 页面来接收来自设备的令牌并将它们写入数据库。然后您可以在发送推送通知之前获取这些令牌。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-17
    • 2015-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多