Commit 5c903678 by Sebastián Katzer

Fix `sound:null` on Android

parent 87f29b67
......@@ -27,9 +27,11 @@ Through the [Command-line Interface](http://cordova.apache.org/docs/en/3.0.0/gui
```bash
# from master:
cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications.git
cordova build
# stable version:
cordova plugin add de.appplant.cordova.plugin.local-notification
cordova build
```
## Removing the Plugin from your project
......@@ -55,6 +57,7 @@ More informations can be found [here](https://build.phonegap.com/plugins/413).
- [change:] The `oncancel` callback will be called at last if `autoCancel` is set to true (iOS).
- [bugfix:] Callbacks for non-repeating notifications were not called if they were not created in the current app instance on iOS.
- [enhancement:] Added 'secondly' and 'minutely' as new repeat time aliases.
- [bugfix:] `sound:null` didnt work for Android. The default sound was played.
#### Version 0.7.2 (09.02.2014)
- [enhancement:] Avoid blocking the main thread (on Android) **(dpogue)**.
......
......@@ -147,7 +147,7 @@ public class Options {
}
}
return RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
return null;
}
/**
......
......@@ -117,6 +117,7 @@ public class Receiver extends BroadcastReceiver {
*/
private Builder buildNotification () {
Bitmap icon = BitmapFactory.decodeResource(context.getResources(), options.getIcon());
Uri sound = options.getSound();
Builder notification = new Notification.Builder(context)
.setContentTitle(options.getTitle())
......@@ -125,10 +126,13 @@ public class Receiver extends BroadcastReceiver {
.setTicker(options.getMessage())
.setSmallIcon(options.getSmallIcon())
.setLargeIcon(icon)
.setSound(options.getSound())
.setAutoCancel(options.getAutoCancel())
.setOngoing(options.getOngoing());
if (sound != null) {
notification.setSound(sound);
}
setClickEvent(notification);
return notification;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment