2016-07-19 17:15:40 +08:00
|
|
|
|
var JPushPlugin = function () {}
|
2014-06-05 16:36:54 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
// private plugin function
|
2014-07-23 17:08:13 +08:00
|
|
|
|
|
2016-03-10 13:42:09 +08:00
|
|
|
|
JPushPlugin.prototype.receiveMessage = {}
|
|
|
|
|
JPushPlugin.prototype.openNotification = {}
|
|
|
|
|
JPushPlugin.prototype.receiveNotification = {}
|
2015-04-15 16:59:32 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.isPlatformIOS = function () {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
var isPlatformIOS = (device.platform == 'iPhone' ||
|
2016-12-05 14:43:08 +08:00
|
|
|
|
device.platform == 'iPad' ||
|
|
|
|
|
device.platform == 'iPod touch' ||
|
2017-01-17 22:59:13 +08:00
|
|
|
|
device.platform == 'iOS')
|
2016-07-19 17:15:40 +08:00
|
|
|
|
return isPlatformIOS
|
2014-06-10 14:54:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-17 22:59:13 +08:00
|
|
|
|
JPushPlugin.prototype.errorCallback = function (msg) {
|
2016-07-19 17:15:40 +08:00
|
|
|
|
console.log('Javascript Callback Error: ' + msg)
|
2014-06-05 16:36:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-17 22:59:13 +08:00
|
|
|
|
JPushPlugin.prototype.callNative = function (name, args, successCallback) {
|
|
|
|
|
cordova.exec(successCallback, this.errorCallback, 'JPushPlugin', name, args)
|
2014-06-05 16:36:54 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2017-01-17 22:59:13 +08:00
|
|
|
|
// Common methods
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.init = function () {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('initial', [], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
} else {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('init', [], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2014-06-10 14:14:02 +08:00
|
|
|
|
}
|
2014-06-05 16:36:54 +08:00
|
|
|
|
|
2017-01-17 22:59:13 +08:00
|
|
|
|
JPushPlugin.prototype.setDebugMode = function (mode) {
|
|
|
|
|
if (device.platform === 'Android') {
|
|
|
|
|
this.callNative('setDebugMode', [mode], null)
|
|
|
|
|
} else {
|
|
|
|
|
if (mode === true) {
|
|
|
|
|
this.setDebugModeFromIos()
|
|
|
|
|
} else {
|
|
|
|
|
this.setLogOFF()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JPushPlugin.prototype.getRegistrationID = function (successCallback) {
|
|
|
|
|
this.callNative('getRegistrationID', [], successCallback)
|
2014-06-05 16:36:54 +08:00
|
|
|
|
}
|
2014-06-04 13:20:24 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.stopPush = function () {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('stopPush', [], null)
|
2015-01-16 10:42:06 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.resumePush = function () {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('resumePush', [], null)
|
2015-03-25 16:11:04 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2017-01-17 22:59:13 +08:00
|
|
|
|
JPushPlugin.prototype.isPushStopped = function (successCallback) {
|
|
|
|
|
this.callNative('isPushStopped', [], successCallback)
|
2016-03-10 13:42:09 +08:00
|
|
|
|
}
|
2015-01-16 10:42:06 +08:00
|
|
|
|
|
2017-01-17 22:59:13 +08:00
|
|
|
|
JPushPlugin.prototype.clearLocalNotifications = function () {
|
|
|
|
|
if (device.platform === 'Android') {
|
|
|
|
|
this.callNative('clearLocalNotifications', [], null)
|
|
|
|
|
} else {
|
|
|
|
|
this.clearAllLocalNotifications()
|
|
|
|
|
}
|
2016-12-15 14:51:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.setTagsWithAlias = function (tags, alias) {
|
2016-12-05 14:43:08 +08:00
|
|
|
|
if (tags == null) {
|
|
|
|
|
this.setAlias(alias)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (alias == null) {
|
|
|
|
|
this.setTags(tags)
|
|
|
|
|
return
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-12-05 14:43:08 +08:00
|
|
|
|
var arrayTagWithAlias = [tags]
|
|
|
|
|
arrayTagWithAlias.unshift(alias)
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setTagsWithAlias', arrayTagWithAlias, null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JPushPlugin.prototype.setTags = function (tags) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setTags', tags, null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JPushPlugin.prototype.setAlias = function (alias) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setAlias', [alias], null)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 判断系统设置中是否对本应用启用通知。
|
|
|
|
|
// iOS: 返回值如果大于 0,代表通知开启;0: 通知关闭。
|
|
|
|
|
// UIRemoteNotificationTypeNone = 0,
|
|
|
|
|
// UIRemoteNotificationTypeBadge = 1 << 0,
|
|
|
|
|
// UIRemoteNotificationTypeSound = 1 << 1,
|
|
|
|
|
// UIRemoteNotificationTypeAlert = 1 << 2,
|
|
|
|
|
// UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3,
|
|
|
|
|
// Android: 返回值 1 代表通知启用、0: 通知关闭。
|
|
|
|
|
JPushPlugin.prototype.getUserNotificationSettings = function (successCallback) {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
|
|
|
|
this.callNative('getUserNotificationSettings', [], successCallback)
|
|
|
|
|
} else if (device.platform == 'Android') {
|
|
|
|
|
this.callNative('areNotificationEnabled', [], successCallback)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// iOS methods
|
|
|
|
|
|
|
|
|
|
JPushPlugin.prototype.startJPushSDK = function () {
|
|
|
|
|
this.callNative('startJPushSDK', [] , null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JPushPlugin.prototype.setBadge = function (value) {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setBadge', [value], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-03-09 13:18:09 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.resetBadge = function () {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('resetBadge', [], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-03-09 13:18:09 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.setDebugModeFromIos = function () {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setDebugModeFromIos', [], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-03-09 13:18:09 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.setLogOFF = function () {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setLogOFF', [], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-03-09 13:18:09 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.setCrashLogON = function () {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('crashLogON', [], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-03-09 13:18:09 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.addLocalNotificationForIOS = function (delayTime, content,
|
|
|
|
|
badge, notificationID, extras) {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setLocalNotification', [delayTime, content, badge, notificationID, extras], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2014-07-10 14:57:03 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2016-12-05 14:43:08 +08:00
|
|
|
|
JPushPlugin.prototype.deleteLocalNotificationWithIdentifierKeyInIOS = function (identifierKey) {
|
2016-07-19 17:15:40 +08:00
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('deleteLocalNotificationWithIdentifierKey', [identifierKey], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-04-15 16:17:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.clearAllLocalNotifications = function () {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('clearAllLocalNotifications', [], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-04-15 16:17:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.setLocation = function (latitude, longitude) {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setLocation', [latitude, longitude], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-04-15 16:17:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.startLogPageView = function (pageName) {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('startLogPageView', [pageName], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-04-15 16:17:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.stopLogPageView = function (pageName) {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('stopLogPageView', [pageName], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JPushPlugin.prototype.beginLogPageView = function (pageName, duration) {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('beginLogPageView', [pageName, duration], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JPushPlugin.prototype.setApplicationIconBadgeNumber = function (badge) {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setApplicationIconBadgeNumber', [badge], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JPushPlugin.prototype.getApplicationIconBadgeNumber = function (callback) {
|
|
|
|
|
if (this.isPlatformIOS()) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('getApplicationIconBadgeNumber', [], callback)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-07-12 11:16:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-13 09:49:56 +08:00
|
|
|
|
JPushPlugin.prototype.addDismissActions = function (actions, categoryId) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('addDismissActions', [actions, categoryId])
|
2016-10-13 09:49:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JPushPlugin.prototype.addNotificationActions = function (actions, categoryId) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('addNotificationActions', [actions, categoryId])
|
2016-10-13 09:49:56 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-04-15 16:17:33 +08:00
|
|
|
|
// Android methods
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.setBasicPushNotificationBuilder = function () {
|
|
|
|
|
if (device.platform == 'Android') {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setBasicPushNotificationBuilder', [], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-04-15 16:17:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.setCustomPushNotificationBuilder = function () {
|
|
|
|
|
if (device.platform == 'Android') {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setCustomPushNotificationBuilder', [], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-04-15 16:17:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-16 10:56:04 +08:00
|
|
|
|
JPushPlugin.prototype.receiveRegistrationIdInAndroidCallback = function (data) {
|
|
|
|
|
if (device.platform === 'Android') {
|
|
|
|
|
data = JSON.stringify(data)
|
|
|
|
|
var event = JSON.parse(data)
|
|
|
|
|
cordova.fireDocumentEvent('jpush.receiveRegistrationId', event);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.receiveMessageInAndroidCallback = function (data) {
|
2016-12-05 14:43:08 +08:00
|
|
|
|
data = JSON.stringify(data)
|
|
|
|
|
console.log('JPushPlugin:receiveMessageInAndroidCallback: ' + data)
|
|
|
|
|
this.receiveMessage = JSON.parse(data)
|
|
|
|
|
cordova.fireDocumentEvent('jpush.receiveMessage', this.receiveMessage)
|
2014-07-23 14:46:02 +08:00
|
|
|
|
}
|
2015-01-26 14:23:45 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.openNotificationInAndroidCallback = function (data) {
|
2016-12-05 14:43:08 +08:00
|
|
|
|
data = JSON.stringify(data)
|
|
|
|
|
console.log('JPushPlugin:openNotificationInAndroidCallback: ' + data)
|
|
|
|
|
this.openNotification = JSON.parse(data)
|
|
|
|
|
cordova.fireDocumentEvent('jpush.openNotification', this.openNotification)
|
2015-06-09 15:48:51 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.receiveNotificationInAndroidCallback = function (data) {
|
2016-12-05 14:43:08 +08:00
|
|
|
|
data = JSON.stringify(data)
|
|
|
|
|
console.log('JPushPlugin:receiveNotificationInAndroidCallback: ' + data)
|
|
|
|
|
this.receiveNotification = JSON.parse(data)
|
|
|
|
|
cordova.fireDocumentEvent('jpush.receiveNotification', this.receiveNotification)
|
2013-10-21 11:28:42 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.clearAllNotification = function () {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
if (device.platform === 'Android') {
|
|
|
|
|
this.callNative('clearAllNotification', [], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2014-06-12 14:39:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-17 22:59:13 +08:00
|
|
|
|
JPushPlugin.prototype.clearNotificationById = function (id) {
|
|
|
|
|
if (device.platform === 'Android') {
|
|
|
|
|
this.callNative('clearNotificationById', [id], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2015-08-06 17:11:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.setLatestNotificationNum = function (num) {
|
|
|
|
|
if (device.platform == 'Android') {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setLatestNotificationNum', [num], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2014-06-12 14:39:46 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.addLocalNotification = function (builderId, content, title,
|
|
|
|
|
notificationID, broadcastTime, extras) {
|
|
|
|
|
if (device.platform == 'Android') {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('addLocalNotification',
|
|
|
|
|
[builderId, content, title, notificationID, broadcastTime, extras], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2015-01-15 10:31:43 +08:00
|
|
|
|
}
|
2016-03-10 13:42:09 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.removeLocalNotification = function (notificationID) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
if (device.platform === 'Android') {
|
|
|
|
|
this.callNative('removeLocalNotification', [notificationID], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2015-01-15 10:31:43 +08:00
|
|
|
|
}
|
2015-01-26 14:23:45 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.reportNotificationOpened = function (msgID) {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
if (device.platform === 'Android') {
|
|
|
|
|
this.callNative('reportNotificationOpened', [msgID], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2015-01-26 14:23:45 +08:00
|
|
|
|
}
|
2014-06-12 14:39:46 +08:00
|
|
|
|
|
2016-03-04 15:20:45 +08:00
|
|
|
|
/**
|
|
|
|
|
*是否开启统计分析功能,用于“用户使用时长”,“活跃用户”,“用户打开次数”的统计,并上报到服务器上,
|
|
|
|
|
*在 Portal 上展示给开发者。
|
2016-04-15 16:17:33 +08:00
|
|
|
|
*/
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.setStatisticsOpen = function (mode) {
|
|
|
|
|
if (device.platform == 'Android') {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setStatisticsOpen', [mode], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-03-04 15:20:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-04-15 16:17:33 +08:00
|
|
|
|
/**
|
2016-12-05 14:43:08 +08:00
|
|
|
|
* 用于在 Android 6.0 及以上系统,申请一些权限
|
|
|
|
|
* 具体可看:http://docs.jpush.io/client/android_api/#android-60
|
|
|
|
|
*/
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.requestPermission = function () {
|
|
|
|
|
if (device.platform == 'Android') {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('requestPermission', [], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-04-15 16:17:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.setSilenceTime = function (startHour, startMinute, endHour, endMinute) {
|
|
|
|
|
if (device.platform == 'Android') {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setSilenceTime', [startHour, startMinute, endHour, endMinute], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-04-18 21:35:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
JPushPlugin.prototype.setPushTime = function (weekdays, startHour, endHour) {
|
|
|
|
|
if (device.platform == 'Android') {
|
2017-01-17 22:59:13 +08:00
|
|
|
|
this.callNative('setPushTime', [weekdays, startHour, endHour], null)
|
2016-07-19 17:15:40 +08:00
|
|
|
|
}
|
2016-04-15 16:17:33 +08:00
|
|
|
|
}
|
2014-06-10 14:14:02 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
if (!window.plugins) {
|
|
|
|
|
window.plugins = {}
|
2013-10-18 11:14:33 +08:00
|
|
|
|
}
|
2014-06-10 14:14:02 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
if (!window.plugins.jPushPlugin) {
|
|
|
|
|
window.plugins.jPushPlugin = new JPushPlugin()
|
2016-03-04 15:20:45 +08:00
|
|
|
|
}
|
2016-01-21 15:15:48 +08:00
|
|
|
|
|
2016-07-19 17:15:40 +08:00
|
|
|
|
module.exports = new JPushPlugin()
|