This makes a few major changes to greatly simplify the interface of FcmMessage so that it generally covers 90% off the use-case with ease, but still allows it to be used for more advanced use-cases as required.
The attributes of the FcmMessage are given types and made public so that getters are not required,
The validation of custom data is removed and left to the end-user,
Most of the "resource" objects we provided are removed, as they are likely incomplete (not fulfilling the complete API),
Adds test coverage over the new interface.
If you need to build a highly specific custom message to send you can simply return what you like from toFcm instead of using our FcmMessage instance. Alternatively, you can now use custom an instance to instead provide your own additional custom configuration with arrays.
use NotificationChannels\Fcm\FcmMessage;
use NotificationChannels\Fcm\Resources\Notification;
$message = FcmMessage::create()
->name('name')
->notification(Notification::create()->title('title'))
->custom([
'android' => [
// ...
],
]);
This makes a few major changes to greatly simplify the interface of
FcmMessage
so that it generally covers 90% off the use-case with ease, but still allows it to be used for more advanced use-cases as required.FcmMessage
are given types and made public so that getters are not required,If you need to build a highly specific custom message to send you can simply return what you like from
toFcm
instead of using ourFcmMessage
instance. Alternatively, you can now usecustom
an instance to instead provide your own additional custom configuration with arrays.Todo