- Jun 6, 2020
- 11,559
- 4,422
Hi I am trying to add notifications with actions to my project
I have followed the tutorial step by step to add the categories, create actions and sub userNotification_Actions
The problem is: How I should Set the category in the push notification message from a php file?
Can anybody help me?
**php file content**
<?php
include('../con/Config.php');
if ($_GET['u'] != '') {
$UUID = $_GET['u'];
$title = $_GET['t'];
$body = $_GET['b'];
if (strpos($UUID, "IOS_") !== false) {
$serverKey = 'XXXXXXXXXXXXXXXXXXXXXX';
$UUID = str_replace("IOS_","",$UUID);
// NOTIFICATION WITH ACTION
$notification = array('title' =>$title , 'body' => $body, 'sound' => 'default');
}
$arrayToSend = array('to' => $UUID, 'notification' => $notification, 'data' => $notification, 'priority'=>'high');
$json = json_encode($arrayToSend);
$url = "
$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] =...
I have followed the tutorial step by step to add the categories, create actions and sub userNotification_Actions
The problem is: How I should Set the category in the push notification message from a php file?
Can anybody help me?
**php file content**
<?php
include('../con/Config.php');
if ($_GET['u'] != '') {
$UUID = $_GET['u'];
$title = $_GET['t'];
$body = $_GET['b'];
if (strpos($UUID, "IOS_") !== false) {
$serverKey = 'XXXXXXXXXXXXXXXXXXXXXX';
$UUID = str_replace("IOS_","",$UUID);
// NOTIFICATION WITH ACTION
$notification = array('title' =>$title , 'body' => $body, 'sound' => 'default');
}
$arrayToSend = array('to' => $UUID, 'notification' => $notification, 'data' => $notification, 'priority'=>'high');
$json = json_encode($arrayToSend);
$url = "
برای دیدن لینک ها باید ثبت نام کنید
";$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] =...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید