diff --git a/src/Ramcar/MobileOSType.php b/src/Ramcar/MobileOSType.php new file mode 100644 index 00000000..67669294 --- /dev/null +++ b/src/Ramcar/MobileOSType.php @@ -0,0 +1,14 @@ + 'iOS', + 'ANDROID' => 'Android', + ]; +} diff --git a/src/Service/APNSClient.php b/src/Service/APNSClient.php index 4ac5c23d..2fc02fe9 100644 --- a/src/Service/APNSClient.php +++ b/src/Service/APNSClient.php @@ -4,6 +4,7 @@ namespace App\Service; use Mosquitto\Client as MosquittoClient; use App\Entity\JobOrder; +use App\Ramcar\MobileOSType; use Redis; class APNSClient @@ -43,6 +44,10 @@ class APNSClient foreach ($sessions as $sess) { + // check if mobile session is using an ios device + if ($sess->getOSType() != MobileOSType::IOS) + continue; + $push_id = $sess->getDevicePushID(); if ($push_id != null && strlen(trim($push_id)) > 0) $this->push($push_id, $message);