Skip to content

Commit

Permalink
docs(android): clarify foregroundServiceType AndroidManifest example
Browse files Browse the repository at this point in the history
  • Loading branch information
jektvik authored and mikehardy committed Oct 16, 2024
1 parent 75d494f commit f13c5e6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions docs-react-native/react-native/docs/android/foreground-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,16 @@ You may need access to either location, camera or microphone information in your
To specify which service types you require, add `notifee`'s foreground service to your `AndroidManifest.xml`:

```xml
<manifest>
...
<!-- For example, with one service type -->
<service android:name="app.notifee.core.ForegroundService" android:foregroundServiceType="location" tools:replace="android:foregroundServiceType" />

<!-- Or, with multiple service types -->
<service android:name="app.notifee.core.ForegroundService" android:foregroundServiceType="location|camera|microphone" tools:replace="android:foregroundServiceType" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<application>
...
<!-- For example, with one service type -->
<service android:name="app.notifee.core.ForegroundService" android:foregroundServiceType="location" tools:replace="android:foregroundServiceType" />

<!-- Or, with multiple service types -->
<service android:name="app.notifee.core.ForegroundService" android:foregroundServiceType="location|camera|microphone" tools:replace="android:foregroundServiceType" />
...
</application>
</manifest>
```

Expand All @@ -211,4 +214,4 @@ notifee.displayNotification({

If no [foregroundServiceTypes](/react-native/docs/android/interaction#quick-actions) property is provided, the types are taken from the manifest.

If any permission was granted while running the service, the same notification (with the same notification ID and same channel ID) can be posted again with the new `foregroundServiceTypes` property array with the same notification ID and the current running service will be updated with the new types.
If any permission was granted while running the service, the same notification (with the same notification ID and same channel ID) can be posted again with the new `foregroundServiceTypes` property array with the same notification ID and the current running service will be updated with the new types.

0 comments on commit f13c5e6

Please sign in to comment.