Add support for push

This commit is contained in:
wangmengyan95
2016-02-08 12:02:07 -08:00
parent dea7bb5c18
commit 6afaeb808b
10 changed files with 530 additions and 64 deletions

View File

@@ -0,0 +1,29 @@
// Push Adapter
//
// Allows you to change the push notification mechanism.
//
// Adapter classes must implement the following functions:
// * initialize(pushConfig)
// * getPushSenders(parseConfig)
// * getValidPushTypes(parseConfig)
// * send(devices, installations)
//
// Default is ParsePushAdapter, which uses GCM for
// android push and APNS for ios push.
var ParsePushAdapter = require('./ParsePushAdapter');
var adapter = new ParsePushAdapter();
function setAdapter(pushAdapter) {
adapter = pushAdapter;
}
function getAdapter() {
return adapter;
}
module.exports = {
getAdapter: getAdapter,
setAdapter: setAdapter
};