Mop class

Constructors

Mop()
factory

Properties

eventId int
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
platformVersion Future<String>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addWebExtentionApi(String name, ExtensionApiHandler handler) → void
register webview extension api 注册webview拓展api
callJS(String appId, String eventName, String nativeViewId, Map<String, dynamic> eventData) Future<void>
原生调用webview中的js方法 appId 小程序id eventName 方法名 nativeViewId webviewId eventData 参数
changeUserId(String userId) Future<Map<String, dynamic>>
clearApplets() Future
clear applets cache 清除缓存的小程序
closeAllApplets() Future
close all running applets 关闭当前打开的所有小程序
closeApplet(String appletId, bool animated) Future<void>
关闭小程序 小程序会在内存中存在
currentApplet() Future<Map<String, dynamic>>
get current using applet 获取当前正在使用的小程序信息 {appId,name,icon,description,version,thumbnail}
finishRunningApplet(String appletId, bool animated) Future<void>
结束小程序 小程序会从内存中清除
getSMSign(String plainText) Future<String>
获取国密加密
initialize(String sdkkey, String secret, {String? apiServer, String? apiPrefix, String? cryptType, bool encryptServerData = false, bool disablePermission = false, String? userId, bool debug = false, bool bindAppletWithMainProcess = false, int? pageCountLimit = 0, List<FinStoreConfig>? finStoreConfigs, UIConfig? uiConfig, String? customWebViewUserAgent, int? appletIntervalUpdateLimit, int? maxRunningApplet}) Future<Map>
initialize mop miniprogram engine. 初始化小程序 sdkkey is required. it can be getted from api.finclip.com secret is required. it can be getted from api.finclip.com apiServer is optional. the mop server address. default is https://mp.finogeek.com apiPrefix is optional. the mop server prefix. default is /api/v1/mop cryptType is optional. cryptType, should be MD5/SM disablePermission is optional. encryptServerData 是否对服务器数据进行加密,需要服务器支持 userId 用户id finStoreConfigs 多服务配置 uiConfig UI配置 debug 设置debug模式,影响调试和日志 customWebViewUserAgent 设置自定义webview ua appletIntervalUpdateLimit 设置小程序批量更新周期 maxRunningApplet 设置最大同时运行小程序个数
initSDK(Config config, {UIConfig? uiConfig}) Future<Map>
moveCurrentAppletToFront() → void
将当前正在运行的最后一个打开的小程序移至任务栈前台,仅Android生效
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openApplet(String appId, {String? path, String? query, int? sequence, String? apiServer, String? scene, String? shareDepth, bool isSingleProcess = false, bool isSingTask = false}) Future<Map>
open the miniprogram appId from the mop server. 打开小程序 appId is required. path is miniprogram open path. example /pages/index/index query is miniprogram query parameters. example key1=value1&key2=value2 sequence is miniprogram sequence. example 0,1.2.3,4,5... apiServer is optional. the mop server address. default is https://mp.finogeek.com scene shareDepth isSingleProcess
parseAppletInfoFromWXQrCode(String qrCode, String apiServer) Future<Map<String, dynamic>>
根据微信QrCode信息解析小程序信息
qrcodeOpenApplet(String qrcode, {bool isSingleProcess = false, bool isSingTask = false}) Future
通过二维码打开小程序 qrcode 二维码内容
registerAppletHandler(AppletHandler handler) → void
register handler to provide custom info or behaviour 注册小程序事件处理
registerExtensionApi(String name, ExtensionApiHandler handler) → void
register extension api 注册拓展api
removeAllUsedApplets() Future
清除所有小程序缓存
removeUsedApplet(String appId) Future
清除指定的小程序本体缓存
scanOpenApplet(String info, {bool isSingleProcess = false, bool isSingTask = false}) Future
(扫码后)解密-鉴权-打开小程序
sdkVersion() Future<String>
获取运行时版本号
sendCustomEvent(String appId, Map<String, dynamic> eventData) Future<void>
原生发送事件给小程序 appId 小程序id eventData 事件对象
setActivityTransitionAnim(Anim anim) Future
设置小程序切换动画,仅Android生效
startApplet(RemoteAppletRequest request) Future<Map>
toString() String
A string representation of this object.
inherited
webViewBounces(bool bounces) → void
WKWebView的弹性设置,仅iOS生效

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance Mop
no setter