-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
26 lines (26 loc) · 8.03 KB
/
package.json
File metadata and controls
26 lines (26 loc) · 8.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
"version": "0.2.10",
"name": "org.apache.cordova.dialogs",
"cordova_name": "Notification",
"description": "Cordova Notification Plugin",
"license": "Apache 2.0",
"repo": "https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git",
"issue": "https://issues.apache.org/jira/browse/CB/component/12320642",
"keywords": [
"cordova",
"notification"
],
"platforms": [
"firefoxos",
"android",
"amazon-fireos",
"ubuntu",
"ios",
"blackberry10",
"wp7",
"wp8",
"windows8"
],
"engines": [],
"englishdoc": "<!---\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See the NOTICE file\n distributed with this work for additional information\n regarding copyright ownership. The ASF licenses this file\n to you under the Apache License, Version 2.0 (the\n \"License\"); you may not use this file except in compliance\n with the License. You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing,\n software distributed under the License is distributed on an\n \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n KIND, either express or implied. See the License for the\n specific language governing permissions and limitations\n under the License.\n-->\n\n# org.apache.cordova.dialogs\n\nThis plugin provides access to some native dialog UI elements.\n\n## Installation\n\n cordova plugin add org.apache.cordova.dialogs\n\n## Methods\n\n- `navigator.notification.alert`\n- `navigator.notification.confirm`\n- `navigator.notification.prompt`\n- `navigator.notification.beep`\n\n## navigator.notification.alert\n\nShows a custom alert or dialog box. Most Cordova implementations use a native\ndialog box for this feature, but some platforms use the browser's `alert`\nfunction, which is typically less customizable.\n\n navigator.notification.alert(message, alertCallback, [title], [buttonName])\n\n- __message__: Dialog message. _(String)_\n\n- __alertCallback__: Callback to invoke when alert dialog is dismissed. _(Function)_\n\n- __title__: Dialog title. _(String)_ (Optional, defaults to `Alert`)\n\n- __buttonName__: Button name. _(String)_ (Optional, defaults to `OK`)\n\n\n### Example\n\n function alertDismissed() {\n // do something\n }\n\n navigator.notification.alert(\n 'You are the winner!', // message\n alertDismissed, // callback\n 'Game Over', // title\n 'Done' // buttonName\n );\n\n### Supported Platforms\n\n- Amazon Fire OS\n- Android\n- BlackBerry 10\n- Firefox OS\n- iOS\n- Tizen\n- Windows Phone 7 and 8\n- Windows 8\n\n### Windows Phone 7 and 8 Quirks\n\n- There is no built-in browser alert, but you can bind one as follows to call `alert()` in the global scope:\n\n window.alert = navigator.notification.alert;\n\n- Both `alert` and `confirm` are non-blocking calls, results of which are only available asynchronously.\n\n### Firefox OS Quirks:\n\nBoth native-blocking `window.alert()` and non-blocking `navigator.notification.alert()` are available.\n\n## navigator.notification.confirm\n\nDisplays a customizable confirmation dialog box.\n\n navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])\n\n- __message__: Dialog message. _(String)_\n\n- __confirmCallback__: Callback to invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0). _(Function)_\n\n- __title__: Dialog title. _(String)_ (Optional, defaults to `Confirm`)\n\n- __buttonLabels__: Array of strings specifying button labels. _(Array)_ (Optional, defaults to [`OK,Cancel`])\n\n\n### confirmCallback\n\nThe `confirmCallback` executes when the user presses one of the\nbuttons in the confirmation dialog box.\n\nThe callback takes the argument `buttonIndex` _(Number)_, which is the\nindex of the pressed button. Note that the index uses one-based\nindexing, so the value is `1`, `2`, `3`, etc.\n\n### Example\n\n function onConfirm(buttonIndex) {\n alert('You selected button ' + buttonIndex);\n }\n\n navigator.notification.confirm(\n 'You are the winner!', // message\n onConfirm, // callback to invoke with index of button pressed\n 'Game Over', // title\n ['Restart','Exit'] // buttonLabels\n );\n\n### Supported Platforms\n\n- Amazon Fire OS\n- Android\n- BlackBerry 10\n- Firefox OS\n- iOS\n- Tizen\n- Windows Phone 7 and 8\n- Windows 8\n\n### Windows Phone 7 and 8 Quirks\n\n- There is no built-in browser function for `window.confirm`, but you can bind it by assigning:\n\n window.confirm = navigator.notification.confirm;\n\n- Calls to `alert` and `confirm` are non-blocking, so the result is only available asynchronously.\n\n### Firefox OS Quirks:\n\nBoth native-blocking `window.confirm()` and non-blocking `navigator.notification.confirm()` are available.\n\n## navigator.notification.prompt\n\nDisplays a native dialog box that is more customizable than the browser's `prompt` function.\n\n navigator.notification.prompt(message, promptCallback, [title], [buttonLabels], [defaultText])\n\n- __message__: Dialog message. _(String)_\n\n- __promptCallback__: Callback to invoke with index of button pressed (1, 2, or 3) or when the dialog is dismissed without a button press (0). _(Function)_\n\n- __title__: Dialog title _(String)_ (Optional, defaults to `Prompt`)\n\n- __buttonLabels__: Array of strings specifying button labels _(Array)_ (Optional, defaults to `[\"OK\",\"Cancel\"]`)\n\n- __defaultText__: Default textbox input value (`String`) (Optional, Default: empty string)\n\n### promptCallback\n\nThe `promptCallback` executes when the user presses one of the buttons\nin the prompt dialog box. The `results` object passed to the callback\ncontains the following properties:\n\n- __buttonIndex__: The index of the pressed button. _(Number)_ Note that the index uses one-based indexing, so the value is `1`, `2`, `3`, etc.\n\n\n\n- __input1__: The text entered in the prompt dialog box. _(String)_\n\n### Example\n\n function onPrompt(results) {\n alert(\"You selected button number \" + results.buttonIndex + \" and entered \" + results.input1);\n }\n\n navigator.notification.prompt(\n 'Please enter your name', // message\n onPrompt, // callback to invoke\n 'Registration', // title\n ['Ok','Exit'], // buttonLabels\n 'Jane Doe' // defaultText\n );\n\n### Supported Platforms\n\n- Amazon Fire OS\n- Android\n- Firefox OS\n- iOS\n- Windows Phone 7 and 8\n\n### Android Quirks\n\n- Android supports a maximum of three buttons, and ignores any more than that.\n\n- On Android 3.0 and later, buttons are displayed in reverse order for devices that use the Holo theme.\n\n### Firefox OS Quirks:\n\nBoth native-blocking `window.prompt()` and non-blocking `navigator.notification.prompt()` are available.\n\n## navigator.notification.beep\n\nThe device plays a beep sound.\n\n navigator.notification.beep(times);\n\n- __times__: The number of times to repeat the beep. _(Number)_\n\n### Example\n\n // Beep twice!\n navigator.notification.beep(2);\n\n### Supported Platforms\n\n- Amazon Fire OS\n- Android\n- BlackBerry 10\n- iOS\n- Tizen\n- Windows Phone 7 and 8\n- Windows 8\n\n### Amazon Fire OS Quirks\n\n- Amazon Fire OS plays the default __Notification Sound__ specified under the __Settings/Display & Sound__ panel.\n\n### Android Quirks\n\n- Android plays the default __Notification ringtone__ specified under the __Settings/Sound & Display__ panel.\n\n### Windows Phone 7 and 8 Quirks\n\n- Relies on a generic beep file from the Cordova distribution.\n\n### Tizen Quirks\n\n- Tizen implements beeps by playing an audio file via the media API.\n\n- The beep file must be short, must be located in a `sounds` subdirectory of the application's root directory, and must be named `beep.wav`.\n\n"
}