As per @alemonmk's suggestion in #187, when supplying a single registration token inside an array, we should set the to property and not the registration_ids property, so that the push notification will be sent as a unicast message, which is encouraged by the GCM documentation.
To achieve this, I added a check for a single-element array inside sendNoRetry.
The response from the GCM server is identical for unicast and multicast messages.
Also, added the following tests to check for correct utilization of the to GCM request property:
Should set the to field if a single reg token is passed inside the recipient array
Should set the to field if a single reg token is passed inside the registrationTokens array
Should set the to field if a single reg token is passed inside the registrationIDs array
As per @alemonmk's suggestion in #187, when supplying a single registration token inside an array, we should set the
to
property and not theregistration_ids
property, so that the push notification will be sent as a unicast message, which is encouraged by the GCM documentation.To achieve this, I added a check for a single-element array inside
sendNoRetry
.The response from the GCM server is identical for unicast and multicast messages.
Also, added the following tests to check for correct utilization of the
to
GCM request property:@hypesystem Please confirm. =)