init method
Starts the service, playback and sends a notification with given details albumCover and appIcon can be set to null to use default values. Usage with values given:
- place the desired .png file inside android/app/src/main/res/drawable/
- if filename is app_icon.png then set appIcon value to be "app_icon" This command has to be run before any other. The service will stop on itself when playback is done
Implementation
static Future<void> init(String title, String channel, String url,
String albumCover, String appIcon) async {
String checkIfNull(String toCheck) {
if (toCheck == null) {
return "theGivenResourceIsNull";
} else {
return toCheck;
}
}
await nativeChannel.invokeMethod("startService", {
"title": title,
"channel": channel,
"url": url,
"albumCover": checkIfNull(albumCover),
"appIcon": checkIfNull(appIcon),
});
}