Correct payload in FCM API's. Background handling notifications on iOS and Android. #6543
Unanswered
designervoid
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I asked a question about the background processing of a cloud message in the Flutter Telegram chat.
One person answered that I only need the correct payload when sending a cURL request (property priority in Android, content_available property in iOS), also that information I found in documenation FireFlutter.
An example of this cURL request:
But there is another payload as well (link).
Which payload variant is considered correct? Both options work correctly.
However, after fixing the payload, sometimes background messages did not work for me. The notification worked, but the processing did not work inside the
FirebaseMessageService
, which is initialized in the widget (not in themain
function), which is displayed as page.Additional Information:
I have PushNotificationService class which have properties of
fcmToken
and methods with listeningforeground
,onclick notification
, background, this methods have parameterRemoteMessage remoteMessage
andVoidCallback callback
.Fixed my removing
onBackgroundMessage
method fromPushNotificationService
tolib/main.dart
:Beta Was this translation helpful? Give feedback.
All reactions