我有这段代码:
public static function sendMessage($sMessage, $aTokens, $sDeeplink = NULL){
# Create request
$oRequest = CreateMessageRequest::create()->addNotification(Notification::create()->setContent($sMessage)->setDevices($aTokens)->setSendDate('now'));
# Call the REST Web Service
$oResponse = self::createPushInstance()->createMessage($oRequest);
if($oResponse->isOk()){
return true;
}
# Add logs
self::addLogs($oResponse, 'sendMessage');
return false;
}
如何防止不向所有已注册的用户发送,但仅限于2例如?有可能的 ?我尝试过这样,但推送被发送到所有已注册的设备(10.000)。