Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# foreground-service-library-test

# react-native-foreground-service
This is a clone of react-native-foreground-service with a small change. An exception thrown when the priority is parsed in the NotificationHelper.java's buildNotification method is fixed.

A foreground service performs some operation that is noticeable to the user.
For example, an audio app would use a foreground service to play an audio track.
Expand All @@ -11,7 +12,7 @@ See [the Android official documentation](https://developer.android.com/guide/com

## Getting started

`$ npm install @voximplant/react-native-foreground-service --save`
`$ npm install foreground-service-library-test --save`

### Automatic installation (Android only)

Expand Down Expand Up @@ -154,4 +155,4 @@ NotificationConfig
| title | Notification title | yes |
| text | Notification text | yes |
| icon | Icon name | yes |
| priority | Priority of this notification. One of: <ul><li>&nbsp;0 – PRIORITY_DEFAULT (by default)</li><li>-1 – PRIORITY_LOW</li><li>-2 – PRIORITY_MIN</li><li>&nbsp;1 – PRIORITY_HIGH</li><li>&nbsp;2 – PRIORITY_MAX</li></ul> | no |
| priority | Priority of this notification. One of: <ul><li>&nbsp;0 – PRIORITY_DEFAULT (by default)</li><li>-1 – PRIORITY_LOW</li><li>-2 – PRIORITY_MIN</li><li>&nbsp;1 – PRIORITY_HIGH</li><li>&nbsp;2 – PRIORITY_MAX</li></ul> | no |
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Notification buildNotification(Context context, Bundle notificationConfig) {
notificationBuilder = new Notification.Builder(context);
}

int priorityInt = notificationConfig.containsKey("priority") ? notificationConfig.getInt("priority"): Notification.PRIORITY_HIGH;
int priorityInt = notificationConfig.containsKey("priority") ? (int)notificationConfig.getDouble("priority"): Notification.PRIORITY_HIGH;

int priority;
switch (priorityInt) {
Expand Down