udpate comments

master
huangminlinux 6 years ago
parent 6edcc0eb3e
commit 4f66e022b0

@ -1,7 +1,7 @@
import 'dart:async';
import 'package:flutter/services.dart';
import 'dart:io' show Platform, stdout;
import 'dart:io' show Platform;
typedef Future<dynamic> EventHandler(Map<String, dynamic> event);
@ -19,16 +19,6 @@ class JPush {
static EventHandler _onOpenNotification;
static EventHandler _onReceiveMessage;
// <String, dynamic>{
// 'source': source.index,
// 'maxWidth': maxWidth,
// 'maxHeight': maxHeight,
// }
/**
*
*/
static void setup({
String appKey,
String channel,
@ -36,9 +26,9 @@ class JPush {
}) {
_channel.invokeMethod('setup', { 'appKey': appKey, 'channel': channel, 'production': production });
}
/**
* JPush ()
*/
///
/// JPush ()
///
static void addEventHandler({
EventHandler onReceiveNotification,
EventHandler onOpenNotification,
@ -63,13 +53,11 @@ class JPush {
}
}
/**
*
*/
///
///
///
static Future applyPushAuthority([NotificationSettingsIOS iosSettings = const NotificationSettingsIOS()]) {
// TODO:
// await _channel.invokeMethod('applyPushAuthority');
if (!Platform.isIOS) {
return;
}
@ -77,137 +65,137 @@ class JPush {
_channel.invokeMethod('applyPushAuthority', iosSettings.toMap());
}
/**
* Tag tags
*
* @param {Array} params = [String]
* @param {Function} success = ({"tags":[String]}) => { }
* @param {Function} fail = ({"errorCode":int}) => { }
*/
///
/// Tag tags
///
/// @param {Array} params = [String]
/// @param {Function} success = ({"tags":[String]}) => { }
/// @param {Function} fail = ({"errorCode":int}) => { }
///
static Future<Map<dynamic, dynamic>> setTags(List<String> tags) async {
final Map<dynamic, dynamic> result = await _channel.invokeMethod('setTags', tags);
return result;
}
/**
* tags
*
* @param {Function} success = ({"tags":[String]}) => { }
* @param {Function} fail = ({"errorCode":int}) => { }
*/
///
/// tags
///
/// @param {Function} success = ({"tags":[String]}) => { }
/// @param {Function} fail = ({"errorCode":int}) => { }
///
static Future<Map<dynamic, dynamic>> cleanTags() async {
final Map<dynamic, dynamic> result = await _channel.invokeMethod('cleanTags');
return result;
}
/**
* tags tags
*
* @param {Array} tags = [String]
* @param {Function} success = ({"tags":[String]}) => { }
* @param {Function} fail = ({"errorCode":int}) => { }
*/
///
/// tags tags
///
/// @param {Array} tags = [String]
/// @param {Function} success = ({"tags":[String]}) => { }
/// @param {Function} fail = ({"errorCode":int}) => { }
///
static Future<Map<dynamic, dynamic>> addTags(List<String> tags) async {
final Map<dynamic, dynamic> result = await _channel.invokeMethod('addTags', tags);
return result;
}
/**
* tags
*
* @param {Array} tags = [String]
* @param {Function} success = ({"tags":[String]}) => { }
* @param {Function} fail = ({"errorCode":int}) => { }
*/
///
/// tags
///
/// @param {Array} tags = [String]
/// @param {Function} success = ({"tags":[String]}) => { }
/// @param {Function} fail = ({"errorCode":int}) => { }
///
static Future<Map<dynamic, dynamic>> deleteTags(List<String> tags) async {
final Map<dynamic, dynamic> result = await _channel.invokeMethod('deleteTags', tags);
return result;
}
/**
* tags
*
* @param {Function} success = ({"tags":[String]}) => { }
* @param {Function} fail = ({"errorCode":int}) => { }
*/
///
/// tags
///
/// @param {Function} success = ({"tags":[String]}) => { }
/// @param {Function} fail = ({"errorCode":int}) => { }
///
static Future<Map<dynamic, dynamic>> getAllTags() async {
final Map<dynamic, dynamic> result = await _channel.invokeMethod('getAllTags');
return result;
}
/**
* alias.
*
* @param {String} alias
*
* @param {Function} success = ({"alias":String}) => { }
* @param {Function} fail = ({"errorCode":int}) => { }
*/
///
/// alias.
///
/// @param {String} alias
///
/// @param {Function} success = ({"alias":String}) => { }
/// @param {Function} fail = ({"errorCode":int}) => { }
///
static Future<Map<dynamic, dynamic>> setAlias(String alias) async {
final Map<dynamic, dynamic> result = await _channel.invokeMethod('setAlias', alias);
return result;
}
/**
* alias
*
* @param {Function} success = ({"alias":String}) => { }
* @param {Function} fail = ({"errorCode":int}) => { }
*/
///
/// alias
///
/// @param {Function} success = ({"alias":String}) => { }
/// @param {Function} fail = ({"errorCode":int}) => { }
///
static Future<Map<dynamic, dynamic>> deleteAlias() async {
final Map<dynamic, dynamic> result = await _channel.invokeMethod('deleteAlias');
return result;
}
/**
* iOS Only
* Badge
*
* @param {Int} badge
*/
///
/// iOS Only
/// Badge
///
/// @param {Int} badge
///
static Future setBadge(int badge) async {
await _channel.invokeMethod('setBadge', badge);
}
/**
* resumePush
*/
///
/// resumePush
///
static Future stopPush() async {
await _channel.invokeMethod('stopPush');
}
/**
*
*/
///
///
///
static Future resumePush() async {
await _channel.invokeMethod('resumePush');
}
/**
*
*/
///
///
///
static Future clearAllNotifications() async {
await _channel.invokeMethod('clearAllNotifications');
}
/**
* iOS Only
* notification notification
* notification remoteNotification localNotification
* icon notification @{}
* @param {Function} callback = (Object) => {}
*/
///
/// iOS Only
/// notification notification
/// notification remoteNotification localNotification
/// icon notification @{}
/// @param {Function} callback = (Object) => {}
///
static Future<Map<dynamic, dynamic>> getLaunchAppNotification() async {
final Map<dynamic, dynamic> result = await _channel.invokeMethod('getLaunchAppNotification');
return result;
}
/**
* RegistrationId, JPush RegistrationId
*
* * @param {Function} callback = (String) => {}
*/
///
/// RegistrationId, JPush RegistrationId
///
/// @param {Function} callback = (String) => {}
///
static Future<String> getRegistrationID() async {
final String rid = await _channel.invokeMethod('getRegistrationID');
return rid;

Loading…
Cancel
Save