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
369 stars 119 forks source link

i need add custom key/value to aps #50

Closed shnuzxw closed 5 years ago

shnuzxw commented 5 years ago

image

shnuzxw commented 5 years ago

please add function to do this event

koenhoeijmakers commented 5 years ago

This is not possible (apns does not allow this).

You can use the following to add the custom data (but outside of the aps key).

$payload->setCustomValue('biz', [
    'amount' => 0.01,
    ... (other values)
]);
shnuzxw commented 5 years ago

The image is our biz online, five years。 I want to test apns,i will use pushok,but i can not put biz to aps。

edamov commented 5 years ago

You should use setCustomValue method as was mentioned above