diff --git a/src/PubNub/Endpoints/Push/AddChannelsToPush.php b/src/PubNub/Endpoints/Push/AddChannelsToPush.php index e3cadfd8..dcd93e62 100644 --- a/src/PubNub/Endpoints/Push/AddChannelsToPush.php +++ b/src/PubNub/Endpoints/Push/AddChannelsToPush.php @@ -60,6 +60,12 @@ public function deviceId($deviceId) */ public function pushType($pushType) { + // FCM is new, GCM is still used internally + if( $pushType == PNPushType::FCM ) + { + $pushType = PNPushType::GCM; + } + $this->pushType = $pushType; return $this; diff --git a/src/PubNub/Endpoints/Push/ListPushProvisions.php b/src/PubNub/Endpoints/Push/ListPushProvisions.php index dbdae96c..952d7183 100644 --- a/src/PubNub/Endpoints/Push/ListPushProvisions.php +++ b/src/PubNub/Endpoints/Push/ListPushProvisions.php @@ -45,6 +45,12 @@ public function deviceId($deviceId) */ public function pushType($pushType) { + // FCM is new, GCM is still used internally + if( $pushType == PNPushType::FCM ) + { + $pushType = PNPushType::GCM; + } + $this->pushType = $pushType; return $this; diff --git a/src/PubNub/Endpoints/Push/RemoveChannelsFromPush.php b/src/PubNub/Endpoints/Push/RemoveChannelsFromPush.php index 3ff0e03e..ec5c12df 100644 --- a/src/PubNub/Endpoints/Push/RemoveChannelsFromPush.php +++ b/src/PubNub/Endpoints/Push/RemoveChannelsFromPush.php @@ -60,6 +60,12 @@ public function deviceId($deviceId) */ public function pushType($pushType) { + // FCM is new, GCM is still used internally + if( $pushType == PNPushType::FCM ) + { + $pushType = PNPushType::GCM; + } + $this->pushType = $pushType; return $this; diff --git a/src/PubNub/Endpoints/Push/RemoveDeviceFromPush.php b/src/PubNub/Endpoints/Push/RemoveDeviceFromPush.php index e74f6534..256a563d 100644 --- a/src/PubNub/Endpoints/Push/RemoveDeviceFromPush.php +++ b/src/PubNub/Endpoints/Push/RemoveDeviceFromPush.php @@ -45,6 +45,12 @@ public function deviceId($deviceId) */ public function pushType($pushType) { + // FCM is new, GCM is still used internally + if( $pushType == PNPushType::FCM ) + { + $pushType = PNPushType::GCM; + } + $this->pushType = $pushType; return $this; diff --git a/src/PubNub/Enums/PNPushType.php b/src/PubNub/Enums/PNPushType.php index be0450ad..e118af07 100644 --- a/src/PubNub/Enums/PNPushType.php +++ b/src/PubNub/Enums/PNPushType.php @@ -9,4 +9,5 @@ class PNPushType const APNS2 = "apns2"; const MPNS = "mpns"; const GCM = "gcm"; + const FCM = "fcm"; } \ No newline at end of file