summaryrefslogtreecommitdiff
path: root/StoneIsland/plugins/phonegap-plugin-push/docs/EXAMPLES.md
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2017-02-16 01:24:12 +0100
committerJules Laplace <jules@okfoc.us>2017-02-16 01:24:12 +0100
commit30c49550c89c1b69c680170d2dc247eac76bd463 (patch)
tree8732652298b630b9ba15def97e59738f1c9bf7b6 /StoneIsland/plugins/phonegap-plugin-push/docs/EXAMPLES.md
parent8f1f626384e6ba75f4fb24c27e0973260a74421b (diff)
push plugin
Diffstat (limited to 'StoneIsland/plugins/phonegap-plugin-push/docs/EXAMPLES.md')
-rw-r--r--StoneIsland/plugins/phonegap-plugin-push/docs/EXAMPLES.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/StoneIsland/plugins/phonegap-plugin-push/docs/EXAMPLES.md b/StoneIsland/plugins/phonegap-plugin-push/docs/EXAMPLES.md
new file mode 100644
index 00000000..8481e7bc
--- /dev/null
+++ b/StoneIsland/plugins/phonegap-plugin-push/docs/EXAMPLES.md
@@ -0,0 +1,43 @@
+# Creating a Project From a Template
+
+If you want to get started with a sample project you can create a new project from the example template.
+
+```
+phonegap create my-app --template phonegap-template-push
+```
+
+## Quick Example
+
+```javascript
+var push = PushNotification.init({
+ android: {
+ senderID: "12345679"
+ },
+ browser: {
+ pushServiceURL: 'http://push.api.phonegap.com/v1/push'
+ },
+ ios: {
+ alert: "true",
+ badge: "true",
+ sound: "true"
+ },
+ windows: {}
+});
+
+push.on('registration', function(data) {
+ // data.registrationId
+});
+
+push.on('notification', function(data) {
+ // data.message,
+ // data.title,
+ // data.count,
+ // data.sound,
+ // data.image,
+ // data.additionalData
+});
+
+push.on('error', function(e) {
+ // e.message
+});
+```