Skip to content

Commit 14771fe

Browse files
Added few specific points
1 parent 15cacd3 commit 14771fe

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

notifications/flutter-push-notifications-android.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ final androidDetails = AndroidNotificationDetails(
292292

293293
### 6.5 Clear badge and notifications when the app opens
294294

295-
Clear the badge count and dismiss all local notifications when the app launches and every time it resumes from the background. Add `WidgetsBindingObserver` to your dashboard or root widget:
295+
Clear the badge count and dismiss all local notifications when the app launches and every time it resumes from the background. Add `WidgetsBindingObserver` to your root widget and register/remove the observer in `initState()` and `dispose()`:
296296

297297
```dart lines
298298
Future<void> _clearBadge() async {

notifications/flutter-push-notifications-ios.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,13 @@ dependencies:
127127
permission_handler: ^11.3.0
128128
```
129129
130-
Run `flutter pub get`, then `flutterfire configure` if you still need to generate `firebase_options.dart`.
130+
Run `flutter pub get`, then install the native pods:
131+
132+
```bash
133+
cd ios && pod install && cd ..
134+
```
135+
136+
Then run `flutterfire configure` if you still need to generate `firebase_options.dart`.
131137

132138
## 5. Configure the native iOS layer
133139

@@ -236,7 +242,11 @@ dependencies:
236242
app_badge_plus: ^1.2.6
237243
```
238244

239-
Run `flutter pub get`.
245+
Run `flutter pub get`, then install the native pods:
246+
247+
```bash
248+
cd ios && pod install && cd ..
249+
```
240250

241251
### 7.2 Update the badge from local notifications
242252

@@ -261,7 +271,7 @@ On iOS, `app_badge_plus` sets the native `UIApplication.shared.applicationIconBa
261271

262272
### 7.3 Clear badge and notifications when the app opens
263273

264-
This is required regardless of whether you use APNs or FCM. Clear the badge count and dismiss all local notifications when the app launches and every time it resumes from the background. Add `WidgetsBindingObserver` to your dashboard or root widget:
274+
This is required regardless of whether you use APNs or FCM. Clear the badge count and dismiss all local notifications when the app launches and every time it resumes from the background. Add `WidgetsBindingObserver` to your root widget and register/remove the observer in `initState()` and `dispose()`:
265275

266276
```dart lines
267277
Future<void> _clearBadge() async {

0 commit comments

Comments
 (0)