Commit cd49e90c by Sebastián Katzer

Update project:

parent ab7fa803
......@@ -48,7 +48,8 @@ module.exports.metadata =
{
"nl.x-services.plugins.toast": "2.0.3",
"de.appplant.cordova.plugin.local-notification": "0.8.2dev",
"org.apache.cordova.device": "0.3.0"
"org.apache.cordova.device": "0.3.0",
"android.support.v4": "21.0.1"
}
// BOTTOM OF METADATA
});
\ No newline at end of file
......@@ -39,14 +39,15 @@
7E7966E61810823500FA85AD /* icon-small.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DC1810823500FA85AD /* icon-small.png */; };
7E7966E71810823500FA85AD /* icon-small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E7966DD1810823500FA85AD /* icon-small@2x.png */; };
D4A0D8761607E02300AEF8BB /* Default-568h@2x~iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = D4A0D8751607E02300AEF8BB /* Default-568h@2x~iphone.png */; };
AD7BE76F46AF46B98063DA33 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B4F6CD5151F4B6984357BD8 /* CDVDevice.m */; };
71589C47958B44A0AB9DF872 /* APPLocalNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = 6FAC8E7C327B45D3829E3051 /* APPLocalNotification.m */; };
31A5963AFA5A4FB2A383621E /* APPLocalNotificationOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 89090721992B40ABA8237698 /* APPLocalNotificationOptions.m */; };
3D2DB1BD087A46D793C1F291 /* UIApplication+APPLocalNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F8A902D10214D7AB16CA6A1 /* UIApplication+APPLocalNotification.m */; };
3ED7D44238364BD3B99BF0CF /* UILocalNotification+APPLocalNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = BDCA0618D07B47B682A9410D /* UILocalNotification+APPLocalNotification.m */; };
6C5A5FDC69334EABB56FCE5A /* Toast+UIView.m in Sources */ = {isa = PBXBuildFile; fileRef = 80361C15F5A148A98AB5AC51 /* Toast+UIView.m */; };
23298A8B7C33459FADC63B77 /* Toast.m in Sources */ = {isa = PBXBuildFile; fileRef = 146586D566294E68A933F318 /* Toast.m */; };
333BC929814D4D72813E9983 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83079DD5936B45449D749489 /* QuartzCore.framework */; };
63B129C5B1984F9388EE6DB3 /* Toast+UIView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D4165F67F5346E785B9F01E /* Toast+UIView.m */; };
F5C58FDD2F1048C68C7DBBAE /* Toast.m in Sources */ = {isa = PBXBuildFile; fileRef = DE8F4ECD53CF470F96DE980C /* Toast.m */; };
3FB2430716314EA98761A098 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ADCFAC5CA45B49889AE92F89 /* QuartzCore.framework */; };
B5D031A543D04F5F946F8FD8 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 135CF979E2734C3898B9708B /* CDVDevice.m */; };
A83BC6D586FC41FAA6D26035 /* AppDelegate+APPRegisterUserNotificationSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 35FCE5B3FA964E03ADCE70EE /* AppDelegate+APPRegisterUserNotificationSettings.m */; };
139B9A8E7C8B420FBAE75E4D /* APPLocalNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = CF1A502EBE664A998C92F0A1 /* APPLocalNotification.m */; };
B123A9C68BA04669A36D0F43 /* APPLocalNotificationOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FF9ABDF84C749C2A188716D /* APPLocalNotificationOptions.m */; };
D9A9C5639E9D4E2CADEE5FFA /* UIApplication+APPLocalNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = F6E2858C63CB4311B03068BB /* UIApplication+APPLocalNotification.m */; };
7EA2A18E86284B0F92535C38 /* UILocalNotification+APPLocalNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A75C8DB3BD4D6A8964FBE8 /* UILocalNotification+APPLocalNotification.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -112,21 +113,23 @@
EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "NotificationExample/config.xml"; sourceTree = "<group>"; };
2B4F6CD5151F4B6984357BD8 /* CDVDevice.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "CDVDevice.m"; path = "org.apache.cordova.device/CDVDevice.m"; sourceTree = "<group>"; fileEncoding = 4; };
DD6A287E6650489AB756F123 /* CDVDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "CDVDevice.h"; path = "org.apache.cordova.device/CDVDevice.h"; sourceTree = "<group>"; fileEncoding = 4; };
6FAC8E7C327B45D3829E3051 /* APPLocalNotification.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "APPLocalNotification.m"; path = "de.appplant.cordova.plugin.local-notification/APPLocalNotification.m"; sourceTree = "<group>"; fileEncoding = 4; };
89090721992B40ABA8237698 /* APPLocalNotificationOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "APPLocalNotificationOptions.m"; path = "de.appplant.cordova.plugin.local-notification/APPLocalNotificationOptions.m"; sourceTree = "<group>"; fileEncoding = 4; };
0F8A902D10214D7AB16CA6A1 /* UIApplication+APPLocalNotification.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "UIApplication+APPLocalNotification.m"; path = "de.appplant.cordova.plugin.local-notification/UIApplication+APPLocalNotification.m"; sourceTree = "<group>"; fileEncoding = 4; };
BDCA0618D07B47B682A9410D /* UILocalNotification+APPLocalNotification.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "UILocalNotification+APPLocalNotification.m"; path = "de.appplant.cordova.plugin.local-notification/UILocalNotification+APPLocalNotification.m"; sourceTree = "<group>"; fileEncoding = 4; };
E7A8A05F5EB447418EE3DEA3 /* APPLocalNotification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "APPLocalNotification.h"; path = "de.appplant.cordova.plugin.local-notification/APPLocalNotification.h"; sourceTree = "<group>"; fileEncoding = 4; };
A02EF58E479D4B19893FEDD7 /* APPLocalNotificationOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "APPLocalNotificationOptions.h"; path = "de.appplant.cordova.plugin.local-notification/APPLocalNotificationOptions.h"; sourceTree = "<group>"; fileEncoding = 4; };
F0E6140A2C7241BDBFAA17C2 /* UIApplication+APPLocalNotification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "UIApplication+APPLocalNotification.h"; path = "de.appplant.cordova.plugin.local-notification/UIApplication+APPLocalNotification.h"; sourceTree = "<group>"; fileEncoding = 4; };
9A9D5039A6A2473C88B826C6 /* UILocalNotification+APPLocalNotification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "UILocalNotification+APPLocalNotification.h"; path = "de.appplant.cordova.plugin.local-notification/UILocalNotification+APPLocalNotification.h"; sourceTree = "<group>"; fileEncoding = 4; };
80361C15F5A148A98AB5AC51 /* Toast+UIView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "Toast+UIView.m"; path = "nl.x-services.plugins.toast/Toast+UIView.m"; sourceTree = "<group>"; fileEncoding = 4; };
146586D566294E68A933F318 /* Toast.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "Toast.m"; path = "nl.x-services.plugins.toast/Toast.m"; sourceTree = "<group>"; fileEncoding = 4; };
86CB24288F4E413CB00042A0 /* Toast+UIView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Toast+UIView.h"; path = "nl.x-services.plugins.toast/Toast+UIView.h"; sourceTree = "<group>"; fileEncoding = 4; };
D6FB32EC007141DF9D515817 /* Toast.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Toast.h"; path = "nl.x-services.plugins.toast/Toast.h"; sourceTree = "<group>"; fileEncoding = 4; };
83079DD5936B45449D749489 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "QuartzCore.framework"; path = "System/Library/Frameworks/QuartzCore.framework"; sourceTree = SDKROOT; fileEncoding = 4; };
7D4165F67F5346E785B9F01E /* Toast+UIView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "Toast+UIView.m"; path = "nl.x-services.plugins.toast/Toast+UIView.m"; sourceTree = "<group>"; fileEncoding = 4; };
DE8F4ECD53CF470F96DE980C /* Toast.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "Toast.m"; path = "nl.x-services.plugins.toast/Toast.m"; sourceTree = "<group>"; fileEncoding = 4; };
FA2F34C6D4064122A42178D9 /* Toast+UIView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Toast+UIView.h"; path = "nl.x-services.plugins.toast/Toast+UIView.h"; sourceTree = "<group>"; fileEncoding = 4; };
95E4372012D84A14A0CB9E2A /* Toast.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Toast.h"; path = "nl.x-services.plugins.toast/Toast.h"; sourceTree = "<group>"; fileEncoding = 4; };
ADCFAC5CA45B49889AE92F89 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "QuartzCore.framework"; path = "System/Library/Frameworks/QuartzCore.framework"; sourceTree = SDKROOT; fileEncoding = 4; };
135CF979E2734C3898B9708B /* CDVDevice.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "CDVDevice.m"; path = "org.apache.cordova.device/CDVDevice.m"; sourceTree = "<group>"; fileEncoding = 4; };
3B041E317CBD4DC28E3C09D0 /* CDVDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "CDVDevice.h"; path = "org.apache.cordova.device/CDVDevice.h"; sourceTree = "<group>"; fileEncoding = 4; };
35FCE5B3FA964E03ADCE70EE /* AppDelegate+APPRegisterUserNotificationSettings.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "AppDelegate+APPRegisterUserNotificationSettings.m"; path = "de.appplant.cordova.common.registerusernotificationsettings/AppDelegate+APPRegisterUserNotificationSettings.m"; sourceTree = "<group>"; fileEncoding = 4; };
6152B9B566AA4B5681D27677 /* AppDelegate+APPRegisterUserNotificationSettings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "AppDelegate+APPRegisterUserNotificationSettings.h"; path = "de.appplant.cordova.common.registerusernotificationsettings/AppDelegate+APPRegisterUserNotificationSettings.h"; sourceTree = "<group>"; fileEncoding = 4; };
CF1A502EBE664A998C92F0A1 /* APPLocalNotification.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "APPLocalNotification.m"; path = "de.appplant.cordova.plugin.local-notification/APPLocalNotification.m"; sourceTree = "<group>"; fileEncoding = 4; };
9FF9ABDF84C749C2A188716D /* APPLocalNotificationOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "APPLocalNotificationOptions.m"; path = "de.appplant.cordova.plugin.local-notification/APPLocalNotificationOptions.m"; sourceTree = "<group>"; fileEncoding = 4; };
F6E2858C63CB4311B03068BB /* UIApplication+APPLocalNotification.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "UIApplication+APPLocalNotification.m"; path = "de.appplant.cordova.plugin.local-notification/UIApplication+APPLocalNotification.m"; sourceTree = "<group>"; fileEncoding = 4; };
C3A75C8DB3BD4D6A8964FBE8 /* UILocalNotification+APPLocalNotification.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "UILocalNotification+APPLocalNotification.m"; path = "de.appplant.cordova.plugin.local-notification/UILocalNotification+APPLocalNotification.m"; sourceTree = "<group>"; fileEncoding = 4; };
05A0B1B886DE44139AFE400C /* APPLocalNotification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "APPLocalNotification.h"; path = "de.appplant.cordova.plugin.local-notification/APPLocalNotification.h"; sourceTree = "<group>"; fileEncoding = 4; };
013546DE284B462489B7ED87 /* APPLocalNotificationOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "APPLocalNotificationOptions.h"; path = "de.appplant.cordova.plugin.local-notification/APPLocalNotificationOptions.h"; sourceTree = "<group>"; fileEncoding = 4; };
CFF3C845CCB1410883BBAFCD /* UIApplication+APPLocalNotification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "UIApplication+APPLocalNotification.h"; path = "de.appplant.cordova.plugin.local-notification/UIApplication+APPLocalNotification.h"; sourceTree = "<group>"; fileEncoding = 4; };
FC258B5C83234C3B8E50721C /* UILocalNotification+APPLocalNotification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "UILocalNotification+APPLocalNotification.h"; path = "de.appplant.cordova.plugin.local-notification/UILocalNotification+APPLocalNotification.h"; sourceTree = "<group>"; fileEncoding = 4; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -138,7 +141,7 @@
301BF552109A68D80062928A /* libCordova.a in Frameworks */,
288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */,
305D5FD1115AB8F900A74A75 /* MobileCoreServices.framework in Frameworks */,
333BC929814D4D72813E9983 /* QuartzCore.framework in Frameworks */,
3FB2430716314EA98761A098 /* QuartzCore.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -211,7 +214,7 @@
5B1594DC16A7569C00FEF299 /* AssetsLibrary.framework */,
288765FC0DF74451002DB57D /* CoreGraphics.framework */,
305D5FD0115AB8F900A74A75 /* MobileCoreServices.framework */,
83079DD5936B45449D749489 /* QuartzCore.framework */,
ADCFAC5CA45B49889AE92F89 /* QuartzCore.framework */,
);
name = Frameworks;
sourceTree = "<group>";
......@@ -227,20 +230,22 @@
307C750510C5A3420062BCA9 /* Plugins */ = {
isa = PBXGroup;
children = (
2B4F6CD5151F4B6984357BD8 /* CDVDevice.m */,
DD6A287E6650489AB756F123 /* CDVDevice.h */,
6FAC8E7C327B45D3829E3051 /* APPLocalNotification.m */,
89090721992B40ABA8237698 /* APPLocalNotificationOptions.m */,
0F8A902D10214D7AB16CA6A1 /* UIApplication+APPLocalNotification.m */,
BDCA0618D07B47B682A9410D /* UILocalNotification+APPLocalNotification.m */,
E7A8A05F5EB447418EE3DEA3 /* APPLocalNotification.h */,
A02EF58E479D4B19893FEDD7 /* APPLocalNotificationOptions.h */,
F0E6140A2C7241BDBFAA17C2 /* UIApplication+APPLocalNotification.h */,
9A9D5039A6A2473C88B826C6 /* UILocalNotification+APPLocalNotification.h */,
80361C15F5A148A98AB5AC51 /* Toast+UIView.m */,
146586D566294E68A933F318 /* Toast.m */,
86CB24288F4E413CB00042A0 /* Toast+UIView.h */,
D6FB32EC007141DF9D515817 /* Toast.h */,
7D4165F67F5346E785B9F01E /* Toast+UIView.m */,
DE8F4ECD53CF470F96DE980C /* Toast.m */,
FA2F34C6D4064122A42178D9 /* Toast+UIView.h */,
95E4372012D84A14A0CB9E2A /* Toast.h */,
135CF979E2734C3898B9708B /* CDVDevice.m */,
3B041E317CBD4DC28E3C09D0 /* CDVDevice.h */,
35FCE5B3FA964E03ADCE70EE /* AppDelegate+APPRegisterUserNotificationSettings.m */,
6152B9B566AA4B5681D27677 /* AppDelegate+APPRegisterUserNotificationSettings.h */,
CF1A502EBE664A998C92F0A1 /* APPLocalNotification.m */,
9FF9ABDF84C749C2A188716D /* APPLocalNotificationOptions.m */,
F6E2858C63CB4311B03068BB /* UIApplication+APPLocalNotification.m */,
C3A75C8DB3BD4D6A8964FBE8 /* UILocalNotification+APPLocalNotification.m */,
05A0B1B886DE44139AFE400C /* APPLocalNotification.h */,
013546DE284B462489B7ED87 /* APPLocalNotificationOptions.h */,
CFF3C845CCB1410883BBAFCD /* UIApplication+APPLocalNotification.h */,
FC258B5C83234C3B8E50721C /* UILocalNotification+APPLocalNotification.h */,
);
name = Plugins;
path = "NotificationExample/Plugins";
......@@ -425,13 +430,14 @@
1D60589B0D05DD56006BFB54 /* main.m in Sources */,
1D3623260D0F684500981E51 /* AppDelegate.m in Sources */,
302D95F114D2391D003F00A1 /* MainViewController.m in Sources */,
AD7BE76F46AF46B98063DA33 /* CDVDevice.m in Sources */,
71589C47958B44A0AB9DF872 /* APPLocalNotification.m in Sources */,
31A5963AFA5A4FB2A383621E /* APPLocalNotificationOptions.m in Sources */,
3D2DB1BD087A46D793C1F291 /* UIApplication+APPLocalNotification.m in Sources */,
3ED7D44238364BD3B99BF0CF /* UILocalNotification+APPLocalNotification.m in Sources */,
6C5A5FDC69334EABB56FCE5A /* Toast+UIView.m in Sources */,
23298A8B7C33459FADC63B77 /* Toast.m in Sources */,
63B129C5B1984F9388EE6DB3 /* Toast+UIView.m in Sources */,
F5C58FDD2F1048C68C7DBBAE /* Toast.m in Sources */,
B5D031A543D04F5F946F8FD8 /* CDVDevice.m in Sources */,
A83BC6D586FC41FAA6D26035 /* AppDelegate+APPRegisterUserNotificationSettings.m in Sources */,
139B9A8E7C8B420FBAE75E4D /* APPLocalNotification.m in Sources */,
B123A9C68BA04669A36D0F43 /* APPLocalNotificationOptions.m in Sources */,
D9A9C5639E9D4E2CADEE5FFA /* UIApplication+APPLocalNotification.m in Sources */,
7EA2A18E86284B0F92535C38 /* UILocalNotification+APPLocalNotification.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -29,8 +29,6 @@
#import <Cordova/CDVViewController.h>
extern NSString* const UIApplicationRegisterUserNotificationSettings;
@interface AppDelegate : NSObject <UIApplicationDelegate>{}
// invoke string is passed to your app on launch, this is only valid if you
......
......@@ -30,8 +30,6 @@
#import <Cordova/CDVPlugin.h>
NSString* const UIApplicationRegisterUserNotificationSettings = @"UIApplicationRegisterUserNotificationSettings";
@implementation AppDelegate
@synthesize window, viewController;
......@@ -150,18 +148,4 @@ NSString* const UIApplicationRegisterUserNotificationSettings = @"UIApplicationR
[[NSURLCache sharedURLCache] removeAllCachedResponses];
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
- (void) application:(UIApplication*)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)settings
{
NSNotificationCenter* center = [NSNotificationCenter
defaultCenter];
// re-post (broadcast)
[center postNotificationName:UIApplicationRegisterUserNotificationSettings
object:settings];
}
#endif
@end
/*
* Copyright (c) 2013-2015 by appPlant UG. All rights reserved.
*
* @APPPLANT_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apache License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://opensource.org/licenses/Apache-2.0/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPPLANT_LICENSE_HEADER_END@
*/
#import "AppDelegate.h"
#import <Availability.h>
extern NSString* const UIApplicationRegisterUserNotificationSettings;
@interface AppDelegate (APPRegisterUserNotificationSettings)
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
// Tells the delegate what types of notifications may be used
- (void) application:(UIApplication*)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)settings;
#endif
@end
\ No newline at end of file
/*
* Copyright (c) 2013-2015 by appPlant UG. All rights reserved.
*
* @APPPLANT_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apache License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://opensource.org/licenses/Apache-2.0/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPPLANT_LICENSE_HEADER_END@
*/
#import "AppDelegate+APPRegisterUserNotificationSettings.h"
#import <Availability.h>
NSString* const UIApplicationRegisterUserNotificationSettings = @"UIApplicationRegisterUserNotificationSettings";
@implementation AppDelegate (APPRegisterUserNotificationSettings)
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
/**
* Tells the delegate what types of notifications may be used
* to get the user’s attention.
*/
- (void) application:(UIApplication*)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)settings
{
NSNotificationCenter* center = [NSNotificationCenter
defaultCenter];
// re-post (broadcast)
[center postNotificationName:UIApplicationRegisterUserNotificationSettings
object:settings];
}
#endif
@end
\ No newline at end of file
......@@ -21,11 +21,11 @@
* @APPPLANT_LICENSE_HEADER_END@
*/
#import "AppDelegate.h"
#import "APPLocalNotification.h"
#import "APPLocalNotificationOptions.h"
#import "UIApplication+APPLocalNotification.h"
#import "UILocalNotification+APPLocalNotification.h"
#import "AppDelegate+APPRegisterUserNotificationSettings.h"
@interface APPLocalNotification ()
......
......@@ -14,6 +14,9 @@
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage" />
</feature>
<feature name="Toast">
<param name="ios-package" value="Toast" />
</feature>
<name>NotificationExample</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
......@@ -30,7 +33,4 @@
<param name="ios-package" onload="true" value="APPLocalNotification" />
<param name="onload" value="true" />
</feature>
<feature name="Toast">
<param name="ios-package" value="Toast" />
</feature>
</widget>
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
{
"file": "plugins/nl.x-services.plugins.toast/www/Toast.js",
"id": "nl.x-services.plugins.toast.Toast",
"clobbers": [
"window.plugins.toast"
]
},
{
"file": "plugins/nl.x-services.plugins.toast/test/tests.js",
"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": [
......@@ -25,17 +36,6 @@ module.exports = [
]
},
{
"file": "plugins/nl.x-services.plugins.toast/www/Toast.js",
"id": "nl.x-services.plugins.toast.Toast",
"clobbers": [
"window.plugins.toast"
]
},
{
"file": "plugins/nl.x-services.plugins.toast/test/tests.js",
"id": "nl.x-services.plugins.toast.tests"
},
{
"file": "plugins/org.apache.cordova.device/www/device.js",
"id": "org.apache.cordova.device.device",
"clobbers": [
......@@ -46,9 +46,11 @@ module.exports = [
module.exports.metadata =
// TOP OF METADATA
{
"de.appplant.cordova.plugin.local-notification": "0.8.2dev",
"android.support.v4": "21.0.1",
"nl.x-services.plugins.toast": "2.0.3",
"org.apache.cordova.device": "0.3.0"
"de.appplant.cordova.plugin.local-notification": "0.8.2dev",
"org.apache.cordova.device": "0.3.0",
"de.appplant.cordova.common.registerusernotificationsettings": "1.0.1"
}
// BOTTOM OF METADATA
});
\ No newline at end of file
......@@ -80,6 +80,9 @@
"dependent_plugins": {
"org.apache.cordova.device": {
"PACKAGE_NAME": "de.appplant.cordova.plugin.local_notification.example"
},
"android.support.v4": {
"PACKAGE_NAME": "de.appplant.cordova.plugin.local_notification.example"
}
}
}
\ No newline at end of file
# This is the official list of authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS files.
# See the latter for an explanation.
# Names should be added to this file as:
# Name or Organization <email address>
# The email address is not required for organizations.
Google Inc.
# Contributing to this Repository
Thank you for your interest in contributing!
Unfortunately there are some legal hurdles. Sorry about that.
This repository is a Google open source project, and so we require contributors to sign Google's open source Contributor License Agreement.
It's easy to do, just click here to sign as an [individual](https://developers.google.com/open-source/cla/individual) or [corporation](https://developers.google.com/open-source/cla/corporate).
Individuals can sign electronically in seconds (see the bottom of the page); corporations will need to email a PDF, or mail.
We cannot accept PRs or patches larger than fixing typos and the like without a signed CLA.
If your Github account doesn't show the name your used to sign, please mention your name in your PR.
# People who have agreed to one of the CLAs and can contribute patches.
# The AUTHORS file lists the copyright holders; this file
# lists people. For example, Google employees are listed here
# but not in AUTHORS, because Google holds the copyright.
#
# https://developers.google.com/open-source/cla/individual
# https://developers.google.com/open-source/cla/corporate
#
# Names should be added to this file as:
# Name <email address>
Andrew Grieve <agrieve@google.com>
Max Woghiren <maxw@google.com>
Copyright (c) 2014 The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This is a Cordova plugin that adds the Android Support v4 client library.
It is meant to be depended on by other plugins.
{
"version": "21.0.1",
"name": "android.support.v4",
"cordova_name": "Android Support v4",
"platforms": [
"android"
],
"engines": [
{
"name": "cordova",
"version": ">=3.0.0"
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (c) 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
id="android.support.v4"
version="21.0.1">
<engines>
<engine name="cordova" version=">=3.0.0" />
</engines>
<name>Android Support v4</name>
<platform name="android">
<source-file src="android-support-v4.jar" target-dir="libs" />
</platform>
</plugin>
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
\ No newline at end of file
Cordova RegisterUserNotificationSettings Plugin
===============================================
Implements didRegisterUserNotificationSettings and broadcasts the event for listening plugins.
```obj-c
#import "AppDelegate+APPRegisterUserNotificationSettings.h"
- (void) pluginInitialize
{
NSNotificationCenter* center = [NSNotificationCenter
defaultCenter];
[center addObserver:self
selector:@selector(didRegisterUserNotificationSettings:)
name:UIApplicationRegisterUserNotificationSettings
object:nil];
}
- (void) didRegisterUserNotificationSettings:(UIUserNotificationSettings*)settings
{
...
}
```
\ No newline at end of file
{
"version": "1.0.1",
"name": "de.appplant.cordova.common.registerusernotificationsettings",
"cordova_name": "RegisterUserNotificationSettings",
"description": "Implements didRegisterUserNotificationSettings and broadcasts the event.",
"license": "Apache 2.0",
"repo": "https://github.com/katzer/cordova-common-registerusernotificationsettings",
"keywords": [
"appplant",
"didRegisterUserNotificationSettings"
],
"platforms": [
"ios"
],
"engines": [
{
"name": "cordova",
"version": ">=3.0.0"
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="de.appplant.cordova.common.registerusernotificationsettings"
version="1.0.1">
<name>RegisterUserNotificationSettings</name>
<description>Implements didRegisterUserNotificationSettings and broadcasts the event.</description>
<repo>https://github.com/katzer/cordova-common-registerusernotificationsettings</repo>
<keywords>appplant, didRegisterUserNotificationSettings</keywords>
<license>Apache 2.0</license>
<author>Sebastián Katzer</author>
<!-- cordova -->
<engines>
<engine name="cordova" version=">=3.0.0" />
</engines>
<!-- ios -->
<platform name="ios">
<header-file src="src/ios/AppDelegate+APPRegisterUserNotificationSettings.h" />
<source-file src="src/ios/AppDelegate+APPRegisterUserNotificationSettings.m" />
</platform>
</plugin>
/*
* Copyright (c) 2013-2015 by appPlant UG. All rights reserved.
*
* @APPPLANT_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apache License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://opensource.org/licenses/Apache-2.0/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPPLANT_LICENSE_HEADER_END@
*/
#import "AppDelegate.h"
#import <Availability.h>
extern NSString* const UIApplicationRegisterUserNotificationSettings;
@interface AppDelegate (APPRegisterUserNotificationSettings)
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
// Tells the delegate what types of notifications may be used
- (void) application:(UIApplication*)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)settings;
#endif
@end
\ No newline at end of file
/*
* Copyright (c) 2013-2015 by appPlant UG. All rights reserved.
*
* @APPPLANT_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apache License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://opensource.org/licenses/Apache-2.0/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPPLANT_LICENSE_HEADER_END@
*/
#import "AppDelegate+APPRegisterUserNotificationSettings.h"
#import <Availability.h>
NSString* const UIApplicationRegisterUserNotificationSettings = @"UIApplicationRegisterUserNotificationSettings";
@implementation AppDelegate (APPRegisterUserNotificationSettings)
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
/**
* Tells the delegate what types of notifications may be used
* to get the user’s attention.
*/
- (void) application:(UIApplication*)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)settings
{
NSNotificationCenter* center = [NSNotificationCenter
defaultCenter];
// re-post (broadcast)
[center postNotificationName:UIApplicationRegisterUserNotificationSettings
object:settings];
}
#endif
@end
\ No newline at end of file
......@@ -19,7 +19,7 @@
<!-- cordova -->
<engines>
<engine name="cordova" version=">=3.0.0" />
<engine name="cordova" version=">=3.6.0" />
<engine name="cordova" version="<4.0.0" />
</engines>
......@@ -53,6 +53,8 @@
<!-- ios -->
<platform name="ios">
<dependency id="de.appplant.cordova.common.registerusernotificationsettings" />
<config-file target="config.xml" parent="/*">
<feature name="LocalNotification">
<param name="ios-package" value="APPLocalNotification" onload="true" />
......@@ -72,19 +74,13 @@
<header-file src="src/ios/UILocalNotification+APPLocalNotification.h" />
<source-file src="src/ios/UILocalNotification+APPLocalNotification.m" />
<hook
type="after_platform_add"
src="scripts/ios/didRegisterUserNotificationSettings.js" />
<hook
type="after_plugin_install"
src="scripts/ios/didRegisterUserNotificationSettings.js" />
</platform>
<!-- android -->
<platform name="android">
<dependency id="android.support.v4" />
<config-file target="res/xml/config.xml" parent="/*">
<feature name="LocalNotification">
<param name="android-package" value="de.appplant.cordova.plugin.localnotification.LocalNotification"/>
......@@ -134,8 +130,6 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</config-file>
<lib-file src="libs/android/android-support-v4.jar" />
<source-file
src="src/android/LocalNotification.java"
target-dir="src/de/appplant/cordova/plugin/localnotification" />
......
#!/usr/bin/env node
/*
* Copyright (c) 2013-2015 by appPlant UG. All rights reserved.
*
* @APPPLANT_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apache License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://opensource.org/licenses/Apache-2.0/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPPLANT_LICENSE_HEADER_END@
*/
// Hook inserts the UIApplicationRegisterUserNotificationSettings constant
// and the didRegisterUserNotificationSettings method to AppDelegate.
var fs = require('fs'),
path = require('path'),
rootdir = process.argv[2];
if (!rootdir)
return;
module.exports = function (context) {
var cordova_util = context.requireCordovaModule('cordova-lib/src/cordova/util'),
ConfigParser = context.requireCordovaModule('cordova-lib/src/configparser/ConfigParser'),
projectRoot = cordova_util.isCordova(),
xml = cordova_util.projectConfig(projectRoot),
cfg = new ConfigParser(xml);
// Cordova moved the platforms stuff; try both locations so we'll work for new and old file layouts.
var platforms;
try {
platforms = context.requireCordovaModule('cordova-lib/src/cordova/platforms');
} catch(e) {
platforms = context.requireCordovaModule('cordova-lib/src/platforms/platforms');
}
/**
* The absolute path for the file.
*
* @param {String} platform
* The name of the platform like 'ios'.
* @param {String} relPath
* The relative path from the platform root directory.
*
* @return String
*/
function getAbsPath(platform, relPath) {
var platform_path = path.join(projectRoot, 'platforms', platform),
parser = new platforms[platform].parser(platform_path);
return path.join(parser.cordovaproj, relPath);
}
/**
* Replaces a string with another one in a file.
*
* @param {String} path
* Absolute or relative file path from cordova root project.
* @param {String} to_replace
* The string to replace.
* @param {String}
* The string to replace with.
*/
function replace (path, to_replace, replace_with) {
var data = fs.readFileSync(path, 'utf8'),
result;
if (data.indexOf(replace_with) > -1)
return;
result = data.replace(new RegExp(to_replace, 'g'), replace_with);
fs.writeFileSync(path, result, 'utf8');
}
// Absolute paths for AppDelegate's header and member
var h_path = getAbsPath('ios', 'Classes/AppDelegate.h'),
m_path = getAbsPath('ios', 'Classes/AppDelegate.m');
// Decleration of UIApplicationRegisterUserNotificationSettings
var h_UIApplicationRegisterUserNotificationSettings =
"extern NSString* const UIApplicationRegisterUserNotificationSettings;\n";
// Implementation of UIApplicationRegisterUserNotificationSettings
var m_UIApplicationRegisterUserNotificationSettings =
"NSString* const UIApplicationRegisterUserNotificationSettings = @\"UIApplicationRegisterUserNotificationSettings\";\n";
// Implementation for didRegisterUserNotificationSettings
var didRegisterUserNotificationSettings =
"#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000\n" +
"\n" +
"- (void) application:(UIApplication*)application\n" +
" didRegisterUserNotificationSettings:(UIUserNotificationSettings*)settings\n" +
"{\n" +
" NSNotificationCenter* center = [NSNotificationCenter\n" +
" defaultCenter];\n" +
"\n" +
" // re-post (broadcast)\n" +
" [center postNotificationName:UIApplicationRegisterUserNotificationSettings\n" +
" object:settings];\n" +
"}\n" +
"#endif\n";
// Inserts the constant decleration
replace(h_path, '@interface AppDelegate', h_UIApplicationRegisterUserNotificationSettings + "\n@interface AppDelegate");
// Inserts the constant implementation
replace(m_path, '@implementation AppDelegate', m_UIApplicationRegisterUserNotificationSettings + "\n@implementation AppDelegate");
// Inserts the didRegisterUserNotificationSettings implementation
replace(m_path, '@end', didRegisterUserNotificationSettings + "\n@end");
};
......@@ -21,11 +21,11 @@
* @APPPLANT_LICENSE_HEADER_END@
*/
#import "AppDelegate.h"
#import "APPLocalNotification.h"
#import "APPLocalNotificationOptions.h"
#import "UIApplication+APPLocalNotification.h"
#import "UILocalNotification+APPLocalNotification.h"
#import "AppDelegate+APPRegisterUserNotificationSettings.h"
@interface APPLocalNotification ()
......
......@@ -16,5 +16,30 @@
"type": "local",
"path": "../cordova-plugin-email-composer"
}
},
"android.support.v4": {
"source": {
"type": "registry",
"id": "android.support.v4"
}
},
"de.appplant.cordova.common.RegisterUserNotificationSettings": {
"source": {
"type": "git",
"url": "https://github.com/katzer/cordova-common-RegisterUserNotificationSettings",
"subdir": "."
}
},
"de.appplant.cordova.plugin.badge": {
"source": {
"type": "registry",
"id": "de.appplant.cordova.plugin.badge"
}
},
"de.appplant.cordova.common.registerusernotificationsettings": {
"source": {
"type": "registry",
"id": "de.appplant.cordova.common.registerusernotificationsettings"
}
}
}
\ No newline at end of file
......@@ -9,15 +9,15 @@
"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
},
{
"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
},
{
"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
}
]
......@@ -36,16 +36,22 @@
}
},
"installed_plugins": {
"de.appplant.cordova.plugin.local-notification": {
"android.support.v4": {
"PACKAGE_NAME": "de.appplant.localnotification.example"
},
"nl.x-services.plugins.toast": {
"PACKAGE_NAME": "de.appplant.localnotification.example"
},
"de.appplant.cordova.plugin.local-notification": {
"PACKAGE_NAME": "de.appplant.localnotification.example"
}
},
"dependent_plugins": {
"org.apache.cordova.device": {
"PACKAGE_NAME": "de.appplant.localnotification.example"
},
"de.appplant.cordova.common.registerusernotificationsettings": {
"PACKAGE_NAME": "de.appplant.localnotification.example"
}
}
}
\ No newline at end of file
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