简体   繁体   English

Cordova 3.3中的用户推送通知

[英]User push notifications in cordova 3.3

I want to implement notifications in android using 3.3 cordova, I'm new at this. 我想使用3.3 cordova在android中实现通知,这是我的新手。 I have tried several tutorials but without success. 我尝试了一些教程,但没有成功。 Could explain a simple way to implement it step by step? 能解释一步一步实现的简单方法吗?

Thank You 谢谢

Use this phonegap plugin for push notification both in Android and IOS. 使用此phonegap插件在Android和IOS中进行推送通知。 It works fine for me. 这对我来说可以。

https://github.com/phonegap-build/PushPlugin https://github.com/phonegap-build/PushPlugin

Cordova Push Notifications Plugin for Android, iOS and WP8 适用于Android,iOS和WP8的Cordova推送通知插件

This plugin is for use with Cordova, and allows your application to receive push notifications on both Android and iOS devices. 此插件可与Cordova一起使用,并允许您的应用程序在Android和iOS设备上接收推送通知。 The Android implementation uses Google's GCM (Google Cloud Messaging) service , whereas the iOS version is based on Apple APNS Notifications . Android实现使用Google的GCM(谷歌云消息传递)服务 ,而iOS版本则基于Apple APNS Notifications

Follow the given step by step 按照给定的步骤

1) PushPlugin 1) PushPlugin

2) Implement Push Notifications in your PhoneGap Application 2) 在您的PhoneGap应用程序中实现推送通知

Note: Dont't forget to add cordova_plugin.js and PushNotification.js file in your page. 注意: 不要忘记在页面中添加cordova_plugin.js和PushNotification.js文件。

You can copy/paste the instruction on this link . 您可以复制/粘贴此链接上的说明。

https://github.com/Pushwoosh/phonegap-3-sample-app https://github.com/Pushwoosh/phonegap-3-sample-app

The files you need are : copy the index.js , to add pushnotification.js into your index.html , to add the plug in pushwoosh to config.xml and the important thing is API ID from google and the ID from pushwoosh , those two ID you can put in the index.js for IOS and Android . 您需要的文件是:复制index.js,将pushnotification.js添加到index.html中,将pushwoosh插件添加到config.xml中,重要的是google的API ID和pushwoosh的ID,这两个您可以在IOS和Android中放入index.js的ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM