小编Sim*_*mar的帖子

如何在PHP中使用fcm(firebase控制台)向iphone发送推送通知?

从firebase控制台发送通知时,通知工作正常.

firebase控制台

我在ios设备上收到推送通知.

这是我使用FCM在php中向iphone发送推送通知的代码.

<?php  $ch = curl_init("https://fcm.googleapis.com/fcm/send");

    //The device token.
    $token = "";

    //Title of the Notification.
    $title = "Carbon";

    //Body of the Notification.
    $body = "Bear island knows no king but the king in the north, whose name is stark.";

    //Creating the notification array.
    $notification = array('title' =>$title , 'text' => $body);

    //This array contains, the token and the notification. The 'to' attribute stores the token.
    $arrayToSend = array('to' => $token, 'notification' => $notification);
    //Generating JSON encoded string form …
Run Code Online (Sandbox Code Playgroud)

php iphone ios firebase firebase-cloud-messaging

6
推荐指数
2
解决办法
1万
查看次数

NSURLConnection错误结束-代码-1100

用错误代码-1100结束的NSURLConnection是什么?从iOS版本的相机上传图片时出现此错误。我在Ionic 1工作。如何解决此问题?

ios ionic-framework

6
推荐指数
1
解决办法
6141
查看次数

如何在节点 js 中禁用邮件预览(电子邮件模板)?

我正在使用带有电子邮件模板的 nodemailer。我可以向用户发送电子邮件。我面临的唯一问题是每次都预览电子邮件。你能告诉我如何禁用它吗?

var email = new EmailTemplate({
            message: {
              from: 'abc@****.com',
            },
            // uncomment below to send emails in development/test env:
            send: true,
            transport: {
              jsonTransport: true
            },
            preview:'production', // tried with production and development but is of no use
            views: {
              options: {
                extension: 'ejs' // <---- HERE
              }
            }
          });
Run Code Online (Sandbox Code Playgroud)

email-templates node.js nodemailer

3
推荐指数
1
解决办法
863
查看次数

在cakephp3中的matching或innerJoinWith中传递动态变量

我将静态值传递给以下查询,然后它运行良好。如果我动态地改变它,那么它就不会。

 //works well
        $users = $this->Users->find('all')
                     ->where(['Users.role' => $role])
                     ->innerJoinWith('UserDetail',function($query){
                     return $query->where(['UserDetail.state' => "chandigarh"]); 
                   })->toArray();

       // don't work
         $state="chandigarh";
         $users = $this->Users->find('all')
                     ->where(['Users.role' => $role])
                     ->innerJoinWith('UserDetail',function($query){
                     return $query->where(['UserDetail.state' => "$state"]); 
                   })->toArray();
Run Code Online (Sandbox Code Playgroud)

如何将我的 $state 变量动态传递给它?

cakephp-3.0 cakephp-3.x

1
推荐指数
1
解决办法
809
查看次数