Commit 00fe2003 by Sebastián Katzer

Back-port PR's from master

parent c02c926a
## ChangeLog
#### Version 0.7.6 (03.10.2014)
- [bugfix:] `hasPermission` and `promptForPermission` let the app crash on iOS7 and older.
- [bugfix:] Convert the id value to a String before comparison.
- [bugfix:] Prevent possible crash when calling `cancelAll`.
- [enhancement:] Do not inherit any notification defaults.
#### Version 0.7.5 (29.09.2014)
- [enhancement:] __iOS8 Support__
- [feature:] New method `hasPermission` to ask if the user has granted to display local notifications.
......
......@@ -70,6 +70,12 @@ More informations can be found [here][PGB_plugin].
## ChangeLog
#### Version 0.7.6 (03.10.2014)
- [bugfix:] `hasPermission` and `promptForPermission` let the app crash on iOS7 and older.
- [bugfix:] Convert the id value to a String before comparison.
- [bugfix:] Prevent possible crash when calling `cancelAll`.
- [enhancement:] Do not inherit any notification defaults.
#### Version 0.7.5 (29.09.2014)
- [enhancement:] __iOS8 Support__
- [feature:] New method `hasPermission` to ask if the user has granted to display local notifications.
......
......@@ -122,6 +122,7 @@ public class Receiver extends BroadcastReceiver {
Uri sound = options.getSound();
Builder notification = new Notification.Builder(context)
.setDefaults(0) // Do not inherit any defaults
.setContentTitle(options.getTitle())
.setContentText(options.getMessage())
.setNumber(options.getBadge())
......@@ -130,7 +131,7 @@ public class Receiver extends BroadcastReceiver {
.setLargeIcon(icon)
.setAutoCancel(options.getAutoCancel())
.setOngoing(options.getOngoing());
if (sound != null) {
notification.setSound(sound);
}
......@@ -139,7 +140,7 @@ public class Receiver extends BroadcastReceiver {
notification.setStyle(new Notification.BigTextStyle()
.bigText(options.getMessage()));
}
setClickEvent(notification);
return notification;
......
......@@ -102,11 +102,14 @@
NSArray* arguments = [command arguments];
NSMutableDictionary* properties = [arguments objectAtIndex:0];
UILocalNotification* notification;
NSString* id = [properties objectForKey:@"id"];
if ([self isNotificationScheduledWithId:id]) {
UILocalNotification* notification = [self notificationWithId:id];
notification = [self notificationWithId:id];
}
if (notification) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC),
dispatch_get_main_queue(), ^{
[self cancelNotification:notification fireEvent:NO];
......@@ -576,7 +579,8 @@
for (UILocalNotification* notification in notifications)
{
NSString* notId = [notification.userInfo objectForKey:@"id"];
NSString* notId = [[notification.userInfo objectForKey:@"id"]
stringValue];
if ([notId isEqualToString:id]) {
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