mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-04-07 07:23:15 +08:00
Add getConnectionState API
This commit is contained in:
parent
95330b11ed
commit
8d9a7fa8b0
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义通知行为,声音、震动、呼吸灯等。
|
||||
*/
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user