Closed pratamatama closed 4 years ago
I've implemented this package in my app, I also wrote this question on StackOverflow. Notification works, but it does not gave me all data I needed.
CreatedAgenda.php
return FcmMessage::create() ->setTopic('agenda') ->setData([ 'agenda' => $this->agenda, 'data2' => 'hello world!', 'click_action' => 'FLUTTER_NOTIFICATION_CLICK', ]) ->setNotification($notification) ->setAndroid($androidConfig) ->setApns($iosConfig);
Debug Console (client side)
I/flutter (31507): ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── I/flutter (31507): │ NotificationService: onMessage I/flutter (31507): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄ I/flutter (31507): │ 🐛 { I/flutter (31507): │ 🐛 "notification": { I/flutter (31507): │ 🐛 "title": "Agenda Invitation", I/flutter (31507): │ 🐛 "body": "You've been invited to participate in Wirda's agenda." I/flutter (31507): │ 🐛 }, I/flutter (31507): │ 🐛 "data": { I/flutter (31507): │ 🐛 "click_action": "FLUTTER_NOTIFICATION_CLICK" I/flutter (31507): │ 🐛 } I/flutter (31507): │ 🐛 } I/flutter (31507): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
solved by modifying the script to this:
->setData([ 'data' => json_encode($this->agenda), 'click_action' => 'FLUTTER_NOTIFICATION_CLICK', ])
I've implemented this package in my app, I also wrote this question on StackOverflow. Notification works, but it does not gave me all data I needed.
CreatedAgenda.php
Debug Console (client side)