Php 使用pushwoosh按标记值向设备发送通知
所以我正在开发一个需要推送通知的应用程序,我正在使用pushwoosh。但目前我一直在研究如何通过标签值向设备发送有针对性的通知Php 使用pushwoosh按标记值向设备发送通知,php,pushwoosh,Php,Pushwoosh,所以我正在开发一个需要推送通知的应用程序,我正在使用pushwoosh。但目前我一直在研究如何通过标签值向设备发送有针对性的通知 我正在使用[ 任何帮助都将不胜感激。谢谢 $filter = ''; $request = CreateTargetedMessageRequest::create() ->setContent($options['body']) ->setData( [ 'custom' => 'json data' ] ) -&g
我正在使用[
任何帮助都将不胜感激。谢谢
$filter = '';
$request = CreateTargetedMessageRequest::create()
->setContent($options['body'])
->setData(
[
'custom' => 'json data'
]
)
->setDevicesFilter($filter);
$pushwoosh->createTargetedMessage($request);
我想要的是过滤器的值我最终自己解决了它。我使用
setCondition()
方法指定了我想要的标记名和值
$request = CreateMessageRequest::create()
->addNotification(Notification::create()
->setContent($options['body'])
->setConditions([
IntCondition::create('userId')->eq($user_id)
]));
// Call the REST Web Service
$response = $pushwoosh->createMessage($request);
你能给我们看一些代码吗?到目前为止你试过什么?