Add getConnectionState API

This commit is contained in:
Hevin 2017-06-22 12:30:47 +08:00
parent 95330b11ed
commit 8d9a7fa8b0
2 changed files with 11 additions and 0 deletions

View File

@ -458,6 +458,11 @@ public class JPushPlugin extends CordovaPlugin {
}
}
void getConnectionState(JSONArray data, CallbackContext callback) {
boolean isConnected = JPushInterface.getConnectionState(cordovaActivity.getApplicationContext());
callback.success(String.valueOf(isConnected));
}
/**
* 自定义通知行为声音震动呼吸灯等
*/

View File

@ -208,6 +208,12 @@ JPushPlugin.prototype.addNotificationActions = function (actions, categoryId) {
}
// Android methods
JPushPlugin.prototype.getConnectionState = function (successCallback) {
if (device.platform === 'Android') {
this.callNative('getConnectionState', [], successCallback)
}
}
JPushPlugin.prototype.setBasicPushNotificationBuilder = function () {
if (device.platform === 'Android') {
this.callNative('setBasicPushNotificationBuilder', [], null)