Commit 59f204d6 by Sebastián Katzer

Adding notifications on iOS does not block the ui thread anymore.

parent 4ea7193a
...@@ -39,6 +39,7 @@ cordova plugin rm de.appplant.cordova.plugin.local-notifications ...@@ -39,6 +39,7 @@ cordova plugin rm de.appplant.cordova.plugin.local-notifications
- [feature:] Sound can be specified under Android. - [feature:] Sound can be specified under Android.
- [enhancement:] Adding notifications on Android does not block the ui thread anymore. - [enhancement:] Adding notifications on Android does not block the ui thread anymore.
- [bugfix:] The app did stop/crash after removing them from recent apps list. - [bugfix:] The app did stop/crash after removing them from recent apps list.
- [enhancement:] Adding notifications on iOS does not block the ui thread anymore.
#### Version 0.6.0 (16.11.2013) #### Version 0.6.0 (16.11.2013)
- Added WP8 support<br> - Added WP8 support<br>
......
...@@ -29,13 +29,15 @@ ...@@ -29,13 +29,15 @@
*/ */
- (void) add:(CDVInvokedUrlCommand*)command - (void) add:(CDVInvokedUrlCommand*)command
{ {
NSArray *arguments = [command arguments]; [self.commandDelegate runInBackground:^{
NSMutableDictionary *options = [arguments objectAtIndex:0]; NSArray *arguments = [command arguments];
UILocalNotification *notification = [self prepareNotification:options]; NSMutableDictionary *options = [arguments objectAtIndex:0];
UILocalNotification *notification = [self prepareNotification:options];
notification.userInfo = [self userDict:options]; notification.userInfo = [self userDict:options];
[[UIApplication sharedApplication] scheduleLocalNotification:notification]; [[UIApplication sharedApplication] scheduleLocalNotification: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