Releases: ker0x/fcm
Releases · ker0x/fcm
v3.2.0
Warning
Version 3.2
introduce a BC break.
The signature of the __construct()
method of the Kerox\Fcm\Model\Message
class has changed, with the $notification
parameter becoming the third argument and being optional.
final class Message
{
- public Notification $notification;
+ public ?Notification $notification = null;
public ?string $token = null;
public ?string $topic = null;
public ?string $condition = null;
/**
* @param array<string, string> $data
*/
public function __construct(
- Notification|string $notification,
Token|Topic|Condition $target,
public array $data = [],
+ Notification|string|null $notification = null,
public ?AndroidConfig $android = null,
public ?WebpushConfig $webpush = null,
public ?ApnsConfig $apns = null,
public ?FcmOptions $fcmOptions = null,
) {
+ if (null !== $notification) {
$this->notification = \is_string($notification)
? new Notification($notification)
: $notification
;
+ }
match (true) {
$target instanceof Token => $this->token = $target->__toString(),
$target instanceof Topic => $this->topic = $target->__toString(),
$target instanceof Condition => $this->condition = $target->__toString(),
};
}
}
Before
$message = new Message(
notification: 'Breaking News',
target: new Topic('TopicA'),
data: [
'story_id' => 'story_12345',
],
);
After
$message = new Message(
target: new Topic('TopicA'),
data: [
'story_id' => 'story_12345',
],
notification: 'Breaking News',
);
What's Changed
Full Changelog: 3.1.0...3.2.0
v3.1.0
3.0.0
2.4.0
What's Changed
- Typo by @tin-cat in #17
- Add PHP 8.1 to CI by @ker0x in #18
- fix: setBadge var type by @demmmmios in #19
- Fix tests by @ker0x in #20
New Contributors
- @tin-cat made their first contribution in #17
- @demmmmios made their first contribution in #19
Full Changelog: 2.3.0...2.4.0
2.3.0
2.2.0
2.1.0
Changelog (since 2.0.0
)
- 2.1.0 (2020-01)
- Change class properties visibility from
protected
toprivate
. - Add new configurations classes
Kerox\Fcm\Model\Message\Notification\AndroidNotification\Color::class
Kerox\Fcm\Model\Message\Notification\AndroidNotification\LightSettings::class
Kerox\Fcm\Model\Message\Notification\ApnsNotification\Sound::class
- Add new options classes
Kerox\Fcm\Model\Message\Options\AndroidOptions::class
Kerox\Fcm\Model\Message\Options\ApnsOptions::class
Kerox\Fcm\Model\Message\Options\WebpushOptions::class
Kerox\Fcm\Model\Message\Notification\AndroidNotification::class
: add new properties$channelId
$ticker
$sticky
$eventTime
$localOnly
$notificationPriority
$defaultSound
$defaultVibrateTimings
$defaultLightSettings
$vibrateTimings
$visibility
$lightSettings
$image
Kerox\Fcm\Model\Message\Notification\ApnsNotification\Alert::class
: add new properties$subTitle
$subTitleLocKey
$subTitleLocArgs
Kerox\Fcm\Model\Message\Android::class
: add new property$options
.Kerox\Fcm\Model\Message\Apns::class
: add new property$options
.- Method
Kerox\Fcm\Model\Message\Webpush::setOptions()
, typearray
is deprecated, use classKerox\Fcm\Model\Message\Options\WebpushOptions::class
instead. - Method
Kerox\Fcm\Model\Message\AbstractNotification\Alert::setActionLocKey()
is deprecated and will be removed in 3.0 with no replacement.
- Change class properties visibility from