edamov / pushok

PHP client for Apple Push Notification Service (APNs) - Send push notifications to iOS using the new APNs HTTP/2 protocol with token-based (JWT with p8 private key)
MIT License
378 stars 121 forks source link

Change APS Type From Array To Object #84

Closed hnicolas-w closed 4 years ago

hnicolas-w commented 4 years ago

As written in https://github.com/edamov/pushok/issues/82 the library used the JSON_FORCE_OBJECT constant in the Payload::toJson() method. This used to make non-associative array to be outputed as objects

I removed the JSON_FORCE_OBJECT option and kept the JSON_UNESCAPED_UNICODE.

Changing the type of the APS key to object in Payload::getDefaultPayloadStructure() was enough to make sure the key is always outputed as an object in the json.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.01%) to 65.046% when pulling afc097fdf401b7dc587d6867d4a1cc395e99172a on hnicolas-w:master into 3f0d9d30ff6b8ebaf79eb230f177be3ff58a1801 on edamov:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 65.031% when pulling 1f97f0eb80d34a27033be4cf07a805b443d19cb8 on hnicolas-w:master into 3f0d9d30ff6b8ebaf79eb230f177be3ff58a1801 on edamov:master.

hnicolas-w commented 4 years ago

Tell me if it's good for you i will squash the commits :wink:

edamov commented 4 years ago

Good! You can squash and I will merge

hnicolas-w commented 4 years ago

Good! You can squash and I will merge

Done :+1:

edamov commented 4 years ago

@hnicolas-w Great thanks for your PR! I will tag it with v0.7.0

hnicolas-w commented 4 years ago

Thanks to you for the lib! I will gladly continue to contribute :smile: