Commit fa410a84 by Sebastián Katzer

Update project

parent d069f808
......@@ -109,26 +109,6 @@
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="cordova-example-local-notifications" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="cordova-example-local-notifications" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="android" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="AndroidView">
<subPane>
<PATH>
......@@ -172,6 +152,26 @@
</subPane>
</pane>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="cordova-example-local-notifications" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="cordova-example-local-notifications" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="android" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
</panes>
</component>
<component name="PropertiesComponent">
......@@ -189,7 +189,7 @@
<property name="android.project.structure.proportion" value="0.15" />
<property name="recentsLimit" value="5" />
<property name="restartRequiresConfirmation" value="true" />
<property name="ANDROID_EXTENDED_DEVICE_CHOOSER_SERIALS" value="emulator-5554" />
<property name="ANDROID_EXTENDED_DEVICE_CHOOSER_SERIALS" value="" />
<property name="ANDROID_EXTENDED_DEVICE_CHOOSER_AVD" value="Nexus_5_API_21" />
<property name="FullScreen" value="false" />
</component>
......@@ -323,13 +323,12 @@
</option>
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1440" height="809" extended-state="6" />
<frame x="0" y="23" width="1440" height="809" extended-state="0" />
<editor active="false" />
<layout>
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3997114" sideWeight="0.46280402" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32900432" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
......@@ -337,18 +336,19 @@
<window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32900432" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32756132" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Android" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32756132" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Android" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32756132" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2532189" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.21888413" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22460657" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32756132" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Memory Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3997114" sideWeight="0.53648067" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32756132" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
......
......@@ -10,16 +10,16 @@
</intent-filter>
</activity>
<service android:name="de.appplant.cordova.plugin.background.ForegroundService" />
<receiver android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.TriggerReceiver" />
<receiver android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.ClearReceiver" />
<activity 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.ClearReceiver" />
<receiver android:name="de.appplant.cordova.plugin.localnotification.RestoreReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.TriggerReceiver" />
<receiver android:exported="false" android:name="de.appplant.cordova.plugin.localnotification.ClearReceiver" />
<activity 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.ClearReceiver" />
<activity android:launchMode="singleInstance" android:name="de.appplant.cordova.plugin.notification.ClickActivity" android:theme="@android:style/Theme.NoDisplay" />
</application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="21" />
......
......@@ -169,7 +169,7 @@
<script type="text/javascript">
schedule = function () {
cordova.plugins.notification.local.schedule({
id: 1,
// id: 1,
text: 'Test Message 1',
icon: 'http://www.optimizeordie.de/wp-content/plugins/social-media-widget/images/default/64/googleplus.png',
sound: null,
......
......@@ -30,7 +30,7 @@ var exec = require('cordova/exec'),
*************/
/**
* Returns the default settings
* Returns the default settings.
*
* @return {Object}
*/
......@@ -39,7 +39,7 @@ exports.getDefaults = function () {
};
/**
* Overwrite default settings
* Overwrite default settings.
*
* @param {Object} defaults
*/
......@@ -423,17 +423,25 @@ exports.registerPermission = function (callback, scope) {
exec(fn, null, 'LocalNotification', 'registerPermission', []);
};
/****************
* DEPRECATIONS *
****************/
/**
* @deprecated
*
* Register permission to show notifications if not already granted.
*
* @param {Function} callback
* The function to be exec as the callback
* @param {Object?} scope
* The callback function's scope
* Schedule a new local notification.
*/
exports.add = function () {
console.warn('Depreated: Please use `notification.local.schedule` instead.');
exports.schedule.apply(this, arguments);
};
/**
* Register permission to show notifications
* if not already granted.
*/
exports.promptForPermission = function (callback, scope) {
exports.promptForPermission = function () {
console.warn('Depreated: Please use `notification.local.registerPermission` instead.');
exports.registerPermission.apply(this, arguments);
......@@ -500,7 +508,7 @@ exports._defaults = {
title: '',
sound: 'res://platform_default',
badge: 0,
id: 0,
id: "0",
data: undefined,
every: undefined,
at: undefined
......
......@@ -180,7 +180,10 @@ public class LocalNotification extends CordovaPlugin {
for (int i = 0; i < notifications.length(); i++) {
JSONObject options = notifications.optJSONObject(i);
Notification notification =
getNotificationMgr().schedule(options, TriggerReceiver.class);
fireEvent("schedule", notification);
}
}
......
......@@ -27,8 +27,6 @@
#import "UIApplication+APPLocalNotification.h"
#import "UILocalNotification+APPLocalNotification.h"
#import <Availability.h>
@interface APPLocalNotification ()
// Retrieves the application state
......@@ -411,16 +409,17 @@
*/
- (void) registerPermission:(CDVInvokedUrlCommand*)command
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
if ([[UIApplication sharedApplication]
respondsToSelector:@selector(registerUserNotificationSettings:)])
{
_command = command;
[self.commandDelegate runInBackground:^{
[self.app registerPermissionToScheduleLocalNotifications];
}];
#else
} else {
[self hasPermission:command];
#endif
}
}
#pragma mark -
......
......@@ -159,7 +159,7 @@ NSString* const DEFAULT_SOUND = @"res://platform_default";
else if ([interval isEqualToString:@"minute"]) {
return NSCalendarUnitMinute;
}
else if ([interval isEqualToString:@"houre"]) {
else if ([interval isEqualToString:@"hour"]) {
return NSCalendarUnitHour;
}
else if ([interval isEqualToString:@"day"]) {
......
......@@ -24,8 +24,6 @@
#import "UIApplication+APPLocalNotification.h"
#import "UILocalNotification+APPLocalNotification.h"
#import <Availability.h>
@implementation UIApplication (APPLocalNotification)
#pragma mark -
......@@ -36,7 +34,9 @@
*/
- (BOOL) hasPermissionToScheduleLocalNotifications
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
if ([[UIApplication sharedApplication]
respondsToSelector:@selector(registerUserNotificationSettings:)])
{
UIUserNotificationType types;
UIUserNotificationSettings *settings;
......@@ -46,9 +46,9 @@
types = UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound;
return (settings.types & types);
#else
} else {
return YES;
#endif
}
}
/**
......@@ -56,7 +56,9 @@
*/
- (void) registerPermissionToScheduleLocalNotifications
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
if ([[UIApplication sharedApplication]
respondsToSelector:@selector(registerUserNotificationSettings:)])
{
UIUserNotificationType types;
UIUserNotificationSettings *settings;
......@@ -67,7 +69,7 @@
[[UIApplication sharedApplication]
registerUserNotificationSettings:settings];
#endif
}
}
#pragma mark -
......
......@@ -166,7 +166,6 @@ NSInteger const APPLocalNotificationTypeTriggered = 2;
NSData* data;
NSMutableDictionary* obj = [self.userInfo mutableCopy];
[obj removeObjectForKey:@"json"];
[obj removeObjectForKey:@"updatedAt"];
data = [NSJSONSerialization dataWithJSONObject:obj
......
......@@ -289,48 +289,48 @@
<!-- IDs -->
<script type="text/javascript">
var callback = function (ids) {
var fn = function (ids) {
showToast(ids.length === 0 ? '- none -' : ids.join(' ,'));
};
getIds = function () {
cordova.plugins.notification.local.getIds(callback);
cordova.plugins.notification.local.getIds(fn);
};
getScheduledIds = function () {
cordova.plugins.notification.local.getScheduledIds(callback);
cordova.plugins.notification.local.getScheduledIds(fn);
};
getTriggeredIds = function () {
cordova.plugins.notification.local.getTriggeredIds(callback);
cordova.plugins.notification.local.getTriggeredIds(fn);
};
</script>
<!-- notifications -->
<script type="text/javascript">
var callback = function (notifications) {
var fn = function (notifications) {
console.log(notifications);
showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,'));
};
get = function () {
cordova.plugins.notification.local.get(1, callback);
cordova.plugins.notification.local.get(1, fn);
};
getMultiple = function () {
cordova.plugins.notification.local.get([1, 2], callback);
cordova.plugins.notification.local.get([1, 2], fn);
};
getAll = function () {
cordova.plugins.notification.local.getAll(callback);
cordova.plugins.notification.local.getAll(fn);
};
getScheduled = function () {
cordova.plugins.notification.local.getScheduled(callback);
cordova.plugins.notification.local.getScheduled(fn);
};
getTriggered = function () {
cordova.plugins.notification.local.getTriggered(callback);
cordova.plugins.notification.local.getTriggered(fn);
};
</script>
......
......@@ -30,7 +30,7 @@ var exec = require('cordova/exec'),
*************/
/**
* Returns the default settings
* Returns the default settings.
*
* @return {Object}
*/
......@@ -39,7 +39,7 @@ exports.getDefaults = function () {
};
/**
* Overwrite default settings
* Overwrite default settings.
*
* @param {Object} defaults
*/
......@@ -423,17 +423,25 @@ exports.registerPermission = function (callback, scope) {
exec(fn, null, 'LocalNotification', 'registerPermission', []);
};
/****************
* DEPRECATIONS *
****************/
/**
* @deprecated
*
* Register permission to show notifications if not already granted.
*
* @param {Function} callback
* The function to be exec as the callback
* @param {Object?} scope
* The callback function's scope
* Schedule a new local notification.
*/
exports.add = function () {
console.warn('Depreated: Please use `notification.local.schedule` instead.');
exports.schedule.apply(this, arguments);
};
/**
* Register permission to show notifications
* if not already granted.
*/
exports.promptForPermission = function (callback, scope) {
exports.promptForPermission = function () {
console.warn('Depreated: Please use `notification.local.registerPermission` instead.');
exports.registerPermission.apply(this, arguments);
......@@ -500,7 +508,7 @@ exports._defaults = {
title: '',
sound: 'res://platform_default',
badge: 0,
id: 0,
id: "0",
data: undefined,
every: undefined,
at: undefined
......
......@@ -59,7 +59,7 @@
"count": 1
},
{
"xml": "<receiver android:name=\"de.appplant.cordova.plugin.notification.RestoreReceiver\"><intent-filter><action android:name=\"android.intent.action.BOOT_COMPLETED\" /></intent-filter></receiver>",
"xml": "<receiver android:name=\"de.appplant.cordova.plugin.localnotification.RestoreReceiver\"><intent-filter><action android:name=\"android.intent.action.BOOT_COMPLETED\" /></intent-filter></receiver>",
"count": 1
},
{
......
......@@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Copyright 2013-2015 appPlant UG, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......
<p align="right">
<a href="https://github.com/katzer/cordova-plugin-local-notifications/tree/example">EXAMPLE :point_right:</a>
</p>
Cordova Local-Notification Plugin
==================================
......@@ -145,8 +150,7 @@ The method takes a hash as an argument to specify the notification's properties
Scheduling a local notification will override an earlier one with the same ID.
All properties are optional. If no date object is given, the notification pops-up immediately.
**Note:** On Android the notification id needs to be a string which can be converted to a number.
If the ID has an invalid format, it will be ignored, but cancelling the notification will fail.
**Note:** The notification ID must be a string which can be converted to a number (that is, `isNaN()` returns false for). If the ID has an invalid format, it will silently be changed to `0` and will override an earlier one with the same ID.
#### Further information
- See the [onadd][onadd] event for registering a listener to be notified when a local notification has been scheduled.
......
......@@ -14,12 +14,16 @@
<author>Sebastián Katzer</author>
<!-- cordova -->
<engines>
<engine name="cordova" version=">=3.0.0" />
</engines>
<dependency id="org.apache.cordova.device" url="https://github.com/apache/cordova-plugin-device" />
<dependency
id="org.apache.cordova.device"
url="https://github.com/apache/cordova-plugin-device" />
<!-- js -->
<js-module src="www/local-notification.js" name="LocalNotification">
<clobbers target="cordova.plugins.notification.local" />
<clobbers target="plugin.notification.local" />
......@@ -81,7 +85,7 @@
android:name="de.appplant.cordova.plugin.notification.ClearReceiver"
android:exported="false" />
<receiver android:name="de.appplant.cordova.plugin.notification.RestoreReceiver" >
<receiver android:name="de.appplant.cordova.plugin.localnotification.RestoreReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
......
......@@ -180,7 +180,10 @@ public class LocalNotification extends CordovaPlugin {
for (int i = 0; i < notifications.length(); i++) {
JSONObject options = notifications.optJSONObject(i);
Notification notification =
getNotificationMgr().schedule(options, TriggerReceiver.class);
fireEvent("schedule", notification);
}
}
......
......@@ -27,8 +27,6 @@
#import "UIApplication+APPLocalNotification.h"
#import "UILocalNotification+APPLocalNotification.h"
#import <Availability.h>
@interface APPLocalNotification ()
// Retrieves the application state
......@@ -411,16 +409,17 @@
*/
- (void) registerPermission:(CDVInvokedUrlCommand*)command
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
if ([[UIApplication sharedApplication]
respondsToSelector:@selector(registerUserNotificationSettings:)])
{
_command = command;
[self.commandDelegate runInBackground:^{
[self.app registerPermissionToScheduleLocalNotifications];
}];
#else
} else {
[self hasPermission:command];
#endif
}
}
#pragma mark -
......
......@@ -159,7 +159,7 @@ NSString* const DEFAULT_SOUND = @"res://platform_default";
else if ([interval isEqualToString:@"minute"]) {
return NSCalendarUnitMinute;
}
else if ([interval isEqualToString:@"houre"]) {
else if ([interval isEqualToString:@"hour"]) {
return NSCalendarUnitHour;
}
else if ([interval isEqualToString:@"day"]) {
......
......@@ -24,8 +24,6 @@
#import "UIApplication+APPLocalNotification.h"
#import "UILocalNotification+APPLocalNotification.h"
#import <Availability.h>
@implementation UIApplication (APPLocalNotification)
#pragma mark -
......@@ -36,7 +34,9 @@
*/
- (BOOL) hasPermissionToScheduleLocalNotifications
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
if ([[UIApplication sharedApplication]
respondsToSelector:@selector(registerUserNotificationSettings:)])
{
UIUserNotificationType types;
UIUserNotificationSettings *settings;
......@@ -46,9 +46,9 @@
types = UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound;
return (settings.types & types);
#else
} else {
return YES;
#endif
}
}
/**
......@@ -56,7 +56,9 @@
*/
- (void) registerPermissionToScheduleLocalNotifications
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
if ([[UIApplication sharedApplication]
respondsToSelector:@selector(registerUserNotificationSettings:)])
{
UIUserNotificationType types;
UIUserNotificationSettings *settings;
......@@ -67,7 +69,7 @@
[[UIApplication sharedApplication]
registerUserNotificationSettings:settings];
#endif
}
}
#pragma mark -
......
......@@ -166,7 +166,6 @@ NSInteger const APPLocalNotificationTypeTriggered = 2;
NSData* data;
NSMutableDictionary* obj = [self.userInfo mutableCopy];
[obj removeObjectForKey:@"json"];
[obj removeObjectForKey:@"updatedAt"];
data = [NSJSONSerialization dataWithJSONObject:obj
......
......@@ -30,7 +30,7 @@ var exec = require('cordova/exec'),
*************/
/**
* Returns the default settings
* Returns the default settings.
*
* @return {Object}
*/
......@@ -39,7 +39,7 @@ exports.getDefaults = function () {
};
/**
* Overwrite default settings
* Overwrite default settings.
*
* @param {Object} defaults
*/
......@@ -423,17 +423,25 @@ exports.registerPermission = function (callback, scope) {
exec(fn, null, 'LocalNotification', 'registerPermission', []);
};
/****************
* DEPRECATIONS *
****************/
/**
* @deprecated
*
* Register permission to show notifications if not already granted.
*
* @param {Function} callback
* The function to be exec as the callback
* @param {Object?} scope
* The callback function's scope
* Schedule a new local notification.
*/
exports.add = function () {
console.warn('Depreated: Please use `notification.local.schedule` instead.');
exports.schedule.apply(this, arguments);
};
/**
* Register permission to show notifications
* if not already granted.
*/
exports.promptForPermission = function (callback, scope) {
exports.promptForPermission = function () {
console.warn('Depreated: Please use `notification.local.registerPermission` instead.');
exports.registerPermission.apply(this, arguments);
......@@ -500,7 +508,7 @@ exports._defaults = {
title: '',
sound: 'res://platform_default',
badge: 0,
id: 0,
id: "0",
data: undefined,
every: undefined,
at: undefined
......
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