从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) 用错误代码-1100结束的NSURLConnection是什么?从iOS版本的相机上传图片时出现此错误。我在Ionic 1工作。如何解决此问题?
我正在使用带有电子邮件模板的 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) 我将静态值传递给以下查询,然后它运行良好。如果我动态地改变它,那么它就不会。
//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 变量动态传递给它?