Hello,
We are using PHP Library to sending notifications to android/ios devices from our Web Application.
we want to send notification only to particular devices , but each time it sends push notification to all devices even if setPushPolicy(“ONLY”); is written.
Here is our code :
$pushid1 and $pushid2 are two device’s push id’s given by backendless , we want to send notification to only these device , but it send to all.
Please help.
$publish_options = new PublishOptions();
$publish_options->putHeader( "android-ticker-text", $message );
$publish_options->putHeader( "android-content-title", "PUSH_NOTIFICATION_TITLE");
$publish_options->putHeader( "android-content-text", $message );
$publish_options->putHeader( "action","new_post" );
$publish_options->putHeader( "id", "12" );
$delivery_options = new DeliveryOptions();
$delivery_options->addPushSinglecast( $pushid1 );
$delivery_options->addPushSinglecast( $pushid2 );
$delivery_options->setPushPolicy("ONLY");
$status = Backendless::$Messaging->publish( $message,$publish_options );
Thanks in advance.
Jaymin