Commit 2f1c9281 by Sebastián Katzer

Update to plugin version 0.8.1

parent 123ccdc3
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<activity android:exported="false" android:launchMode="singleInstance" android:name="de.appplant.cordova.plugin.localnotification.ClickActivity" android:theme="@android:style/Theme.NoDisplay" /> <activity android:exported="false" android:launchMode="singleInstance" android:name="de.appplant.cordova.plugin.localnotification.ClickActivity" android:theme="@android:style/Theme.NoDisplay" />
<receiver android:exported="false" android:name="de.appplant.cordova.plugin.notification.TriggerReceiver" /> <receiver android:exported="false" android:name="de.appplant.cordova.plugin.notification.TriggerReceiver" />
<receiver android:exported="false" android:name="de.appplant.cordova.plugin.notification.ClearReceiver" /> <receiver android:exported="false" android:name="de.appplant.cordova.plugin.notification.ClearReceiver" />
<receiver android:name="de.appplant.cordova.plugin.localnotification.RestoreReceiver"> <receiver android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.RestoreReceiver">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter> </intent-filter>
......
...@@ -31,8 +31,8 @@ module.exports.metadata = ...@@ -31,8 +31,8 @@ module.exports.metadata =
// TOP OF METADATA // TOP OF METADATA
{ {
"nl.x-services.plugins.toast": "2.0.3", "nl.x-services.plugins.toast": "2.0.3",
"de.appplant.cordova.plugin.local-notification": "0.8.0rc2", "de.appplant.cordova.plugin.local-notification": "0.8.1",
"org.apache.cordova.device": "0.3.1-dev" "org.apache.cordova.device": "0.3.0"
} }
// BOTTOM OF METADATA // BOTTOM OF METADATA
}); });
\ No newline at end of file
...@@ -618,7 +618,7 @@ exports.applyPlatformSpecificOptions = function () { ...@@ -618,7 +618,7 @@ exports.applyPlatformSpecificOptions = function () {
switch (device.platform) { switch (device.platform) {
case 'Android': case 'Android':
defaults.icon = 'res://ic_popup_reminder'; defaults.icon = 'res://icon';
defaults.smallIcon = 'res://ic_popup_reminder'; defaults.smallIcon = 'res://ic_popup_reminder';
defaults.ongoing = false; defaults.ongoing = false;
defaults.led = 'FFFFFF'; defaults.led = 'FFFFFF';
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
</author> </author>
<content src="index.html" /> <content src="index.html" />
<access origin="*" /> <access origin="*" />
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
<feature name="Toast"> <feature name="Toast">
<param name="android-package" value="nl.xservices.plugins.Toast" /> <param name="android-package" value="nl.xservices.plugins.Toast" />
</feature> </feature>
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
<feature name="LocalNotification"> <feature name="LocalNotification">
<param name="android-package" value="de.appplant.cordova.plugin.localnotification.LocalNotification" /> <param name="android-package" value="de.appplant.cordova.plugin.localnotification.LocalNotification" />
</feature> </feature>
......
...@@ -43,8 +43,10 @@ public class ClickActivity extends de.appplant.cordova.plugin.notification.Click ...@@ -43,8 +43,10 @@ public class ClickActivity extends de.appplant.cordova.plugin.notification.Click
public void onClick(Notification notification) { public void onClick(Notification notification) {
LocalNotification.fireEvent("click", notification); LocalNotification.fireEvent("click", notification);
if (!notification.isRepeating()) { if (!notification.getOptions().isOngoing()) {
LocalNotification.fireEvent("cancel", notification); String event = notification.isRepeating() ? "clear" : "cancel";
LocalNotification.fireEvent(event, notification);
} }
super.onClick(notification); super.onClick(notification);
......
...@@ -27,6 +27,7 @@ import java.util.ArrayList; ...@@ -27,6 +27,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.cordova.CallbackContext; import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin; import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView; import org.apache.cordova.CordovaWebView;
import org.apache.cordova.PluginResult; import org.apache.cordova.PluginResult;
...@@ -60,9 +61,13 @@ public class LocalNotification extends CordovaPlugin { ...@@ -60,9 +61,13 @@ public class LocalNotification extends CordovaPlugin {
/** /**
* Called after plugin construction and fields have been initialized. * Called after plugin construction and fields have been initialized.
* Prefer to use pluginInitialize instead since there is no value in
* having parameters on the initialize() function.
*
* pluginInitialize is not available for cordova 3.0-3.5 !
*/ */
@Override @Override
protected void pluginInitialize() { public void initialize (CordovaInterface cordova, CordovaWebView webView) {
LocalNotification.webView = super.webView; LocalNotification.webView = super.webView;
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2AAC07D0554694100DB518D"
BuildableName = "libCordova.a"
BlueprintName = "CordovaLib"
ReferencedContainer = "container:CordovaLib.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2AAC07D0554694100DB518D"
BuildableName = "libCordova.a"
BlueprintName = "CordovaLib"
ReferencedContainer = "container:CordovaLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2AAC07D0554694100DB518D"
BuildableName = "libCordova.a"
BlueprintName = "CordovaLib"
ReferencedContainer = "container:CordovaLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>CordovaLib.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>D2AAC07D0554694100DB518D</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:NotificationExample.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>D2EC9BA3-6E07-460E-8F72-D420955A7103</string>
<key>IDESourceControlProjectName</key>
<string>NotificationExample</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>E6A4395732CC1C6C7441E85472223F9AAF3A67CD</key>
<string>github.com:katzer/cordova-plugin-local-notifications.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>platforms/ios/NotificationExample.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>E6A4395732CC1C6C7441E85472223F9AAF3A67CD</key>
<string>../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:katzer/cordova-plugin-local-notifications.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>E6A4395732CC1C6C7441E85472223F9AAF3A67CD</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>E6A4395732CC1C6C7441E85472223F9AAF3A67CD</string>
<key>IDESourceControlWCCName</key>
<string>cordova-example-local-notifications</string>
</dict>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "NotificationExample.app"
BlueprintName = "NotificationExample"
ReferencedContainer = "container:NotificationExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "NotificationExample.app"
BlueprintName = "NotificationExample"
ReferencedContainer = "container:NotificationExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "NotificationExample.app"
BlueprintName = "NotificationExample"
ReferencedContainer = "container:NotificationExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
BuildableName = "NotificationExample.app"
BlueprintName = "NotificationExample"
ReferencedContainer = "container:NotificationExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>NotificationExample.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>1D6058900D05DD3D006BFB54</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
...@@ -501,7 +501,6 @@ ...@@ -501,7 +501,6 @@
&& notification.timeIntervalSinceFireDate > seconds) && notification.timeIntervalSinceFireDate > seconds)
{ {
[self.app cancelLocalNotification:notification]; [self.app cancelLocalNotification:notification];
[self fireEvent:@"cancel" notification:notification]; [self fireEvent:@"cancel" notification:notification];
} }
} }
...@@ -527,8 +526,12 @@ ...@@ -527,8 +526,12 @@
[self fireEvent:event notification:notification]; [self fireEvent:event notification:notification];
if ([event isEqualToString:@"click"] && ![notification isRepeating]) if (![event isEqualToString:@"click"])
{ return;
if ([notification isRepeating]) {
[self fireEvent:@"clear" notification:notification];
} else {
[self.app cancelLocalNotification:notification]; [self.app cancelLocalNotification:notification];
[self fireEvent:@"cancel" notification:notification]; [self fireEvent:@"cancel" notification:notification];
} }
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
</author> </author>
<content src="index.html" /> <content src="index.html" />
<access origin="*" /> <access origin="*" />
<feature name="Toast">
<param name="ios-package" value="Toast" />
</feature>
<feature name="Device"> <feature name="Device">
<param name="ios-package" value="CDVDevice" /> <param name="ios-package" value="CDVDevice" />
</feature> </feature>
...@@ -30,7 +33,4 @@ ...@@ -30,7 +33,4 @@
<param name="ios-package" onload="true" value="APPLocalNotification" /> <param name="ios-package" onload="true" value="APPLocalNotification" />
<param name="onload" value="true" /> <param name="onload" value="true" />
</feature> </feature>
<feature name="Toast">
<param name="ios-package" value="Toast" />
</feature>
</widget> </widget>
cordova.define('cordova/plugin_list', function(require, exports, module) { cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [ module.exports = [
{ {
"file": "plugins/de.appplant.cordova.plugin.local-notification/www/local-notification.js",
"id": "de.appplant.cordova.plugin.local-notification.LocalNotification",
"clobbers": [
"cordova.plugins.notification.local",
"plugin.notification.local"
]
},
{
"file": "plugins/nl.x-services.plugins.toast/www/Toast.js", "file": "plugins/nl.x-services.plugins.toast/www/Toast.js",
"id": "nl.x-services.plugins.toast.Toast", "id": "nl.x-services.plugins.toast.Toast",
"clobbers": [ "clobbers": [
...@@ -20,6 +12,14 @@ module.exports = [ ...@@ -20,6 +12,14 @@ module.exports = [
"id": "nl.x-services.plugins.toast.tests" "id": "nl.x-services.plugins.toast.tests"
}, },
{ {
"file": "plugins/de.appplant.cordova.plugin.local-notification/www/local-notification.js",
"id": "de.appplant.cordova.plugin.local-notification.LocalNotification",
"clobbers": [
"cordova.plugins.notification.local",
"plugin.notification.local"
]
},
{
"file": "plugins/org.apache.cordova.device/www/device.js", "file": "plugins/org.apache.cordova.device/www/device.js",
"id": "org.apache.cordova.device.device", "id": "org.apache.cordova.device.device",
"clobbers": [ "clobbers": [
...@@ -30,9 +30,9 @@ module.exports = [ ...@@ -30,9 +30,9 @@ module.exports = [
module.exports.metadata = module.exports.metadata =
// TOP OF METADATA // TOP OF METADATA
{ {
"de.appplant.cordova.plugin.local-notification": "0.8.0rc2",
"nl.x-services.plugins.toast": "2.0.3", "nl.x-services.plugins.toast": "2.0.3",
"org.apache.cordova.device": "0.3.1-dev" "de.appplant.cordova.plugin.local-notification": "0.8.1",
"org.apache.cordova.device": "0.3.0"
} }
// BOTTOM OF METADATA // BOTTOM OF METADATA
}); });
\ No newline at end of file
...@@ -618,7 +618,7 @@ exports.applyPlatformSpecificOptions = function () { ...@@ -618,7 +618,7 @@ exports.applyPlatformSpecificOptions = function () {
switch (device.platform) { switch (device.platform) {
case 'Android': case 'Android':
defaults.icon = 'res://ic_popup_reminder'; defaults.icon = 'res://icon';
defaults.smallIcon = 'res://ic_popup_reminder'; defaults.smallIcon = 'res://ic_popup_reminder';
defaults.ongoing = false; defaults.ongoing = false;
defaults.led = 'FFFFFF'; defaults.led = 'FFFFFF';
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
"parents": { "parents": {
"/*": [ "/*": [
{ {
"xml": "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>", "xml": "<feature name=\"Toast\"><param name=\"android-package\" value=\"nl.xservices.plugins.Toast\" /></feature>",
"count": 1 "count": 1
}, },
{ {
"xml": "<feature name=\"Toast\"><param name=\"android-package\" value=\"nl.xservices.plugins.Toast\" /></feature>", "xml": "<feature name=\"Device\"><param name=\"android-package\" value=\"org.apache.cordova.device.Device\" /></feature>",
"count": 1 "count": 1
}, },
{ {
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
"count": 1 "count": 1
}, },
{ {
"xml": "<receiver android:name=\"de.appplant.cordova.plugin.localnotification.RestoreReceiver\"><intent-filter><action android:name=\"android.intent.action.BOOT_COMPLETED\" /></intent-filter></receiver>", "xml": "<receiver android:exported=\"false\" android:name=\"de.appplant.cordova.plugin.localnotification.RestoreReceiver\"><intent-filter><action android:name=\"android.intent.action.BOOT_COMPLETED\" /></intent-filter></receiver>",
"count": 1 "count": 1
}, },
{ {
......
## ChangeLog ChangeLog
#### Version 0.8.0 (not yet released) ---------
- [feature:] New method `hasPermission` to ask if the user has granted to display local notifications.
- [feature:] New method `registerPermission` to register permission to display local notifications. Please also read the [Upgrade Guide](https://github.com/katzer/cordova-plugin-local-notifications/wiki/Upgrade-Guide) for more information.
- [feature:] New Android specific `led:` flag.
- [feature:] Add `isTriggered` & `getTriggeredIds` methods. #### Version 0.8.1 (08.03.2015)
- [enhancement:] iOS8 support.
- [enhancement:] Android 2.x (SDK >= 7) support (Thanks to **khizarsonu**) - Fix incompatibility with cordova version 3.5-3.0
- [enhancement:] Scope parameter for `isScheduled` and `getScheduledIds` - Fire `clear` instead of `cancel` event when clicked on repeating notifications
- [enhancement:] Callbacks for `add`, `cancel` & `cancelAll` - Do not fire `clear` or `cancel` event when clicked on persistent notifications
- [enhancement:] `image:` accepts remote URLs and local URIs (Android)
- [enhancement:] Schedule multiple notifications at once ### Version 0.8.0 (05.03.2015)
- [enhancement:] Cancel multiple notifications at once
- [enhancement:] Clear multiple notifications at once (Android) - Support for iOS 8, Android 2 (SDK >= 7) and Android 5
- [enhancement:] `clear` & `clearAll` methods (Android) - Windows Phone 8.1 will be added soon
- [enhancement:] `onclear` event (Android) - New interfaces to ask for / register permissions required to schedule local notifications
- [enhancement:] Modal dialogs when in foreground (Android) - `hasPermission()` and `registerPermission()`
- [enhancement:] Ability to change repeating notifications (Android) - _schedule()_ will register the permission automatically and schedule the notification if granted.
- [enhancement:] `sound:` accepts local URIs for absolute (file:///), relative (file://) and resource path (res:). (Android) - New interface to update already scheduled|triggered local notifications
- `update()`
#### Version 0.7.4 (22.03.2014) - New interfaces to clear the notification center
- [bugfix:] Platform specific properties were ignored. - `clear()` and `clearAll()`
- [bugfix:] `cancel` may throw an error if the OS returns NIL values (iOS). - New interfaces to query for local notifications, their properties, their IDs and their existence depend on their state
- [bugfix:] Replacing a notification with the same ID may result into canceling both (iOS). - `isPresent()`, `isScheduled()`, `isTriggered()`
- [bugfix:] Missing `deviceready` method (WP8). - `getIds()`, `getAllIds()`, `getScheduledIds()`, `getTriggeredIds()`
- `get()`, `getAll()`, `getScheduled()`, `getTriggered()`
#### Version 0.7.3 (16.03.2014) - Schedule multiple local notifications at once
- [bugfix:] cancel callbacks have not been fired after all notifications have been canceled on iOS. - `schedule( [{...},{...}] )`
- [change:] The `oncancel` callback will be called at last if `autoCancel` is set to true (iOS). - Update multiple local notifications at once
- [bugfix:] Callbacks for non-repeating notifications were not called if they were not created in the current app instance on iOS. - `update( [{...},{...}] )`
- [enhancement:] Added 'secondly' and 'minutely' as new repeat time aliases. - Clear multiple local notifications at once
- [bugfix:] `sound:null` didnt work for Android. The default sound was played. - `clear( [1, 2] )`
- [feature:] New interface `isScheduled` to check wether a notification with an ID is pending. - Cancel multiple local notifications at once
- [feature:] New interface `getScheduledIds` to retrieve a list with all currently pending notifications. - `cancel( [1, 2] )`
- [enhancement:] Support for bigview style notifications for Android devices. - New URI format to specify sound and image resources
- [bugfix:] Sound didnt play properly on iOS/Android. - `http(s):` for remote resources _(Android)_
- [bugfix:] click event on iOS wasn't fired if app was not running. - `file:` for local resources relative to the _www_ folder
- [enhancement:] GET_TASK permission not needed anymore for Android. - `res:` for native resources
- New events
#### Version 0.7.2 (09.02.2014) - `schedule`, `update`, `clear`, `clearall` and `cancelall`
- [enhancement:] Avoid blocking the main thread (on Android) **(dpogue)**. - Enhanced event informations
- [bugfix:] `onadd` was called each time after a repeating message was triggered (Android) - Listener will get called with the local notification object instead of only the ID
- [change:] Reset badge with cancelAll. - Multiple listener for one event
- [bugfix:] `onclick` instead of `ontrigger` was called on "slow" iOS devices. - `on(event, callback, scope)`
- Unregister event listener
#### Version 0.7.1 (31.01.2014) - `un(event, callback)`
- [bugfix:] `ongoing` attribute was ignored. - New Android specific properties
- [bugfix:] `oncancel` wasnt fired if `autoCancel` was set to true. - `led` properties
- [bugfix:] App throwed an error at restart if a callback was registered. - `sound` and `image` accepts remote resources
- Callback function and scope for all interface methods
#### Version 0.7.0 (22.01.2014) - `schedule( notification, callback, scope )`
**Note:** The new way of callback registration will be not compatible with previous versions! See #62 - Renamed `add()` to `schedule()`
- **[feature:]** Added new callback registration interface and new callback types. - `autoCancel` property has been removed
- [feature:] Added the ability to override notifications default properties. - Use `ongoing: true` for persistent local notifications on Android
- [bugfix:] Fixed build failure if iOS/MacOS/Xcode were to old (#68). - Renamed repeat intervals
- **[change]** The message and not the title will be used as the ticker text. - `second`, `minute`, `hour`, `day`, `week`, `month` and `year`
- Renamed some local notification properties
#### Version 0.7.0beta1 (17.01.2014) - `date`, `json`, `message` and `repeat`
- [bugfix:] App throws an error on iOS if `message` is null. - Scheduling local notifications with the deprecated properties is still possible
- [bugfix:] Removed extra line break on iOS if `title` is null or empty. - [Kitchen Sink sample app](https://github.com/katzer/cordova-plugin-local-notifications/tree/example)
- [bugfix:] Notification on iOS will be canceled if a new one with the same ID was added. - [Wiki](https://github.com/katzer/cordova-plugin-local-notifications/wiki)
- [feature:] Added `autoCancel` flag.
- [bugfix:] `cancel` on iOS did not work.
- [enhancement:] Added 'hourly' as a new repeat time aliase.
- [enhancement:] Repeat with custom intervals on Android.
- **[change:]** Callbacks are called with the ID as a number and not as a string.
- [enhancement:] The background callback on Android is called, even the app is not running when the notification is tapped.
- [enhancement:] Notifications are repeated more precisely.
- [feature:] Added `json` property to pass custom data through the notification.
- [enhancement:] Added Android specific property `smallImage`.
- [enhancement:] Added Android specific property `ongoing`.
- [enhancement:] Setting launchMode to *singleInstance* isn't necessary anymore.
#### Version 0.6.3 (12.12.2013)
- [bugfix:] Black screen on Android.
- [bugfix:] App throws an error on reboot on Android.
- [enhancement:] Calling `cancel` on Android with an invalid String as ID does not throw an error anymore.
#### Version 0.6.2 (04.12.2013)
- Release under the Apache 2.0 license.
#### Version 0.6.1 (04.12.2013)
- Release under the LGPL 2.1 license.
- [feature:] Sound can be specified on Android.
- [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.
- [enhancement:] Adding notifications on iOS does not block the ui thread anymore.
- [bugfix:] Added missing `RECEIVE_BOOT_COMPLETED`permission on Android.
- [enhancement:] Rework the code for Android. Thanks to ***samsara (samsarayg)***.
- [bugfix:] `cancel` on iOS did not work do to wrong param type.
- [enhancement:] `cancel` & `cancelAll` remove the notification(s) from notification center as well on Android.
- [bugfix:] Missing background callback on Android.
- [bugfix:] Android notification is not shown when the app is not running.
#### Version 0.6.0 (16.11.2013)
- Added WP8 support<br>
*Based on the LiveTiles WP8 plugin made by* ***Jesse MacFadyen (purplecabbage)***
- [enhancement:] The `add()` function now returns the id of the created notification.
- [feature:] Added new `title` property.
- [bugfix:] `cancel` on iOS did not work do to wrong dict key.
- [enhancement:] All notifications on Android display the app icon by default.
- [feature:] Icon can be specified on Android.
#### Version 0.4.0 (06.10.2013)
- Added Android support<br>
*Based on the LocalNotifications Android plugin made by* ***Daniël (dvtoever)***
#### Version 0.2.0 (11.08.2013)
- Added iOS support<br>
*Based on the LocalNotifications iOS plugin made by* ***Rodrigo Moyle***
\ No newline at end of file
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
id="de.appplant.cordova.plugin.local-notification" id="de.appplant.cordova.plugin.local-notification"
version="0.8.0rc2"> version="0.8.1">
<name>LocalNotification</name> <name>LocalNotification</name>
<description>The purpose of the plugin is to create an platform independent javascript interface for Cordova based mobile applications to access the specific Notification API on each platform.</description> <description>The plugin supports scheduling local notifications in various ways with a single interface. It also allows you to update, clear or cancel them. There are different interfaces to query for local notifications and a complete set of events to hook into the life cycle of local notifications. To get a deep overview we recommend to read about all the topics in our wiki and try out the Kitchen Sink App</description>
<repo>https://github.com/katzer/cordova-plugin-local-notifications.git</repo> <repo>https://github.com/katzer/cordova-plugin-local-notifications.git</repo>
...@@ -25,6 +25,14 @@ ...@@ -25,6 +25,14 @@
<!-- dependencies --> <!-- dependencies -->
<dependency id="org.apache.cordova.device" /> <dependency id="org.apache.cordova.device" />
<!-- info -->
<info>
Your support is needed. If you use the plugin please support us in order to ensure further development.
https://github.com/katzer/cordova-plugin-local-notifications/tree/example#how-can-i-support-the-further-development
Thank you!
</info>
<!-- js --> <!-- js -->
<js-module src="www/local-notification.js" name="LocalNotification"> <js-module src="www/local-notification.js" name="LocalNotification">
<clobbers target="cordova.plugins.notification.local" /> <clobbers target="cordova.plugins.notification.local" />
...@@ -91,7 +99,7 @@ ...@@ -91,7 +99,7 @@
android:name="de.appplant.cordova.plugin.notification.ClearReceiver" android:name="de.appplant.cordova.plugin.notification.ClearReceiver"
android:exported="false" /> android:exported="false" />
<receiver android:name="de.appplant.cordova.plugin.localnotification.RestoreReceiver" > <receiver android:name="de.appplant.cordova.plugin.localnotification.RestoreReceiver" android:exported="false" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter> </intent-filter>
......
...@@ -43,8 +43,10 @@ public class ClickActivity extends de.appplant.cordova.plugin.notification.Click ...@@ -43,8 +43,10 @@ public class ClickActivity extends de.appplant.cordova.plugin.notification.Click
public void onClick(Notification notification) { public void onClick(Notification notification) {
LocalNotification.fireEvent("click", notification); LocalNotification.fireEvent("click", notification);
if (!notification.isRepeating()) { if (!notification.getOptions().isOngoing()) {
LocalNotification.fireEvent("cancel", notification); String event = notification.isRepeating() ? "clear" : "cancel";
LocalNotification.fireEvent(event, notification);
} }
super.onClick(notification); super.onClick(notification);
......
...@@ -27,6 +27,7 @@ import java.util.ArrayList; ...@@ -27,6 +27,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.cordova.CallbackContext; import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin; import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView; import org.apache.cordova.CordovaWebView;
import org.apache.cordova.PluginResult; import org.apache.cordova.PluginResult;
...@@ -60,9 +61,13 @@ public class LocalNotification extends CordovaPlugin { ...@@ -60,9 +61,13 @@ public class LocalNotification extends CordovaPlugin {
/** /**
* Called after plugin construction and fields have been initialized. * Called after plugin construction and fields have been initialized.
* Prefer to use pluginInitialize instead since there is no value in
* having parameters on the initialize() function.
*
* pluginInitialize is not available for cordova 3.0-3.5 !
*/ */
@Override @Override
protected void pluginInitialize() { public void initialize (CordovaInterface cordova, CordovaWebView webView) {
LocalNotification.webView = super.webView; LocalNotification.webView = super.webView;
} }
......
...@@ -501,7 +501,6 @@ ...@@ -501,7 +501,6 @@
&& notification.timeIntervalSinceFireDate > seconds) && notification.timeIntervalSinceFireDate > seconds)
{ {
[self.app cancelLocalNotification:notification]; [self.app cancelLocalNotification:notification];
[self fireEvent:@"cancel" notification:notification]; [self fireEvent:@"cancel" notification:notification];
} }
} }
...@@ -527,8 +526,12 @@ ...@@ -527,8 +526,12 @@
[self fireEvent:event notification:notification]; [self fireEvent:event notification:notification];
if ([event isEqualToString:@"click"] && ![notification isRepeating]) if (![event isEqualToString:@"click"])
{ return;
if ([notification isRepeating]) {
[self fireEvent:@"clear" notification:notification];
} else {
[self.app cancelLocalNotification:notification]; [self.app cancelLocalNotification:notification];
[self fireEvent:@"cancel" notification:notification]; [self fireEvent:@"cancel" notification:notification];
} }
......
...@@ -618,7 +618,7 @@ exports.applyPlatformSpecificOptions = function () { ...@@ -618,7 +618,7 @@ exports.applyPlatformSpecificOptions = function () {
switch (device.platform) { switch (device.platform) {
case 'Android': case 'Android':
defaults.icon = 'res://ic_popup_reminder'; defaults.icon = 'res://icon';
defaults.smallIcon = 'res://ic_popup_reminder'; defaults.smallIcon = 'res://ic_popup_reminder';
defaults.ongoing = false; defaults.ongoing = false;
defaults.led = 'FFFFFF'; defaults.led = 'FFFFFF';
......
...@@ -4,5 +4,11 @@ ...@@ -4,5 +4,11 @@
"type": "local", "type": "local",
"path": "/Users/sebastian/Documents/github/cordova-plugin-local-notifications" "path": "/Users/sebastian/Documents/github/cordova-plugin-local-notifications"
} }
},
"org.apache.cordova.device": {
"source": {
"type": "registry",
"id": "org.apache.cordova.device"
}
} }
} }
\ No newline at end of file
...@@ -9,15 +9,15 @@ ...@@ -9,15 +9,15 @@
"parents": { "parents": {
"/*": [ "/*": [
{ {
"xml": "<feature name=\"Device\"><param name=\"ios-package\" value=\"CDVDevice\" /></feature>", "xml": "<feature name=\"Toast\"><param name=\"ios-package\" value=\"Toast\" /></feature>",
"count": 1 "count": 1
}, },
{ {
"xml": "<feature name=\"LocalNotification\"><param name=\"ios-package\" onload=\"true\" value=\"APPLocalNotification\" /><param name=\"onload\" value=\"true\" /></feature>", "xml": "<feature name=\"Device\"><param name=\"ios-package\" value=\"CDVDevice\" /></feature>",
"count": 1 "count": 1
}, },
{ {
"xml": "<feature name=\"Toast\"><param name=\"ios-package\" value=\"Toast\" /></feature>", "xml": "<feature name=\"LocalNotification\"><param name=\"ios-package\" onload=\"true\" value=\"APPLocalNotification\" /><param name=\"onload\" value=\"true\" /></feature>",
"count": 1 "count": 1
} }
] ]
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
} }
}, },
"installed_plugins": { "installed_plugins": {
"de.appplant.cordova.plugin.local-notification": { "nl.x-services.plugins.toast": {
"PACKAGE_NAME": "de.appplant.cordova.plugin.local-notification.example" "PACKAGE_NAME": "de.appplant.cordova.plugin.local-notification.example"
}, },
"nl.x-services.plugins.toast": { "de.appplant.cordova.plugin.local-notification": {
"PACKAGE_NAME": "de.appplant.cordova.plugin.local-notification.example" "PACKAGE_NAME": "de.appplant.cordova.plugin.local-notification.example"
} }
}, },
......
{"source":{"type":"git","url":"https://github.com/apache/cordova-plugin-device","subdir":"."}}
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
xmlns:rim="http://www.blackberry.com/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
id="org.apache.cordova.device" id="org.apache.cordova.device"
version="0.3.1-dev"> version="0.3.0">
<name>Device</name> <name>Device</name>
<description>Cordova Device Plugin</description> <description>Cordova Device Plugin</description>
<license>Apache 2.0</license> <license>Apache 2.0</license>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
xmlns:rim="http://www.blackberry.com/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
id="org.apache.cordova.device.tests" id="org.apache.cordova.device.tests"
version="0.3.1-dev"> version="0.2.14">
<name>Cordova Device Plugin Tests</name> <name>Cordova Device Plugin Tests</name>
<license>Apache 2.0</license> <license>Apache 2.0</license>
......
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