mac-cain13 / notificato

Takes care of Apple push notifications (APNS) in your PHP projects.
MIT License
224 stars 44 forks source link

Support for variable length of push token #64

Closed Tayfun74 closed 5 years ago

Tayfun74 commented 5 years ago

Hi,

Using Notificato we received some push tokens that were not a hexadecimal with a length of 64. In the APNs documentation it says:

IMPORTANT
APNs device tokens are of variable length. Do not hard-code their size.

Is there a specific reason to check on the length. Can you remove this check otherwise?

// Check if the length of the devicetoken is correct
if (64 != strlen($deviceToken)) {
     throw new \InvalidArgumentException('Invalid device token given, incorrect length: ' . $deviceToken . ' (' . strlen($deviceToken) . ')');
}
mac-cain13 commented 5 years ago

Seems this has changed over time. Think this check should be removed, would you be able to submit a PR with this code removed and a link to the docs? Then I can merge it and release a new version.

Tayfun74 commented 5 years ago

Yes can you give me the permission to push?

mac-cain13 commented 5 years ago

You can fork this repo and then create a pull request from your fork to this one. See also: https://help.github.com/en/articles/creating-a-pull-request-from-a-fork

Or just look up the file you need to change in this repo on GitHub.com en hit edit, then GitHub will guide you through the fork & create PR flow.

Tayfun74 commented 5 years ago

Done https://github.com/mac-cain13/notificato/pull/65.

mac-cain13 commented 5 years ago

Released your change in version 1.2.1