forked from github/jpush-phonegap-plugin
Change package name
This commit is contained in:
parent
6e8b5931fb
commit
b3b2af1520
16
plugin.xml
16
plugin.xml
@ -188,14 +188,18 @@
|
|||||||
|
|
||||||
<source-file src="src/android/libs/jpush-android_v3.0.6.jar" target-dir="libs" />
|
<source-file src="src/android/libs/jpush-android_v3.0.6.jar" target-dir="libs" />
|
||||||
|
|
||||||
<source-file src="src/android/MyReceiver.java" target-dir="src/cn/jiguang/push/phonegap" />
|
<source-file src="src/android/MyReceiver.java" target-dir="src/cn/jiguang/cordova/push" />
|
||||||
<source-file src="src/android/JPushPlugin.java" target-dir="src/cn/jiguang/push/phonegap" />
|
<source-file src="src/android/JPushPlugin.java" target-dir="src/cn/jiguang/cordova/push" />
|
||||||
|
|
||||||
<source-file src="src/android/res/drawable-hdpi/jpush_richpush_btn_selector.xml" target-dir="res/drawable" />
|
<source-file src="src/android/res/drawable-hdpi/jpush_richpush_btn_selector.xml"
|
||||||
<source-file src="src/android/res/drawable-hdpi/jpush_richpush_progressbar.xml" target-dir="res/drawable" />
|
target-dir="res/drawable" />
|
||||||
|
<source-file src="src/android/res/drawable-hdpi/jpush_richpush_progressbar.xml"
|
||||||
|
target-dir="res/drawable" />
|
||||||
|
|
||||||
<source-file src="src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_back.png" target-dir="res/drawable-hdpi" />
|
<source-file src="src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_back.png"
|
||||||
<source-file src="src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_divider.png" target-dir="res/drawable-hdpi" />
|
target-dir="res/drawable-hdpi" />
|
||||||
|
<source-file src="src/android/res/drawable-hdpi/jpush_ic_richpush_actionbar_divider.png"
|
||||||
|
target-dir="res/drawable-hdpi" />
|
||||||
|
|
||||||
<source-file src="src/android/res/layout/jpush_popwin_layout.xml" target-dir="res/layout" />
|
<source-file src="src/android/res/layout/jpush_popwin_layout.xml" target-dir="res/layout" />
|
||||||
<source-file src="src/android/res/layout/jpush_webview_layout.xml" target-dir="res/layout" />
|
<source-file src="src/android/res/layout/jpush_webview_layout.xml" target-dir="res/layout" />
|
||||||
|
@ -7,15 +7,14 @@ JPushPlugin.prototype.openNotification = {}
|
|||||||
JPushPlugin.prototype.receiveNotification = {}
|
JPushPlugin.prototype.receiveNotification = {}
|
||||||
|
|
||||||
JPushPlugin.prototype.isPlatformIOS = function () {
|
JPushPlugin.prototype.isPlatformIOS = function () {
|
||||||
var isPlatformIOS = (device.platform == 'iPhone' ||
|
return (device.platform === 'iPhone' ||
|
||||||
device.platform == 'iPad' ||
|
device.platform === 'iPad' ||
|
||||||
device.platform == 'iPod touch' ||
|
device.platform === 'iPod touch' ||
|
||||||
device.platform == 'iOS')
|
device.platform === 'iOS')
|
||||||
return isPlatformIOS
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushPlugin.prototype.errorCallback = function (msg) {
|
JPushPlugin.prototype.errorCallback = function (msg) {
|
||||||
console.log('Javascript Callback Error: ' + msg)
|
console.log('JPush Callback Error: ' + msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushPlugin.prototype.callNative = function (name, args, successCallback) {
|
JPushPlugin.prototype.callNative = function (name, args, successCallback) {
|
||||||
@ -96,11 +95,11 @@ JPushPlugin.prototype.setAlias = function (alias) {
|
|||||||
// UIRemoteNotificationTypeSound = 1 << 1,
|
// UIRemoteNotificationTypeSound = 1 << 1,
|
||||||
// UIRemoteNotificationTypeAlert = 1 << 2,
|
// UIRemoteNotificationTypeAlert = 1 << 2,
|
||||||
// UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3,
|
// UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3,
|
||||||
// Android: 返回值 1 代表通知启用、0: 通知关闭。
|
// Android: 返回值 1 代表通知启用;0: 通知关闭。
|
||||||
JPushPlugin.prototype.getUserNotificationSettings = function (successCallback) {
|
JPushPlugin.prototype.getUserNotificationSettings = function (successCallback) {
|
||||||
if (this.isPlatformIOS()) {
|
if (this.isPlatformIOS()) {
|
||||||
this.callNative('getUserNotificationSettings', [], successCallback)
|
this.callNative('getUserNotificationSettings', [], successCallback)
|
||||||
} else if (device.platform == 'Android') {
|
} else if (device.platform === 'Android') {
|
||||||
this.callNative('areNotificationEnabled', [], successCallback)
|
this.callNative('areNotificationEnabled', [], successCallback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -108,7 +107,7 @@ JPushPlugin.prototype.getUserNotificationSettings = function (successCallback) {
|
|||||||
// iOS methods
|
// iOS methods
|
||||||
|
|
||||||
JPushPlugin.prototype.startJPushSDK = function () {
|
JPushPlugin.prototype.startJPushSDK = function () {
|
||||||
this.callNative('startJPushSDK', [] , null)
|
this.callNative('startJPushSDK', [], null)
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushPlugin.prototype.setBadge = function (value) {
|
JPushPlugin.prototype.setBadge = function (value) {
|
||||||
@ -221,9 +220,9 @@ JPushPlugin.prototype.receiveRegistrationIdInAndroidCallback = function (data) {
|
|||||||
if (device.platform === 'Android') {
|
if (device.platform === 'Android') {
|
||||||
data = JSON.stringify(data)
|
data = JSON.stringify(data)
|
||||||
var event = JSON.parse(data)
|
var event = JSON.parse(data)
|
||||||
cordova.fireDocumentEvent('jpush.receiveRegistrationId', event);
|
cordova.fireDocumentEvent('jpush.receiveRegistrationId', event)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
JPushPlugin.prototype.receiveMessageInAndroidCallback = function (data) {
|
JPushPlugin.prototype.receiveMessageInAndroidCallback = function (data) {
|
||||||
data = JSON.stringify(data)
|
data = JSON.stringify(data)
|
||||||
@ -289,7 +288,7 @@ JPushPlugin.prototype.reportNotificationOpened = function (msgID) {
|
|||||||
*在 Portal 上展示给开发者。
|
*在 Portal 上展示给开发者。
|
||||||
*/
|
*/
|
||||||
JPushPlugin.prototype.setStatisticsOpen = function (mode) {
|
JPushPlugin.prototype.setStatisticsOpen = function (mode) {
|
||||||
if (device.platform == 'Android') {
|
if (device.platform === 'Android') {
|
||||||
this.callNative('setStatisticsOpen', [mode], null)
|
this.callNative('setStatisticsOpen', [mode], null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,19 +298,19 @@ JPushPlugin.prototype.setStatisticsOpen = function (mode) {
|
|||||||
* 具体可看:http://docs.jpush.io/client/android_api/#android-60
|
* 具体可看:http://docs.jpush.io/client/android_api/#android-60
|
||||||
*/
|
*/
|
||||||
JPushPlugin.prototype.requestPermission = function () {
|
JPushPlugin.prototype.requestPermission = function () {
|
||||||
if (device.platform == 'Android') {
|
if (device.platform === 'Android') {
|
||||||
this.callNative('requestPermission', [], null)
|
this.callNative('requestPermission', [], null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushPlugin.prototype.setSilenceTime = function (startHour, startMinute, endHour, endMinute) {
|
JPushPlugin.prototype.setSilenceTime = function (startHour, startMinute, endHour, endMinute) {
|
||||||
if (device.platform == 'Android') {
|
if (device.platform === 'Android') {
|
||||||
this.callNative('setSilenceTime', [startHour, startMinute, endHour, endMinute], null)
|
this.callNative('setSilenceTime', [startHour, startMinute, endHour, endMinute], null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JPushPlugin.prototype.setPushTime = function (weekdays, startHour, endHour) {
|
JPushPlugin.prototype.setPushTime = function (weekdays, startHour, endHour) {
|
||||||
if (device.platform == 'Android') {
|
if (device.platform === 'Android') {
|
||||||
this.callNative('setPushTime', [weekdays, startHour, endHour], null)
|
this.callNative('setPushTime', [weekdays, startHour, endHour], null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user