Mark push as enabled in serverInfo endpoint
This commit is contained in:
@@ -1,22 +1,17 @@
|
||||
import { Parse } from 'parse/node';
|
||||
import PromiseRouter from '../PromiseRouter';
|
||||
import rest from '../rest';
|
||||
import { Parse } from 'parse/node';
|
||||
import PromiseRouter from '../PromiseRouter';
|
||||
import rest from '../rest';
|
||||
import AdaptableController from './AdaptableController';
|
||||
import { PushAdapter } from '../Adapters/Push/PushAdapter';
|
||||
import deepcopy from 'deepcopy';
|
||||
import features from '../features';
|
||||
import RestQuery from '../RestQuery';
|
||||
import pushStatusHandler from '../pushStatusHandler';
|
||||
import { PushAdapter } from '../Adapters/Push/PushAdapter';
|
||||
import deepcopy from 'deepcopy';
|
||||
import RestQuery from '../RestQuery';
|
||||
import pushStatusHandler from '../pushStatusHandler';
|
||||
|
||||
const FEATURE_NAME = 'push';
|
||||
const UNSUPPORTED_BADGE_KEY = "unsupported";
|
||||
|
||||
export class PushController extends AdaptableController {
|
||||
|
||||
setFeature() {
|
||||
features.setFeature(FEATURE_NAME, this.adapter.feature || {});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the deviceType parameter in qury condition is valid or not.
|
||||
* @param {Object} where A query condition
|
||||
@@ -39,9 +34,13 @@ export class PushController extends AdaptableController {
|
||||
}
|
||||
}
|
||||
|
||||
pushIsAvailable() {
|
||||
return !!this.adapter;
|
||||
}
|
||||
|
||||
sendPush(body = {}, where = {}, config, auth, wait) {
|
||||
var pushAdapter = this.adapter;
|
||||
if (!pushAdapter) {
|
||||
if (!this.pushIsAvailable()) {
|
||||
throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED,
|
||||
'Push adapter is not available');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user