rest API 下的 push Api方法 只推送给安卓用户
没有别名 也没有标签标示, 想吧信息推送给安卓用户,需要怎么改造
public function push_all_object($data,$platform = array('ios', 'android')){
try{
$response = $this->JPush->push()->setPlatform($platform);
$response->options(['apns_production'=>false]);
$response->iosNotification($data['message'], array(
'sound' => 'sound.caf',
'badge' => '+1',
'extras' => $data['extras']
));
$response->androidNotification($data['message'], array(
'title' => $data['title'],
'extras' => $data['extras']
));
$result = $response->send();
return $result;
}catch(\APIConnectionException $e){
return $e;
}catch(\APIRequestException $e){
return $e;
}
}
我书写的 提示增加推送设备