flutter_app_badger icon indicating copy to clipboard operation
flutter_app_badger copied to clipboard

Where to add this code if I want to update badge count when notification is received?

Open krishnakirana opened this issue 5 years ago • 2 comments

Hi, I want to update the badge count when a notification is received, including following cases

  1. App is terminated.
  2. App is in background.
  3. App is in foreground

krishnakirana avatar Aug 14 '19 05:08 krishnakirana

@krishnakirana Me also want same functionality i tried this plugin and didn't work in all the device tell me if you find anything.

parth22 avatar Aug 26 '19 04:08 parth22

Isn't the badge something that's send from the backend? I'm using something like below for sending push notification with badge.

	message := &messaging.Message{
		Notification: &messaging.Notification{
			Title: notification.Title,
			Body:  notification.Body,
		},
		Data:  data,
		Token: registrationToken,
		APNS: &messaging.APNSConfig{
			Payload: &messaging.APNSPayload{
				Aps: &messaging.Aps{Badge: &badge},
			},
		},
	}

eripe970 avatar Feb 07 '21 22:02 eripe970