<legend id='mCkL9'><style id='mCkL9'><dir id='mCkL9'><q id='mCkL9'></q></dir></style></legend>

      <small id='mCkL9'></small><noframes id='mCkL9'>

      <tfoot id='mCkL9'></tfoot>
        • <bdo id='mCkL9'></bdo><ul id='mCkL9'></ul>
        <i id='mCkL9'><tr id='mCkL9'><dt id='mCkL9'><q id='mCkL9'><span id='mCkL9'><b id='mCkL9'><form id='mCkL9'><ins id='mCkL9'></ins><ul id='mCkL9'></ul><sub id='mCkL9'></sub></form><legend id='mCkL9'></legend><bdo id='mCkL9'><pre id='mCkL9'><center id='mCkL9'></center></pre></bdo></b><th id='mCkL9'></th></span></q></dt></tr></i><div id='mCkL9'><tfoot id='mCkL9'></tfoot><dl id='mCkL9'><fieldset id='mCkL9'></fieldset></dl></div>
      1. 使用 Parse 向特定用户发送推送通知

        Send push notification to specific user using Parse(使用 Parse 向特定用户发送推送通知)

          <small id='tXiV7'></small><noframes id='tXiV7'>

            <bdo id='tXiV7'></bdo><ul id='tXiV7'></ul>

            <i id='tXiV7'><tr id='tXiV7'><dt id='tXiV7'><q id='tXiV7'><span id='tXiV7'><b id='tXiV7'><form id='tXiV7'><ins id='tXiV7'></ins><ul id='tXiV7'></ul><sub id='tXiV7'></sub></form><legend id='tXiV7'></legend><bdo id='tXiV7'><pre id='tXiV7'><center id='tXiV7'></center></pre></bdo></b><th id='tXiV7'></th></span></q></dt></tr></i><div id='tXiV7'><tfoot id='tXiV7'></tfoot><dl id='tXiV7'><fieldset id='tXiV7'></fieldset></dl></div>

              <legend id='tXiV7'><style id='tXiV7'><dir id='tXiV7'><q id='tXiV7'></q></dir></style></legend>
              <tfoot id='tXiV7'></tfoot>
                <tbody id='tXiV7'></tbody>
                  本文介绍了使用 Parse 向特定用户发送推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想使用 PHP 向特定用户发送推送通知.我知道这个问题被问了很多次.但我的问题有点不同.在我的情况下,推送通知是发送给所有用户的,即使我已将其指定为向特定用户发送推送,

                  I want to send push notification to a specific user using PHP. I know this question is asked many times. But my problem is little different. The push notifications are sent in my case, but to all users even though I have specified it to send push to a particular user,

                  为此,每当用户在其 Android 设备上安装应用程序时,我都会在 Parse.com 的安装表中保存一个唯一 ID.这是android应用程序中的代码:

                  For that I am saving a unique ID in Parse.com 's installation table whenever user installs app on their android device. This is the code in the android app :

                  Parse.initialize(this, "XXXX", "XXXX");
                  ParseInstallation installation = ParseInstallation.getCurrentInstallation();
                  installation.put("device_id", Secure.getString(getContentResolver(), Secure.ANDROID_ID));
                  installation.saveInBackground();
                  

                  这很好用.我可以在解析器的安装表中看到 id.

                  This works fine. I can see the id in the parse's installation table.

                  现在,这是我用来向特定设备 ID 发送推送通知的 php 脚本.它确实会发送推送通知,但会发送给所有用户.

                  Now, this is the php script I'm using to send push notification to specific device id. It does send the push notification, but to all users.

                  require_once('autoload.php');
                  
                  use ParseParseInstallation;
                  use ParseParsePush;
                  use ParseParseClient;
                  
                  ParseClient::initialize( 'XXXXXX', 'XXXXX', 'XXXXX' );
                  
                  function sendPush($query){
                      $notification = "Test notification!";
                      $data = array("alert" => $notification);
                      ParsePush::send(array(
                          "where" => $query,
                          "data" => $data
                      ));
                  }
                  
                  $query = ParseInstallation::query();
                  $query->equalTo("device_id", "XXXXXX");
                  sendPush($query);
                  

                  推荐答案

                  在搜索了很多解决方案后,我查看了他们的 github 问题页面,在已关闭问题"部分我发现了一个 类似问题.解决方案是只更新 SDK.因为他们在 ParsePush.php 中打错了字.因此,如果有人遇到此问题,请更新您的 Parse PHP SDK.

                  After searching a lot for a solution, I checked their github issues page and in the 'closed issues' section I found out a similar issue. The solution was to just update the SDK. Because they had made a typo in the ParsePush.php. So, if anyone is having this issue, please update your Parse PHP SDK.

                  这篇关于使用 Parse 向特定用户发送推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Proxy Authentication Required with cURL(cURL 需要代理身份验证)
                  How to use a SOCKS 5 proxy with cURL?(如何使用带有 cURL 的 SOCKS 5 代理?)
                  How to use HTTP_X_FORWARDED_FOR properly?(如何正确使用 HTTP_X_FORWARDED_FOR?)
                  file_get_contents behind a proxy?(代理后面的 file_get_contents ?)
                  pecl install cassandra throws: quot;error: Unable to load libcassandraquot;(pecl install cassandra 抛出:“错误:无法加载 libcassandra)
                  Installing php datastax driver on ubuntu(在 ubuntu 上安装 php datastax 驱动)
                  <legend id='0kKq8'><style id='0kKq8'><dir id='0kKq8'><q id='0kKq8'></q></dir></style></legend>

                    <bdo id='0kKq8'></bdo><ul id='0kKq8'></ul>

                        <i id='0kKq8'><tr id='0kKq8'><dt id='0kKq8'><q id='0kKq8'><span id='0kKq8'><b id='0kKq8'><form id='0kKq8'><ins id='0kKq8'></ins><ul id='0kKq8'></ul><sub id='0kKq8'></sub></form><legend id='0kKq8'></legend><bdo id='0kKq8'><pre id='0kKq8'><center id='0kKq8'></center></pre></bdo></b><th id='0kKq8'></th></span></q></dt></tr></i><div id='0kKq8'><tfoot id='0kKq8'></tfoot><dl id='0kKq8'><fieldset id='0kKq8'></fieldset></dl></div>
                        • <small id='0kKq8'></small><noframes id='0kKq8'>

                          <tfoot id='0kKq8'></tfoot>

                              <tbody id='0kKq8'></tbody>