plokko / firebase-php

Php integration of Firebase API (FCM Http v1, RealTime database)
16 stars 9 forks source link

ApnsConfig #5

Closed xhooch closed 5 years ago

xhooch commented 5 years ago

https://github.com/plokko/firebase-php/blob/master/src/FCM/Message/ApnsConfig.php#L28 This will throw an exception (InvalidArgumentException)

The JSON dictionary object must contain an aps key, the value of which is a dictionary containing data used by the system to deliver the notification.

For example https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW1

plokko commented 5 years ago

I refactored a little the code, now ApnsConfig contains ApnsPayload (more intuitive). I now understood the problem: Firebase doc does not specify ApnsPayload implementation and Apple's documentation was a little confusing.

Will release a patch soon 👍

plokko commented 5 years ago

Ok, i added a ApsData in ApnsPayload to manage aps Apple's specific keywords, should be ok now. Do test and report back please!

xhooch commented 5 years ago

Thanks. It's work.