... | ... | @@ -139,6 +139,25 @@ Icons, icon background colour and vibration can be customised on notifications. |
|
|
B4SSettings.get().setShouldVibrateOnNotification(true);
|
|
|
```
|
|
|
|
|
|
## Dynamic notifications customisation
|
|
|
You have the possibility to let your code modify every notification before they are display to the use.
|
|
|
In order to achieve this, you had to :
|
|
|
# Add the NotificationService.NotificationModifier interface to the class which will be responsible of the notifications customisation.
|
|
|
# Register the previous class with
|
|
|
```java
|
|
|
NotificationService.registerNotificationModifier(this);
|
|
|
```
|
|
|
# Implements the two methods :
|
|
|
```java
|
|
|
public String modifyNotificationTitle(Bundle extras) {
|
|
|
|
|
|
}
|
|
|
|
|
|
public String modifyNotificationMessage(Bundle extras) {
|
|
|
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Android 6
|
|
|
|
|
|
With Android 6.0 (API level 23) a new permission system was introduced by Google. On Android 6 devices, users can manually manage permissions on a per-application basis. If an app targets Android 6 (using targetSdkVersion 23 and compileSdkVersion 23), an app also needs to deal with runtime permissions. This means that permissions such as location access (which is now a so-called 'dangerous' permission) needs to be explicitly requested with a permission request pop-up. Until SDK version 1.4.2, the B4S SDK does not handle this automatically and therefor the integrator needs to [handle permission request dialogs manually](https://developer.android.com/training/permissions/requesting.html).
|
... | ... | |