|
@@ -9,6 +9,8 @@ class FlutterAliyunPush {
|
|
|
|
|
|
|
|
static Function onRegistSuccess;
|
|
static Function onRegistSuccess;
|
|
|
static Function onRegistError;
|
|
static Function onRegistError;
|
|
|
|
|
+ static Function onReceiveNotification;
|
|
|
|
|
+ static Function onReceiveMessage;
|
|
|
|
|
|
|
|
static Future<String> get platformVersion async {
|
|
static Future<String> get platformVersion async {
|
|
|
final String version = await _channel.invokeMethod('getPlatformVersion');
|
|
final String version = await _channel.invokeMethod('getPlatformVersion');
|
|
@@ -41,6 +43,16 @@ class FlutterAliyunPush {
|
|
|
onRegistError(call.arguments);
|
|
onRegistError(call.arguments);
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case "onReceiverNotification":
|
|
|
|
|
+ if(onReceiveNotification != null) {
|
|
|
|
|
+ onReceiveNotification(call.arguments);
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "onReceiverMessage":
|
|
|
|
|
+ if(onReceiveMessage != null) {
|
|
|
|
|
+ onReceiveMessage(call.arguments);
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -55,6 +67,16 @@ class FlutterAliyunPush {
|
|
|
onRegistError = callback;
|
|
onRegistError = callback;
|
|
|
registCallHandler();
|
|
registCallHandler();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ static void reigistOnReceiveNotification(Function callback) {
|
|
|
|
|
+ onReceiveNotification = callback;
|
|
|
|
|
+ registCallHandler();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ static void reigistOnReceiveMessage(Function callback) {
|
|
|
|
|
+ onReceiveMessage = callback;
|
|
|
|
|
+ registCallHandler();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|