Skip to content

Commit

Permalink
Rename icon to notiticationIcon and add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
manuquentin committed Nov 23, 2020
1 parent d7c65cc commit b8bc891
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const options = {
channelId: 'com.company.my',
channelName: 'Foreground service for my app',
notificationTitle: 'My app is running on background',
notiticationIcon: 'Path to the resource icon of the notification',
},
}
};
Expand Down Expand Up @@ -141,6 +142,7 @@ RNCallKeep.setForegroundServiceSettings({
channelId: 'com.company.my',
channelName: 'Foreground service for my app',
notificationTitle: 'My app is running on background',
notiticationIcon: 'Path to the resource icon of the notification',
});
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ private void startForegroundService() {
.setPriority(NotificationManager.IMPORTANCE_MIN)
.setCategory(Notification.CATEGORY_SERVICE);

if (foregroundSettings.hasKey("icon")) {
if (foregroundSettings.hasKey("notificationIcon")) {
Context context = this.getApplicationContext();
Resources res = context.getResources();
String smallIcon = foregroundSettings.getString("icon");
String smallIcon = foregroundSettings.getString("notificationIcon");
notificationBuilder.setSmallIcon(res.getIdentifier(smallIcon, "mipmap", context.getPackageName()));
}

Expand Down

0 comments on commit b8bc891

Please sign in to comment.