Commit b7115bb4 by Sebastián Katzer

Update project

parent e27ee89f
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
</receiver> </receiver>
<activity android:exported="false" android:launchMode="singleInstance" android:name="de.appplant.cordova.plugin.notification.ClickActivity" android:theme="@android:style/Theme.NoDisplay" /> <activity android:exported="false" android:launchMode="singleInstance" android:name="de.appplant.cordova.plugin.notification.ClickActivity" android:theme="@android:style/Theme.NoDisplay" />
</application> </application>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="21" /> <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
</manifest> </manifest>
...@@ -308,6 +308,7 @@ ...@@ -308,6 +308,7 @@
<!-- IDs --> <!-- IDs -->
<script type="text/javascript"> <script type="text/javascript">
var callbackIds = function (ids) { var callbackIds = function (ids) {
console.log(ids);
showToast(ids.length === 0 ? '- none -' : ids.join(' ,')); showToast(ids.length === 0 ? '- none -' : ids.join(' ,'));
}; };
...@@ -331,8 +332,13 @@ ...@@ -331,8 +332,13 @@
showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,')); showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,'));
}; };
var callbackSingleOpts = function (notification) {
console.log(notification);
showToast(notification.toString());
};
get = function () { get = function () {
cordova.plugins.notification.local.get(1, callbackOpts); cordova.plugins.notification.local.get(1, callbackSingleOpts);
}; };
getMultiple = function () { getMultiple = function () {
......
...@@ -275,7 +275,8 @@ exports.get = function () { ...@@ -275,7 +275,8 @@ exports.get = function () {
scope = args[2]; scope = args[2];
if (!Array.isArray(ids)) { if (!Array.isArray(ids)) {
ids = [ids]; this.exec('getSingle', ids.toString(), callback, scope);
return;
} }
ids = this.convertIds(ids); ids = this.convertIds(ids);
...@@ -321,6 +322,11 @@ exports.getScheduled = function () { ...@@ -321,6 +322,11 @@ exports.getScheduled = function () {
ids = [ids]; ids = [ids];
} }
if (!Array.isArray(ids)) {
this.exec('getSingleScheduled', ids.toString(), callback, scope);
return;
}
ids = this.convertIds(ids); ids = this.convertIds(ids);
this.exec('getScheduled', ids, callback, scope); this.exec('getScheduled', ids, callback, scope);
...@@ -364,6 +370,11 @@ exports.getTriggered = function () { ...@@ -364,6 +370,11 @@ exports.getTriggered = function () {
ids = [ids]; ids = [ids];
} }
if (!Array.isArray(ids)) {
this.exec('getSingleTriggered', ids.toString(), callback, scope);
return;
}
ids = this.convertIds(ids); ids = this.convertIds(ids);
this.exec('getTriggered', ids, callback, scope); this.exec('getTriggered', ids, callback, scope);
......
...@@ -174,6 +174,15 @@ public class LocalNotification extends CordovaPlugin { ...@@ -174,6 +174,15 @@ public class LocalNotification extends CordovaPlugin {
else if (action.equals("getTriggeredIds")) { else if (action.equals("getTriggeredIds")) {
getTriggeredIds(command); getTriggeredIds(command);
} }
else if (action.equals("getSingle")) {
getSingle(args, command);
}
else if (action.equals("getSingleScheduled")) {
getSingleScheduled(args, command);
}
else if (action.equals("getSingleTriggered")) {
getSingleTriggered(args, command);
}
else if (action.equals("getAll")) { else if (action.equals("getAll")) {
getAll(args, command); getAll(args, command);
} }
...@@ -369,23 +378,51 @@ public class LocalNotification extends CordovaPlugin { ...@@ -369,23 +378,51 @@ public class LocalNotification extends CordovaPlugin {
} }
/** /**
* Set of options from local notification. * Options from local notification.
* *
* @param ids * @param ids
* Set of local notification IDs * Set of local notification IDs
* @param command * @param command
* The callback context used when calling back into JavaScript. * The callback context used when calling back into JavaScript.
*/ */
private void getAll (JSONArray ids, CallbackContext command) { private void getSingle (JSONArray ids, CallbackContext command) {
List<JSONObject> options; getOptions(ids.optString(0), Notification.Type.ALL, command);
}
if (ids.length() == 0) { /**
options = getNotificationMgr().getOptions(); * Options from scheduled notification.
} else { *
options = getNotificationMgr().getOptionsById(toList(ids)); * @param ids
} * Set of local notification IDs
* @param command
* The callback context used when calling back into JavaScript.
*/
private void getSingleScheduled (JSONArray ids, CallbackContext command) {
getOptions(ids.optString(0), Notification.Type.SCHEDULED, command);
}
command.success(new JSONArray(options)); /**
* Options from triggered notification.
*
* @param ids
* Set of local notification IDs
* @param command
* The callback context used when calling back into JavaScript.
*/
private void getSingleTriggered (JSONArray ids, CallbackContext command) {
getOptions(ids.optString(0), Notification.Type.TRIGGERED, command);
}
/**
* Set of options from local notification.
*
* @param ids
* Set of local notification IDs
* @param command
* The callback context used when calling back into JavaScript.
*/
private void getAll (JSONArray ids, CallbackContext command) {
getOptions(ids, Notification.Type.ALL, command);
} }
/** /**
...@@ -397,16 +434,7 @@ public class LocalNotification extends CordovaPlugin { ...@@ -397,16 +434,7 @@ public class LocalNotification extends CordovaPlugin {
* The callback context used when calling back into JavaScript. * The callback context used when calling back into JavaScript.
*/ */
private void getScheduled (JSONArray ids, CallbackContext command) { private void getScheduled (JSONArray ids, CallbackContext command) {
List<JSONObject> options; getOptions(ids, Notification.Type.SCHEDULED, command);
if (ids.length() == 0) {
options = getNotificationMgr().getOptionsByType(Notification.Type.SCHEDULED);
} else {
options = getNotificationMgr().getOptionsBy(
Notification.Type.SCHEDULED, toList(ids));
}
command.success(new JSONArray(options));
} }
/** /**
...@@ -418,13 +446,49 @@ public class LocalNotification extends CordovaPlugin { ...@@ -418,13 +446,49 @@ public class LocalNotification extends CordovaPlugin {
* The callback context used when calling back into JavaScript. * The callback context used when calling back into JavaScript.
*/ */
private void getTriggered (JSONArray ids, CallbackContext command) { private void getTriggered (JSONArray ids, CallbackContext command) {
getOptions(ids, Notification.Type.TRIGGERED, command);
}
/**
* Options from local notification.
*
* @param id
* Set of local notification IDs
* @param type
* The local notification life cycle type
* @param command
* The callback context used when calling back into JavaScript.
*/
private void getOptions (String id, Notification.Type type,
CallbackContext command) {
JSONArray ids = new JSONArray().put(id);
JSONObject options =
getNotificationMgr().getOptionsBy(type, toList(ids)).get(0);
command.success(options);
}
/**
* Set of options from local notifications.
*
* @param ids
* Set of local notification IDs
* @param type
* The local notification life cycle type
* @param command
* The callback context used when calling back into JavaScript.
*/
private void getOptions (JSONArray ids, Notification.Type type,
CallbackContext command) {
List<JSONObject> options; List<JSONObject> options;
if (ids.length() == 0) { if (ids.length() == 0) {
options = getNotificationMgr().getOptionsByType(Notification.Type.TRIGGERED); options = getNotificationMgr().getOptionsByType(type);
} else { } else {
options = getNotificationMgr().getOptionsBy( options = getNotificationMgr().getOptionsBy(type, toList(ids));
Notification.Type.TRIGGERED, toList(ids));
} }
command.success(new JSONArray(options)); command.success(new JSONArray(options));
......
...@@ -48,7 +48,7 @@ import java.util.Set; ...@@ -48,7 +48,7 @@ import java.util.Set;
public class Manager { public class Manager {
// Context passed through constructor and used for notification builder. // Context passed through constructor and used for notification builder.
private Context context; private Context context;
/** /**
* Constructor * Constructor
...@@ -56,9 +56,9 @@ public class Manager { ...@@ -56,9 +56,9 @@ public class Manager {
* @param context * @param context
* Application context * Application context
*/ */
private Manager(Context context){ private Manager(Context context){
this.context = context; this.context = context;
} }
/** /**
* Static method to retrieve class instance. * Static method to retrieve class instance.
...@@ -256,6 +256,9 @@ public class Manager { ...@@ -256,6 +256,9 @@ public class Manager {
List<Notification> notifications = getAll(); List<Notification> notifications = getAll();
ArrayList<Notification> list = new ArrayList<Notification>(); ArrayList<Notification> list = new ArrayList<Notification>();
if (type == Notification.Type.ALL)
return notifications;
for (Notification notification : notifications) { for (Notification notification : notifications) {
if (notification.getType() == type) { if (notification.getType() == type) {
list.add(notification); list.add(notification);
...@@ -368,6 +371,9 @@ public class Manager { ...@@ -368,6 +371,9 @@ public class Manager {
public List<JSONObject> getOptionsBy(Notification.Type type, public List<JSONObject> getOptionsBy(Notification.Type type,
List<Integer> ids) { List<Integer> ids) {
if (type == Notification.Type.ALL)
return getOptionsById(ids);
ArrayList<JSONObject> options = new ArrayList<JSONObject>(); ArrayList<JSONObject> options = new ArrayList<JSONObject>();
List<Notification> notifications = getByIds(ids); List<Notification> notifications = getByIds(ids);
......
...@@ -46,7 +46,7 @@ public class Notification { ...@@ -46,7 +46,7 @@ public class Notification {
// Used to differ notifications by their life cycle state // Used to differ notifications by their life cycle state
public static enum Type { public static enum Type {
SCHEDULED, TRIGGERED ALL, SCHEDULED, TRIGGERED
} }
// Default receiver to handle the trigger event // Default receiver to handle the trigger event
......
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
...@@ -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/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", "file": "plugins/de.appplant.cordova.plugin.local-notification/www/local-notification.js",
"id": "de.appplant.cordova.plugin.local-notification.LocalNotification", "id": "de.appplant.cordova.plugin.local-notification.LocalNotification",
"clobbers": [ "clobbers": [
...@@ -25,17 +36,6 @@ module.exports = [ ...@@ -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", "file": "plugins/org.apache.cordova.device/www/device.js",
"id": "org.apache.cordova.device.device", "id": "org.apache.cordova.device.device",
"clobbers": [ "clobbers": [
...@@ -46,8 +46,8 @@ module.exports = [ ...@@ -46,8 +46,8 @@ module.exports = [
module.exports.metadata = module.exports.metadata =
// TOP OF METADATA // TOP OF METADATA
{ {
"de.appplant.cordova.plugin.local-notification": "0.8.2dev",
"nl.x-services.plugins.toast": "2.0.3", "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"
} }
// BOTTOM OF METADATA // BOTTOM OF METADATA
......
...@@ -308,6 +308,7 @@ ...@@ -308,6 +308,7 @@
<!-- IDs --> <!-- IDs -->
<script type="text/javascript"> <script type="text/javascript">
var callbackIds = function (ids) { var callbackIds = function (ids) {
console.log(ids);
showToast(ids.length === 0 ? '- none -' : ids.join(' ,')); showToast(ids.length === 0 ? '- none -' : ids.join(' ,'));
}; };
...@@ -331,8 +332,13 @@ ...@@ -331,8 +332,13 @@
showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,')); showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,'));
}; };
var callbackSingleOpts = function (notification) {
console.log(notification);
showToast(notification.toString());
};
get = function () { get = function () {
cordova.plugins.notification.local.get(1, callbackOpts); cordova.plugins.notification.local.get(1, callbackSingleOpts);
}; };
getMultiple = function () { getMultiple = function () {
......
...@@ -275,7 +275,8 @@ exports.get = function () { ...@@ -275,7 +275,8 @@ exports.get = function () {
scope = args[2]; scope = args[2];
if (!Array.isArray(ids)) { if (!Array.isArray(ids)) {
ids = [ids]; this.exec('getSingle', ids.toString(), callback, scope);
return;
} }
ids = this.convertIds(ids); ids = this.convertIds(ids);
...@@ -321,6 +322,11 @@ exports.getScheduled = function () { ...@@ -321,6 +322,11 @@ exports.getScheduled = function () {
ids = [ids]; ids = [ids];
} }
if (!Array.isArray(ids)) {
this.exec('getSingleScheduled', ids.toString(), callback, scope);
return;
}
ids = this.convertIds(ids); ids = this.convertIds(ids);
this.exec('getScheduled', ids, callback, scope); this.exec('getScheduled', ids, callback, scope);
...@@ -364,6 +370,11 @@ exports.getTriggered = function () { ...@@ -364,6 +370,11 @@ exports.getTriggered = function () {
ids = [ids]; ids = [ids];
} }
if (!Array.isArray(ids)) {
this.exec('getSingleTriggered', ids.toString(), callback, scope);
return;
}
ids = this.convertIds(ids); ids = this.convertIds(ids);
this.exec('getTriggered', ids, callback, scope); this.exec('getTriggered', ids, callback, scope);
......
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputPath>build\windows80\$(Configuration)\$(Platform)\</OutputPath>
<IntermediateOutputPath>build\windows80\bld\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>efffab2f-bfc5-4eda-b545-45ef4995f55a</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '11.0'">
<VisualStudioVersion>11.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" />
<PropertyGroup>
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
<TargetPlatformVersion>8.0</TargetPlatformVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<PackageCertificateKeyFile>CordovaApp_TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="package.windows80.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<Content Include="images\*.png" Exclude="images\*.scale-240.*" />
<None Include="CordovaApp_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<SDKReference Include="Microsoft.WinJS.1.0, Version=1.0" />
</ItemGroup>
<Import Project="CordovaApp.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
<PropertyGroup>
<BuildFromCordovaTooling>false</BuildFromCordovaTooling>
<PreBuildEvent Condition="$(BuildFromCordovaTooling) != true">
cd /d $(MSBuildThisFileDirectory)
node -e "require('./cordova/lib/prepare.js').applyPlatformConfig()"
</PreBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Identity Name="e8de53c0-cf2d-11e4-8bb0-9369d008f7b1" Version="1.0.0.0" Publisher="CN=$username$" />
<Properties>
<DisplayName>NotificationExample</DisplayName>
<PublisherDisplayName>$username$</PublisherDisplayName>
<Logo>images\storelogo.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.2.1</OSMinVersion>
<OSMaxVersionTested>6.2.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="de.appplant.localnotification.example" StartPage="www/index.html">
<VisualElements DisplayName="NotificationExample"
Logo="images\Square150x150Logo.png"
SmallLogo="images\Square30x30Logo.png"
Description="CordovaApp"
ForegroundText="light"
BackgroundColor="#464646">
<DefaultTile ShowName="allLogos" WideLogo="images\Wide310x150Logo.png"/>
<SplashScreen Image="images\splashscreen.png" />
</VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup />
<ReferenceCachePath>C:\Users\sebastian\AppData\Local\Temp\yxmokjnx_CordovaApp.Phone_refcache</ReferenceCachePath>
<AutoRefresh>true</AutoRefresh>
</PropertyGroup>
</Project> </Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ReferenceCachePath>C:\Users\sebastian\AppData\Local\Temp\anloqo42_CordovaApp.Windows_refcache</ReferenceCachePath>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Licensed to the Apache Software Foundation (ASF) under one Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file or more contributor license agreements. See the NOTICE file
...@@ -16,81 +16,78 @@ ...@@ -16,81 +16,78 @@
KIND, either express or implied. See the License for the KIND, either express or implied. See the License for the
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
--> -->
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<OutputPath>build\windows80\$(Configuration)\$(Platform)\</OutputPath> <OutputPath>build\windows80\$(Configuration)\$(Platform)\</OutputPath>
<IntermediateOutputPath>build\windows80\bld\</IntermediateOutputPath> <IntermediateOutputPath>build\windows80\bld\</IntermediateOutputPath>
</PropertyGroup> </PropertyGroup>
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|AnyCPU"> <ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform> <Platform>AnyCPU</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM"> <ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>ARM</Platform> <Platform>ARM</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86"> <ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x86</Platform> <Platform>x86</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU"> <ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>AnyCPU</Platform> <Platform>AnyCPU</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM"> <ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>ARM</Platform> <Platform>ARM</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|x64"> <ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|x86"> <ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x86</Platform> <Platform>x86</Platform>
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>efffab2f-bfc5-4eda-b545-45ef4995f55a</ProjectGuid> <ProjectGuid>efffab2f-bfc5-4eda-b545-45ef4995f55a</ProjectGuid>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="Configuration"> <PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '11.0'">
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion> <VisualStudioVersion>11.0</VisualStudioVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '12.0'"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<VisualStudioVersion>12.0</VisualStudioVersion> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />
</PropertyGroup> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" /> <TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" /> <TargetPlatformVersion>8.0</TargetPlatformVersion>
<PropertyGroup> <DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier> <PackageCertificateKeyFile>CordovaApp_TemporaryKey.pfx</PackageCertificateKeyFile>
<TargetPlatformVersion>8.1</TargetPlatformVersion> </PropertyGroup>
<DefaultLanguage>en-US</DefaultLanguage> <ItemGroup>
<PackageCertificateKeyFile>CordovaApp_TemporaryKey.pfx</PackageCertificateKeyFile> <AppxManifest Include="package.windows80.appxmanifest">
</PropertyGroup> <SubType>Designer</SubType>
<ItemGroup> </AppxManifest>
<AppxManifest Include="package.windows80.appxmanifest"> <Content Include="images\*.png" Exclude="images\*.scale-240.*" />
<SubType>Designer</SubType> <None Include="CordovaApp_TemporaryKey.pfx" />
</AppxManifest> </ItemGroup>
<Content Include="images\*.png" Exclude="images\*.scale-240.*" /> <ItemGroup>
<None Include="CordovaApp_TemporaryKey.pfx" /> <SDKReference Include="Microsoft.WinJS.1.0, Version=1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <Import Project="CordovaApp.projitems" Label="Shared" />
<SDKReference Include="Microsoft.WinJS.2.0, Version=1.0" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
</ItemGroup> <PropertyGroup>
<Import Project="CordovaApp.projitems" Label="Shared" /> <BuildFromCordovaTooling>false</BuildFromCordovaTooling>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
<PropertyGroup>
<BuildFromCordovaTooling>false</BuildFromCordovaTooling>
<PreBuildEvent Condition="$(BuildFromCordovaTooling) != true"> <PreBuildEvent Condition="$(BuildFromCordovaTooling) != true">
cd /d $(MSBuildThisFileDirectory) cd /d $(MSBuildThisFileDirectory)
node -e "require('./cordova/lib/prepare.js').applyPlatformConfig()" node -e "require('./cordova/lib/prepare.js').applyPlatformConfig()"
</PreBuildEvent> </PreBuildEvent>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
\ No newline at end of file
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
Weitere Informationen zu Paketmanifestdateien finden Sie unter http://go.microsoft.com/fwlink/?LinkID=241727 Weitere Informationen zu Paketmanifestdateien finden Sie unter http://go.microsoft.com/fwlink/?LinkID=241727
--> -->
<Identity Name="e8de53c0-cf2d-11e4-8bb0-9369d008f7b1" Version="1.0.0.0" Publisher="CN=$username$" ProcessorArchitecture="neutral" /> <Identity Name="c05631e0-de03-11e4-96be-cfbf5b6cb232" Version="1.0.0.0" Publisher="CN=$username$" ProcessorArchitecture="neutral" />
<mp:PhoneIdentity PhoneProductId="e8de53c0-cf2d-11e4-8bb0-9369d008f7b1" PhonePublisherId="db093ed5-53b1-45f7-af72-751e8f36ab80" /> <mp:PhoneIdentity PhoneProductId="c05631e0-de03-11e4-96be-cfbf5b6cb232" PhonePublisherId="db093ed5-53b1-45f7-af72-751e8f36ab80" />
<Properties> <Properties>
<DisplayName>NotificationExample</DisplayName> <DisplayName>NotificationExample</DisplayName>
<PublisherDisplayName>$username$</PublisherDisplayName> <PublisherDisplayName>$username$</PublisherDisplayName>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<TargetPlatformIdentifier>WindowsPhoneApp</TargetPlatformIdentifier> <TargetPlatformIdentifier>WindowsPhoneApp</TargetPlatformIdentifier>
<SolutionConfiguration>Debug|AnyCPU</SolutionConfiguration> <SolutionConfiguration>Debug|AnyCPU</SolutionConfiguration>
<PackageArchitecture>neutral</PackageArchitecture> <PackageArchitecture>neutral</PackageArchitecture>
<PackageIdentityName>e8de53c0-cf2d-11e4-8bb0-9369d008f7b1</PackageIdentityName> <PackageIdentityName>c05631e0-de03-11e4-96be-cfbf5b6cb232</PackageIdentityName>
<IntermediateOutputPath>Y:\Documents\github\cordova-example-local-notifications\platforms\windows\build\phone\bld\</IntermediateOutputPath> <IntermediateOutputPath>Y:\Documents\github\cordova-example-local-notifications\platforms\windows\build\phone\bld\</IntermediateOutputPath>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
...@@ -79,6 +79,12 @@ ...@@ -79,6 +79,12 @@
<AppxPackagedFile Include="Y:\Documents\github\cordova-example-local-notifications\platforms\windows\www\js\index.js"> <AppxPackagedFile Include="Y:\Documents\github\cordova-example-local-notifications\platforms\windows\www\js\index.js">
<PackagePath>www\js\index.js</PackagePath> <PackagePath>www\js\index.js</PackagePath>
</AppxPackagedFile> </AppxPackagedFile>
<AppxPackagedFile Include="Y:\Documents\github\cordova-example-local-notifications\platforms\windows\www\plugins\de.appplant.cordova.plugin.email-composer\src\windows\EmailComposerProxy.js">
<PackagePath>www\plugins\de.appplant.cordova.plugin.email-composer\src\windows\EmailComposerProxy.js</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="Y:\Documents\github\cordova-example-local-notifications\platforms\windows\www\plugins\de.appplant.cordova.plugin.email-composer\www\email_composer.js">
<PackagePath>www\plugins\de.appplant.cordova.plugin.email-composer\www\email_composer.js</PackagePath>
</AppxPackagedFile>
<AppxPackagedFile Include="Y:\Documents\github\cordova-example-local-notifications\platforms\windows\www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationCore.js"> <AppxPackagedFile Include="Y:\Documents\github\cordova-example-local-notifications\platforms\windows\www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationCore.js">
<PackagePath>www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationCore.js</PackagePath> <PackagePath>www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationCore.js</PackagePath>
</AppxPackagedFile> </AppxPackagedFile>
......
...@@ -19,6 +19,8 @@ www\css\index.css ...@@ -19,6 +19,8 @@ www\css\index.css
www\img\logo.png www\img\logo.png
www\index.html www\index.html
www\js\index.js www\js\index.js
www\plugins\de.appplant.cordova.plugin.email-composer\src\windows\EmailComposerProxy.js
www\plugins\de.appplant.cordova.plugin.email-composer\www\email_composer.js
www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationCore.js www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationCore.js
www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationProxy.js www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationProxy.js
www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationUtil.js www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationUtil.js
......
...@@ -19,6 +19,8 @@ www\css\index.css ...@@ -19,6 +19,8 @@ www\css\index.css
www\img\logo.png www\img\logo.png
www\index.html www\index.html
www\js\index.js www\js\index.js
www\plugins\de.appplant.cordova.plugin.email-composer\src\windows\EmailComposerProxy.js
www\plugins\de.appplant.cordova.plugin.email-composer\www\email_composer.js
www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationCore.js www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationCore.js
www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationProxy.js www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationProxy.js
www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationUtil.js www\plugins\de.appplant.cordova.plugin.local-notification\src\windows\LocalNotificationUtil.js
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Licensed to the Apache Software Foundation (ASF) under one Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file or more contributor license agreements. See the NOTICE file
...@@ -16,36 +16,42 @@ ...@@ -16,36 +16,42 @@
KIND, either express or implied. See the License for the KIND, either express or implied. See the License for the
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
--> -->
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"> <Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
<Identity Name="e8de53c0-cf2d-11e4-8bb0-9369d008f7b1" Version="1.0.0.0" Publisher="CN=$username$" /> <Identity Name="c05631e0-de03-11e4-96be-cfbf5b6cb232" Version="1.0.0.0" Publisher="CN=$username$" />
<mp:PhoneIdentity PhoneProductId="e8de53c0-cf2d-11e4-8bb0-9369d008f7b1" PhonePublisherId="db093ed5-53b1-45f7-af72-751e8f36ab80" /> <mp:PhoneIdentity PhoneProductId="c05631e0-de03-11e4-96be-cfbf5b6cb232" PhonePublisherId="db093ed5-53b1-45f7-af72-751e8f36ab80" />
<Properties> <Properties>
<DisplayName>NotificationExample</DisplayName> <DisplayName>NotificationExample</DisplayName>
<PublisherDisplayName>$username$</PublisherDisplayName> <PublisherDisplayName>$username$</PublisherDisplayName>
<Logo>images\StoreLogo.png</Logo> <Logo>images\StoreLogo.png</Logo>
</Properties> </Properties>
<Prerequisites> <Prerequisites>
<OSMinVersion>6.3.1</OSMinVersion> <OSMinVersion>6.3.1</OSMinVersion>
<OSMaxVersionTested>6.3.1</OSMaxVersionTested> <OSMaxVersionTested>6.3.1</OSMaxVersionTested>
</Prerequisites> </Prerequisites>
<Resources> <Resources>
<Resource Language="x-generate" /> <Resource Language="x-generate" />
</Resources> </Resources>
<Applications> <Applications>
<Application Id="de.appplant.localnotification.example" StartPage="www/index.html"> <Application Id="de.appplant.localnotification.example" StartPage="www/index.html">
<m3:VisualElements ToastCapable="true" DisplayName="NotificationExample" Square150x150Logo="images\Square150x150Logo.png" Square44x44Logo="images\Square44x44Logo.png" Description="CordovaApp" ForegroundText="light" BackgroundColor="transparent"> <m3:VisualElements ToastCapable="true" DisplayName="NotificationExample"
<m3:DefaultTile Wide310x150Logo="images\Wide310x150Logo.png" Square71x71Logo="images\Square71x71Logo.png"> Square150x150Logo="images\Square150x150Logo.png"
<m3:ShowNameOnTiles> Square44x44Logo="images\Square44x44Logo.png"
<m3:ShowOn Tile="square150x150Logo" /> Description="CordovaApp"
<m3:ShowOn Tile="wide310x150Logo" /> ForegroundText="light"
</m3:ShowNameOnTiles> BackgroundColor="transparent">
</m3:DefaultTile> <m3:DefaultTile Wide310x150Logo="images\Wide310x150Logo.png"
<m3:SplashScreen Image="images\SplashScreenPhone.png" /> Square71x71Logo="images\Square71x71Logo.png">
</m3:VisualElements> <m3:ShowNameOnTiles>
</Application> <m3:ShowOn Tile="square150x150Logo" />
</Applications> <m3:ShowOn Tile="wide310x150Logo" />
<Capabilities> </m3:ShowNameOnTiles>
<Capability Name="internetClientServer" /> </m3:DefaultTile>
</Capabilities> <m3:SplashScreen Image="images\SplashScreenPhone.png" />
</m3:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClientServer" />
</Capabilities>
</Package> </Package>
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
under the License. under the License.
--> -->
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest"> <Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
<Identity Name="e8de53c0-cf2d-11e4-8bb0-9369d008f7b1" Version="1.0.0.0" Publisher="CN=$username$" /> <Identity Name="c05631e0-de03-11e4-96be-cfbf5b6cb232" Version="1.0.0.0" Publisher="CN=$username$" />
<Properties> <Properties>
<DisplayName>NotificationExample</DisplayName> <DisplayName>NotificationExample</DisplayName>
<PublisherDisplayName>$username$</PublisherDisplayName> <PublisherDisplayName>$username$</PublisherDisplayName>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</Resources> </Resources>
<Applications> <Applications>
<Application Id="de.appplant.localnotification.example" StartPage="www/index.html"> <Application Id="de.appplant.localnotification.example" StartPage="www/index.html">
<m2:VisualElements DisplayName="NotificationExample" <m2:VisualElements ToastCapable="true" DisplayName="NotificationExample"
Description="CordovaApp" Description="CordovaApp"
ForegroundText="light" ForegroundText="light"
BackgroundColor="#464646" BackgroundColor="#464646"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Licensed to the Apache Software Foundation (ASF) under one Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file or more contributor license agreements. See the NOTICE file
...@@ -16,35 +16,35 @@ ...@@ -16,35 +16,35 @@
KIND, either express or implied. See the License for the KIND, either express or implied. See the License for the
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
--> -->
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest"> <Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Identity Name="e8de53c0-cf2d-11e4-8bb0-9369d008f7b1" Version="1.1.0.0" Publisher="CN=$username$" /> <Identity Name="c05631e0-de03-11e4-96be-cfbf5b6cb232" Version="1.0.0.0" Publisher="CN=$username$" />
<Properties> <Properties>
<DisplayName>NotificationExample</DisplayName> <DisplayName>NotificationExample</DisplayName>
<PublisherDisplayName>$username$</PublisherDisplayName> <PublisherDisplayName>$username$</PublisherDisplayName>
<Logo>images\storelogo.png</Logo> <Logo>images\storelogo.png</Logo>
</Properties> </Properties>
<Prerequisites> <Prerequisites>
<OSMinVersion>6.3.0</OSMinVersion> <OSMinVersion>6.2.1</OSMinVersion>
<OSMaxVersionTested>6.3.0</OSMaxVersionTested> <OSMaxVersionTested>6.2.1</OSMaxVersionTested>
</Prerequisites> </Prerequisites>
<Resources> <Resources>
<Resource Language="x-generate" /> <Resource Language="x-generate" />
</Resources> </Resources>
<Applications> <Applications>
<Application Id="de.appplant.localnotification.example" StartPage="www/index.html"> <Application Id="de.appplant.localnotification.example" StartPage="www/index.html">
<m2:VisualElements DisplayName="NotificationExample" Description="CordovaApp" BackgroundColor="#464646" ForegroundText="light" Square150x150Logo="images\Square150x150Logo.png" Square30x30Logo="images\Square30x30Logo.png"> <VisualElements ToastCapable="true" DisplayName="NotificationExample"
<m2:DefaultTile Wide310x150Logo="images\Wide310x150Logo.png"> Logo="images\Square150x150Logo.png"
<m2:ShowNameOnTiles> SmallLogo="images\Square30x30Logo.png"
<m2:ShowOn Tile="square150x150Logo" /> Description="CordovaApp"
<m2:ShowOn Tile="wide310x150Logo" /> ForegroundText="light"
</m2:ShowNameOnTiles> BackgroundColor="#464646">
</m2:DefaultTile> <DefaultTile ShowName="allLogos" WideLogo="images\Wide310x150Logo.png"/>
<m2:SplashScreen Image="images\splashscreen.png" /> <SplashScreen Image="images\splashscreen.png" />
</m2:VisualElements> </VisualElements>
</Application> </Application>
</Applications> </Applications>
<Capabilities> <Capabilities>
<Capability Name="internetClient" /> <Capability Name="internetClient" />
</Capabilities> </Capabilities>
</Package> </Package>
\ No newline at end of file
...@@ -1298,7 +1298,7 @@ module.exports = { ...@@ -1298,7 +1298,7 @@ module.exports = {
scriptElem.src = "//Microsoft.WinJS.2.0/js/base.js"; scriptElem.src = "//Microsoft.WinJS.2.0/js/base.js";
} else { } else {
// windows 8.0 + IE 10 // windows 8.0 + IE 10
scriptElem.src = "//Microsoft.WinJS.2.0/js/base.js"; scriptElem.src = "//Microsoft.WinJS.1.0/js/base.js";
} }
scriptElem.addEventListener("load", onWinJSReady); scriptElem.addEventListener("load", onWinJSReady);
document.head.appendChild(scriptElem); document.head.appendChild(scriptElem);
......
cordova.define('cordova/plugin_list', function(require, exports, module) { cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [ 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", "file": "plugins/de.appplant.cordova.plugin.local-notification/www/local-notification.js",
"id": "de.appplant.cordova.plugin.local-notification.LocalNotification", "id": "de.appplant.cordova.plugin.local-notification.LocalNotification",
"clobbers": [ "clobbers": [
...@@ -57,6 +46,17 @@ module.exports = [ ...@@ -57,6 +46,17 @@ 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", "file": "plugins/org.apache.cordova.device/www/device.js",
"id": "org.apache.cordova.device.device", "id": "org.apache.cordova.device.device",
"clobbers": [ "clobbers": [
...@@ -74,8 +74,8 @@ module.exports = [ ...@@ -74,8 +74,8 @@ module.exports = [
module.exports.metadata = module.exports.metadata =
// TOP OF METADATA // TOP OF METADATA
{ {
"nl.x-services.plugins.toast": "2.0.3",
"de.appplant.cordova.plugin.local-notification": "0.8.2dev", "de.appplant.cordova.plugin.local-notification": "0.8.2dev",
"nl.x-services.plugins.toast": "2.0.3",
"org.apache.cordova.device": "0.3.0" "org.apache.cordova.device": "0.3.0"
} }
// BOTTOM OF METADATA // BOTTOM OF METADATA
......
...@@ -200,7 +200,9 @@ exports.core = { ...@@ -200,7 +200,9 @@ exports.core = {
clearLocalNotification: function (id) { clearLocalNotification: function (id) {
var notification = this.getAll([id])[0]; var notification = this.getAll([id])[0];
this.getToastHistory().remove('Toast' + id); try {
this.getToastHistory().remove('Toast' + id);
} catch (e) {/*Only Phones support the NotificationHistory*/ }
if (this.isRepeating(notification)) if (this.isRepeating(notification))
return; return;
...@@ -220,7 +222,9 @@ exports.core = { ...@@ -220,7 +222,9 @@ exports.core = {
this.clearLocalNotification(ids[i]); this.clearLocalNotification(ids[i]);
} }
this.getToastHistory().clear(); try {
this.getToastHistory().clear();
} catch (e) {/*Only Phones support the NotificationHistory*/ }
this.fireEvent('clearall'); this.fireEvent('clearall');
}, },
...@@ -251,7 +255,9 @@ exports.core = { ...@@ -251,7 +255,9 @@ exports.core = {
history = this.getToastHistory(), history = this.getToastHistory(),
toasts = this.getScheduledToasts(); toasts = this.getScheduledToasts();
history.remove('Toast' + id); try {
history.remove('Toast' + id);
} catch (e) {/*Only Phones support the NotificationHistory*/ }
for (var i = 0; i < toasts.length; i++) { for (var i = 0; i < toasts.length; i++) {
var toast = toasts[i]; var toast = toasts[i];
...@@ -272,7 +278,9 @@ exports.core = { ...@@ -272,7 +278,9 @@ exports.core = {
this.cancelLocalNotification(ids[i]); this.cancelLocalNotification(ids[i]);
} }
this.getToastHistory().clear(); try {
this.getToastHistory().clear();
} catch (e) {/*Only Phones support the NotificationHistory*/ }
this.fireEvent('cancelall'); this.fireEvent('cancelall');
}, },
......
...@@ -86,20 +86,52 @@ exports.isRepeating = function (notification) { ...@@ -86,20 +86,52 @@ exports.isRepeating = function (notification) {
* @param {String} path * @param {String} path
* Relative path to sound resource * Relative path to sound resource
* *
* @return {String} URI to Sound-File * @return {String} XML Tag for Sound-File
*/ */
exports.parseSound = function (path) { exports.parseSound = function (path) {
if (!path.match(/^file/))
return '';
var uri = this.parseUri(path),
audio = "<audio src=" + uri + " loop='false'/>";
return audio;
};
/**
* Parses image file path.
*
* @param {String} path
* Relative path to image resource
*
* @return {String} XML-Tag for Image-File
*/
exports.parseImage = function (path) {
if (!path.match(/^file/))
return '';
var uri = this.parseUri(path),
image = "<image id='1' src=" + uri + " />";
return image;
};
/**
* Parses file path to URI.
*
* @param {String} path
* Relative path to a resource
*
* @return {String} URI to File
*/
exports.parseUri = function (path) {
var pkg = Windows.ApplicationModel.Package.current, var pkg = Windows.ApplicationModel.Package.current,
pkgId = pkg.id, pkgId = pkg.id,
pkgName = pkgId.name; pkgName = pkgId.name;
if (!path.match(/^file/)) var uri = "'ms-appx://" + pkgName + "/www" + path.slice(6, path.length) + "'";
return;
var sound = "'ms-appx://" + pkgName + "/www/" + path.slice(6, path.length) + "'", return uri;
audio = "<audio src=" + sound + " loop='false'/>";
return audio;
}; };
/** /**
...@@ -141,37 +173,47 @@ exports.build = function (options) { ...@@ -141,37 +173,47 @@ exports.build = function (options) {
* @return String * @return String
*/ */
exports.buildToastTemplate = function (options) { exports.buildToastTemplate = function (options) {
var title = options.title, var title = options.title,
message = options.text || '', message = options.text || '',
json = JSON.stringify(options), json = JSON.stringify(options),
sound = ''; sound = '';
if (options.sound && options.sound !== '') { if (options.sound && options.sound !== '') {
sound = this.parseSound(options.sound); sound = this.parseSound(options.sound);
} }
if (title && title !== '') { var templateName = "ToastText",
return "<toast>" + imageNode;
"<visual>" + if (options.icon && options.icon !== '') {
"<binding template='ToastText02'>" + imageNode = this.parseImage(options.icon);
"<text id='1'>" + title + "</text>" + // template with Image
"<text id='2'>" + message + "</text>" + if (imageNode !== '') {
"</binding>" + templateName = "ToastImageAndText";
"</visual>" + };
sound + } else {
"<json>" + json + "</json>" + imageNode = "";
"</toast>"; }
} else {
return "<toast>" + var bindingNode;
"<visual>" + if (title && title !== '') {
"<binding template='ToastText01'>" + bindingNode = "<binding template='" + templateName + "02'>" +
"<text id='1'>" + message + "</text>" + imageNode +
"</binding>" + "<text id='1'>" + title + "</text>" +
"</visual>" + "<text id='2'>" + message + "</text>" +
sound + "</binding>";
"<json>" + json + "</json>" + } else {
"</toast>"; bindingNode = "<binding template='" + templateName + "01'>" +
} imageNode +
"<text id='1'>" + message + "</text>" +
"</binding>";
}
return "<toast>" +
"<visual>" +
bindingNode +
"</visual>" +
sound +
"<json>" + json + "</json>" +
"</toast>";
}; };
/** /**
......
...@@ -275,7 +275,8 @@ exports.get = function () { ...@@ -275,7 +275,8 @@ exports.get = function () {
scope = args[2]; scope = args[2];
if (!Array.isArray(ids)) { if (!Array.isArray(ids)) {
ids = [ids]; this.exec('getSingle', ids.toString(), callback, scope);
return;
} }
ids = this.convertIds(ids); ids = this.convertIds(ids);
...@@ -321,6 +322,11 @@ exports.getScheduled = function () { ...@@ -321,6 +322,11 @@ exports.getScheduled = function () {
ids = [ids]; ids = [ids];
} }
if (!Array.isArray(ids)) {
this.exec('getSingleScheduled', ids.toString(), callback, scope);
return;
}
ids = this.convertIds(ids); ids = this.convertIds(ids);
this.exec('getScheduled', ids, callback, scope); this.exec('getScheduled', ids, callback, scope);
...@@ -364,6 +370,11 @@ exports.getTriggered = function () { ...@@ -364,6 +370,11 @@ exports.getTriggered = function () {
ids = [ids]; ids = [ids];
} }
if (!Array.isArray(ids)) {
this.exec('getSingleTriggered', ids.toString(), callback, scope);
return;
}
ids = this.convertIds(ids); ids = this.convertIds(ids);
this.exec('getTriggered', ids, callback, scope); this.exec('getTriggered', ids, callback, scope);
......
...@@ -59,6 +59,10 @@ ...@@ -59,6 +59,10 @@
{ {
"xml": "<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\" />", "xml": "<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\" />",
"count": 1 "count": 1
},
{
"xml": "<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />",
"count": 1
} }
] ]
} }
......
...@@ -30,8 +30,8 @@ For example, applications that depend on servers for messages or data can poll t ...@@ -30,8 +30,8 @@ For example, applications that depend on servers for messages or data can poll t
The current 0.8 branch supports the following platforms: The current 0.8 branch supports the following platforms:
- __iOS__ _(including iOS8)_<br> - __iOS__ _(including iOS8)_<br>
- __Android__ _(SDK >=7)_ - __Android__ _(SDK >=7)_
- __Windows 8.1__ _(added with v0.8.2)_
The partial support for WP8.0 has been dropped, but the Windows (Phone) 8.1 platform will be fully supported soon. - __Windows Phone 8.1__ _(added with v0.8.2)_
Find out more informations [here][wiki_platforms] in our wiki. Find out more informations [here][wiki_platforms] in our wiki.
......
...@@ -130,6 +130,7 @@ ...@@ -130,6 +130,7 @@
<config-file target="AndroidManifest.xml" parent="/manifest"> <config-file target="AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</config-file> </config-file>
<lib-file src="libs/android/android-support-v4.jar" /> <lib-file src="libs/android/android-support-v4.jar" />
......
#!/usr/bin/env node
/* /*
* Copyright (c) 2013-2015 by appPlant UG. All rights reserved. * Copyright (c) 2013-2015 by appPlant UG. All rights reserved.
* *
......
#!/usr/bin/env node #!/usr/bin/env node
// This Plugin-Hook sets ToastCapable on true to allow windows-platform /*
// cordova apps displaing local-notifications * 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@
*/
// Includes a snippet into the cordova-core js file
// to fire the activated event after device is ready
var fs = require('fs'), var fs = require('fs'),
rootdir = process.argv[2]; rootdir = process.argv[2];
...@@ -9,7 +34,17 @@ var fs = require('fs'), ...@@ -9,7 +34,17 @@ var fs = require('fs'),
if (!rootdir) if (!rootdir)
return; return;
function replace_string_in_file (filename, to_replace, replace_with) { /**
* 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 (filename, to_replace, replace_with) {
var data = fs.readFileSync(filename, 'utf8'), var data = fs.readFileSync(filename, 'utf8'),
result; result;
...@@ -20,6 +55,7 @@ function replace_string_in_file (filename, to_replace, replace_with) { ...@@ -20,6 +55,7 @@ function replace_string_in_file (filename, to_replace, replace_with) {
fs.writeFileSync(filename, result, 'utf8'); fs.writeFileSync(filename, result, 'utf8');
} }
// Fires the activated event again after device is ready
var snippet = var snippet =
"var activatedHandler = function (args) {" + "var activatedHandler = function (args) {" +
"channel.deviceready.subscribe(function () {" + "channel.deviceready.subscribe(function () {" +
...@@ -32,13 +68,13 @@ var snippet = ...@@ -32,13 +68,13 @@ var snippet =
"}, false);\n" + "}, false);\n" +
" app.start();"; " app.start();";
// Path to cordova-core js files where the snippet needs to be included
var files = [ var files = [
'platforms/windows/www/cordova.js', 'platforms/windows/www/cordova.js',
'platforms/windows/platform_www/cordova.js' 'platforms/windows/platform_www/cordova.js'
]; ];
// Includes the snippet before app.start() is called
for (var i = 0; i < files.length; i++) { for (var i = 0; i < files.length; i++) {
replace_string_in_file(files[i], 'app.start();', snippet); replace(files[i], 'app.start();', snippet);
} }
#!/usr/bin/env node #!/usr/bin/env node
// This Plugin-Hook sets ToastCapable on true to allow windows-platform /*
// cordova apps displaing local-notifications * 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 sets ToastCapable on true to enable local-notifications
var fs = require('fs'), var fs = require('fs'),
rootdir = process.argv[2]; rootdir = process.argv[2];
...@@ -9,11 +33,21 @@ var fs = require('fs'), ...@@ -9,11 +33,21 @@ var fs = require('fs'),
if (!rootdir) if (!rootdir)
return; return;
function replace_string_in_file (filename, to_replace, replace_with) { /**
* 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 (filename, to_replace, replace_with) {
var data = fs.readFileSync(filename, 'utf8'), var data = fs.readFileSync(filename, 'utf8'),
result; result;
if (data.indexOf(replace_with) > -1) if (data.indexOf('ToastCapable') > -1)
return; return;
result = data.replace(new RegExp(to_replace, 'g'), replace_with); result = data.replace(new RegExp(to_replace, 'g'), replace_with);
...@@ -21,13 +55,9 @@ function replace_string_in_file (filename, to_replace, replace_with) { ...@@ -21,13 +55,9 @@ function replace_string_in_file (filename, to_replace, replace_with) {
fs.writeFileSync(filename, result, 'utf8'); fs.writeFileSync(filename, result, 'utf8');
} }
// Set ToastCapable for Windows Phone
var manifests = [ replace('platforms/windows/package.phone.appxmanifest', '<m3:VisualElements', '<m3:VisualElements ToastCapable="true"');
'platforms/windows/package.phone.appxmanifest', // Set ToastCapable for Windows 8.1
'platforms/windows/package.windows.appxmanifest', replace('platforms/windows/package.windows.appxmanifest', '<m2:VisualElements', '<m2:VisualElements ToastCapable="true"');
'platforms/windows/package.windows80.appxmanifest' // Set ToastCapable for Windows 8.0
]; replace('platforms/windows/package.windows80.appxmanifest', '<VisualElements', '<VisualElements ToastCapable="true"');
for (var i = 0; i < manifests.length; i++) {
replace_string_in_file(manifests[i], '<m3:VisualElements ', '<m3:VisualElements ToastCapable="true" ');
}
...@@ -174,6 +174,15 @@ public class LocalNotification extends CordovaPlugin { ...@@ -174,6 +174,15 @@ public class LocalNotification extends CordovaPlugin {
else if (action.equals("getTriggeredIds")) { else if (action.equals("getTriggeredIds")) {
getTriggeredIds(command); getTriggeredIds(command);
} }
else if (action.equals("getSingle")) {
getSingle(args, command);
}
else if (action.equals("getSingleScheduled")) {
getSingleScheduled(args, command);
}
else if (action.equals("getSingleTriggered")) {
getSingleTriggered(args, command);
}
else if (action.equals("getAll")) { else if (action.equals("getAll")) {
getAll(args, command); getAll(args, command);
} }
...@@ -369,23 +378,51 @@ public class LocalNotification extends CordovaPlugin { ...@@ -369,23 +378,51 @@ public class LocalNotification extends CordovaPlugin {
} }
/** /**
* Set of options from local notification. * Options from local notification.
* *
* @param ids * @param ids
* Set of local notification IDs * Set of local notification IDs
* @param command * @param command
* The callback context used when calling back into JavaScript. * The callback context used when calling back into JavaScript.
*/ */
private void getAll (JSONArray ids, CallbackContext command) { private void getSingle (JSONArray ids, CallbackContext command) {
List<JSONObject> options; getOptions(ids.optString(0), Notification.Type.ALL, command);
}
if (ids.length() == 0) { /**
options = getNotificationMgr().getOptions(); * Options from scheduled notification.
} else { *
options = getNotificationMgr().getOptionsById(toList(ids)); * @param ids
} * Set of local notification IDs
* @param command
* The callback context used when calling back into JavaScript.
*/
private void getSingleScheduled (JSONArray ids, CallbackContext command) {
getOptions(ids.optString(0), Notification.Type.SCHEDULED, command);
}
command.success(new JSONArray(options)); /**
* Options from triggered notification.
*
* @param ids
* Set of local notification IDs
* @param command
* The callback context used when calling back into JavaScript.
*/
private void getSingleTriggered (JSONArray ids, CallbackContext command) {
getOptions(ids.optString(0), Notification.Type.TRIGGERED, command);
}
/**
* Set of options from local notification.
*
* @param ids
* Set of local notification IDs
* @param command
* The callback context used when calling back into JavaScript.
*/
private void getAll (JSONArray ids, CallbackContext command) {
getOptions(ids, Notification.Type.ALL, command);
} }
/** /**
...@@ -397,16 +434,7 @@ public class LocalNotification extends CordovaPlugin { ...@@ -397,16 +434,7 @@ public class LocalNotification extends CordovaPlugin {
* The callback context used when calling back into JavaScript. * The callback context used when calling back into JavaScript.
*/ */
private void getScheduled (JSONArray ids, CallbackContext command) { private void getScheduled (JSONArray ids, CallbackContext command) {
List<JSONObject> options; getOptions(ids, Notification.Type.SCHEDULED, command);
if (ids.length() == 0) {
options = getNotificationMgr().getOptionsByType(Notification.Type.SCHEDULED);
} else {
options = getNotificationMgr().getOptionsBy(
Notification.Type.SCHEDULED, toList(ids));
}
command.success(new JSONArray(options));
} }
/** /**
...@@ -418,13 +446,49 @@ public class LocalNotification extends CordovaPlugin { ...@@ -418,13 +446,49 @@ public class LocalNotification extends CordovaPlugin {
* The callback context used when calling back into JavaScript. * The callback context used when calling back into JavaScript.
*/ */
private void getTriggered (JSONArray ids, CallbackContext command) { private void getTriggered (JSONArray ids, CallbackContext command) {
getOptions(ids, Notification.Type.TRIGGERED, command);
}
/**
* Options from local notification.
*
* @param id
* Set of local notification IDs
* @param type
* The local notification life cycle type
* @param command
* The callback context used when calling back into JavaScript.
*/
private void getOptions (String id, Notification.Type type,
CallbackContext command) {
JSONArray ids = new JSONArray().put(id);
JSONObject options =
getNotificationMgr().getOptionsBy(type, toList(ids)).get(0);
command.success(options);
}
/**
* Set of options from local notifications.
*
* @param ids
* Set of local notification IDs
* @param type
* The local notification life cycle type
* @param command
* The callback context used when calling back into JavaScript.
*/
private void getOptions (JSONArray ids, Notification.Type type,
CallbackContext command) {
List<JSONObject> options; List<JSONObject> options;
if (ids.length() == 0) { if (ids.length() == 0) {
options = getNotificationMgr().getOptionsByType(Notification.Type.TRIGGERED); options = getNotificationMgr().getOptionsByType(type);
} else { } else {
options = getNotificationMgr().getOptionsBy( options = getNotificationMgr().getOptionsBy(type, toList(ids));
Notification.Type.TRIGGERED, toList(ids));
} }
command.success(new JSONArray(options)); command.success(new JSONArray(options));
......
...@@ -48,7 +48,7 @@ import java.util.Set; ...@@ -48,7 +48,7 @@ import java.util.Set;
public class Manager { public class Manager {
// Context passed through constructor and used for notification builder. // Context passed through constructor and used for notification builder.
private Context context; private Context context;
/** /**
* Constructor * Constructor
...@@ -56,9 +56,9 @@ public class Manager { ...@@ -56,9 +56,9 @@ public class Manager {
* @param context * @param context
* Application context * Application context
*/ */
private Manager(Context context){ private Manager(Context context){
this.context = context; this.context = context;
} }
/** /**
* Static method to retrieve class instance. * Static method to retrieve class instance.
...@@ -256,6 +256,9 @@ public class Manager { ...@@ -256,6 +256,9 @@ public class Manager {
List<Notification> notifications = getAll(); List<Notification> notifications = getAll();
ArrayList<Notification> list = new ArrayList<Notification>(); ArrayList<Notification> list = new ArrayList<Notification>();
if (type == Notification.Type.ALL)
return notifications;
for (Notification notification : notifications) { for (Notification notification : notifications) {
if (notification.getType() == type) { if (notification.getType() == type) {
list.add(notification); list.add(notification);
...@@ -368,6 +371,9 @@ public class Manager { ...@@ -368,6 +371,9 @@ public class Manager {
public List<JSONObject> getOptionsBy(Notification.Type type, public List<JSONObject> getOptionsBy(Notification.Type type,
List<Integer> ids) { List<Integer> ids) {
if (type == Notification.Type.ALL)
return getOptionsById(ids);
ArrayList<JSONObject> options = new ArrayList<JSONObject>(); ArrayList<JSONObject> options = new ArrayList<JSONObject>();
List<Notification> notifications = getByIds(ids); List<Notification> notifications = getByIds(ids);
......
...@@ -46,7 +46,7 @@ public class Notification { ...@@ -46,7 +46,7 @@ public class Notification {
// Used to differ notifications by their life cycle state // Used to differ notifications by their life cycle state
public static enum Type { public static enum Type {
SCHEDULED, TRIGGERED ALL, SCHEDULED, TRIGGERED
} }
// Default receiver to handle the trigger event // Default receiver to handle the trigger event
......
...@@ -200,7 +200,9 @@ exports.core = { ...@@ -200,7 +200,9 @@ exports.core = {
clearLocalNotification: function (id) { clearLocalNotification: function (id) {
var notification = this.getAll([id])[0]; var notification = this.getAll([id])[0];
this.getToastHistory().remove('Toast' + id); try {
this.getToastHistory().remove('Toast' + id);
} catch (e) {/*Only Phones support the NotificationHistory*/ }
if (this.isRepeating(notification)) if (this.isRepeating(notification))
return; return;
...@@ -220,7 +222,9 @@ exports.core = { ...@@ -220,7 +222,9 @@ exports.core = {
this.clearLocalNotification(ids[i]); this.clearLocalNotification(ids[i]);
} }
this.getToastHistory().clear(); try {
this.getToastHistory().clear();
} catch (e) {/*Only Phones support the NotificationHistory*/ }
this.fireEvent('clearall'); this.fireEvent('clearall');
}, },
...@@ -251,7 +255,9 @@ exports.core = { ...@@ -251,7 +255,9 @@ exports.core = {
history = this.getToastHistory(), history = this.getToastHistory(),
toasts = this.getScheduledToasts(); toasts = this.getScheduledToasts();
history.remove('Toast' + id); try {
history.remove('Toast' + id);
} catch (e) {/*Only Phones support the NotificationHistory*/ }
for (var i = 0; i < toasts.length; i++) { for (var i = 0; i < toasts.length; i++) {
var toast = toasts[i]; var toast = toasts[i];
...@@ -272,7 +278,9 @@ exports.core = { ...@@ -272,7 +278,9 @@ exports.core = {
this.cancelLocalNotification(ids[i]); this.cancelLocalNotification(ids[i]);
} }
this.getToastHistory().clear(); try {
this.getToastHistory().clear();
} catch (e) {/*Only Phones support the NotificationHistory*/ }
this.fireEvent('cancelall'); this.fireEvent('cancelall');
}, },
......
...@@ -86,20 +86,52 @@ exports.isRepeating = function (notification) { ...@@ -86,20 +86,52 @@ exports.isRepeating = function (notification) {
* @param {String} path * @param {String} path
* Relative path to sound resource * Relative path to sound resource
* *
* @return {String} URI to Sound-File * @return {String} XML Tag for Sound-File
*/ */
exports.parseSound = function (path) { exports.parseSound = function (path) {
if (!path.match(/^file/))
return '';
var uri = this.parseUri(path),
audio = "<audio src=" + uri + " loop='false'/>";
return audio;
};
/**
* Parses image file path.
*
* @param {String} path
* Relative path to image resource
*
* @return {String} XML-Tag for Image-File
*/
exports.parseImage = function (path) {
if (!path.match(/^file/))
return '';
var uri = this.parseUri(path),
image = "<image id='1' src=" + uri + " />";
return image;
};
/**
* Parses file path to URI.
*
* @param {String} path
* Relative path to a resource
*
* @return {String} URI to File
*/
exports.parseUri = function (path) {
var pkg = Windows.ApplicationModel.Package.current, var pkg = Windows.ApplicationModel.Package.current,
pkgId = pkg.id, pkgId = pkg.id,
pkgName = pkgId.name; pkgName = pkgId.name;
if (!path.match(/^file/)) var uri = "'ms-appx://" + pkgName + "/www" + path.slice(6, path.length) + "'";
return;
var sound = "'ms-appx://" + pkgName + "/www/" + path.slice(6, path.length) + "'", return uri;
audio = "<audio src=" + sound + " loop='false'/>";
return audio;
}; };
/** /**
...@@ -141,37 +173,47 @@ exports.build = function (options) { ...@@ -141,37 +173,47 @@ exports.build = function (options) {
* @return String * @return String
*/ */
exports.buildToastTemplate = function (options) { exports.buildToastTemplate = function (options) {
var title = options.title, var title = options.title,
message = options.text || '', message = options.text || '',
json = JSON.stringify(options), json = JSON.stringify(options),
sound = ''; sound = '';
if (options.sound && options.sound !== '') { if (options.sound && options.sound !== '') {
sound = this.parseSound(options.sound); sound = this.parseSound(options.sound);
} }
if (title && title !== '') { var templateName = "ToastText",
return "<toast>" + imageNode;
"<visual>" + if (options.icon && options.icon !== '') {
"<binding template='ToastText02'>" + imageNode = this.parseImage(options.icon);
"<text id='1'>" + title + "</text>" + // template with Image
"<text id='2'>" + message + "</text>" + if (imageNode !== '') {
"</binding>" + templateName = "ToastImageAndText";
"</visual>" + };
sound + } else {
"<json>" + json + "</json>" + imageNode = "";
"</toast>"; }
} else {
return "<toast>" + var bindingNode;
"<visual>" + if (title && title !== '') {
"<binding template='ToastText01'>" + bindingNode = "<binding template='" + templateName + "02'>" +
"<text id='1'>" + message + "</text>" + imageNode +
"</binding>" + "<text id='1'>" + title + "</text>" +
"</visual>" + "<text id='2'>" + message + "</text>" +
sound + "</binding>";
"<json>" + json + "</json>" + } else {
"</toast>"; bindingNode = "<binding template='" + templateName + "01'>" +
} imageNode +
"<text id='1'>" + message + "</text>" +
"</binding>";
}
return "<toast>" +
"<visual>" +
bindingNode +
"</visual>" +
sound +
"<json>" + json + "</json>" +
"</toast>";
}; };
/** /**
......
...@@ -275,7 +275,8 @@ exports.get = function () { ...@@ -275,7 +275,8 @@ exports.get = function () {
scope = args[2]; scope = args[2];
if (!Array.isArray(ids)) { if (!Array.isArray(ids)) {
ids = [ids]; this.exec('getSingle', ids.toString(), callback, scope);
return;
} }
ids = this.convertIds(ids); ids = this.convertIds(ids);
...@@ -321,6 +322,11 @@ exports.getScheduled = function () { ...@@ -321,6 +322,11 @@ exports.getScheduled = function () {
ids = [ids]; ids = [ids];
} }
if (!Array.isArray(ids)) {
this.exec('getSingleScheduled', ids.toString(), callback, scope);
return;
}
ids = this.convertIds(ids); ids = this.convertIds(ids);
this.exec('getScheduled', ids, callback, scope); this.exec('getScheduled', ids, callback, scope);
...@@ -364,6 +370,11 @@ exports.getTriggered = function () { ...@@ -364,6 +370,11 @@ exports.getTriggered = function () {
ids = [ids]; ids = [ids];
} }
if (!Array.isArray(ids)) {
this.exec('getSingleTriggered', ids.toString(), callback, scope);
return;
}
ids = this.convertIds(ids); ids = this.convertIds(ids);
this.exec('getTriggered', ids, callback, scope); this.exec('getTriggered', ids, callback, scope);
......
...@@ -10,5 +10,11 @@ ...@@ -10,5 +10,11 @@
"type": "registry", "type": "registry",
"id": "org.apache.cordova.device" "id": "org.apache.cordova.device"
} }
},
"de.appplant.cordova.plugin.email-composer": {
"source": {
"type": "local",
"path": "../cordova-plugin-email-composer"
}
} }
} }
\ 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
} }
] ]
...@@ -30,16 +30,17 @@ ...@@ -30,16 +30,17 @@
"xml": false, "xml": false,
"count": 1 "count": 1
} }
] ],
"MessageUI.framework": []
} }
} }
} }
}, },
"installed_plugins": { "installed_plugins": {
"de.appplant.cordova.plugin.local-notification": { "nl.x-services.plugins.toast": {
"PACKAGE_NAME": "de.appplant.localnotification.example" "PACKAGE_NAME": "de.appplant.localnotification.example"
}, },
"nl.x-services.plugins.toast": { "de.appplant.cordova.plugin.local-notification": {
"PACKAGE_NAME": "de.appplant.localnotification.example" "PACKAGE_NAME": "de.appplant.localnotification.example"
} }
}, },
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
"files": {} "files": {}
}, },
"installed_plugins": { "installed_plugins": {
"nl.x-services.plugins.toast": { "de.appplant.cordova.plugin.local-notification": {
"PACKAGE_NAME": "NotificationExample" "PACKAGE_NAME": "NotificationExample"
}, },
"de.appplant.cordova.plugin.local-notification": { "nl.x-services.plugins.toast": {
"PACKAGE_NAME": "NotificationExample" "PACKAGE_NAME": "NotificationExample"
} }
}, },
......
...@@ -308,6 +308,7 @@ ...@@ -308,6 +308,7 @@
<!-- IDs --> <!-- IDs -->
<script type="text/javascript"> <script type="text/javascript">
var callbackIds = function (ids) { var callbackIds = function (ids) {
console.log(ids);
showToast(ids.length === 0 ? '- none -' : ids.join(' ,')); showToast(ids.length === 0 ? '- none -' : ids.join(' ,'));
}; };
...@@ -331,8 +332,13 @@ ...@@ -331,8 +332,13 @@
showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,')); showToast(notifications.length === 0 ? '- none -' : notifications.join(' ,'));
}; };
var callbackSingleOpts = function (notification) {
console.log(notification);
showToast(notification.toString());
};
get = function () { get = function () {
cordova.plugins.notification.local.get(1, callbackOpts); cordova.plugins.notification.local.get(1, callbackSingleOpts);
}; };
getMultiple = function () { getMultiple = function () {
......
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