Mini program | MiniOpenApiProxy | Description |
wx.login | login | Login API |
wx.getUserInfo | getUserInfo | Obtain basic user information |
wx.getUserProfile | getUserProfile | Obtain user attribute information |
wx.getPhoneNumber | getPhoneNumber | Obtain phone number |
wx.requestPayment | requestPayment | Initiate a payment |
wx.checkSession | checkSession | Check if the login has expired |
abstract class OpenApiHandler {// The API is called when the mini program calls wx.requestPayment to request a third-party paymentFuture<Map<String, dynamic>> requestPayment(AppInfo appInfo, Map<Object?, Object?> params);/// The API is called when the mini program calls wx.getUserProfile to request the user information of the host app///Future<Map<String, dynamic>> getUserProfile(AppInfo appInfo, Map<Object?, Object?> params);/// The API is called when the mini program calls wx.login to request the login certificate of the host app///Future<Map<String, dynamic>> login(AppInfo appInfo, Map<Object?, Object?> params);/// The API is called when the mini program calls wx.checkSession to request the login status of the host app/// Check if the login has expired///Future<Map<String, dynamic>> checkSession(AppInfo appInfo, Map<Object?, Object?> params);/// The API is called when the mini program calls wx.getUserProfile/// Compatible with earlier mini program APIs///Future<Map<String, dynamic>> getUserInfo(AppInfo appInfo, Map<Object?, Object?> params);/// The API is called when the mini program calls wx.getPhoneNumber to request the current user's phone number///Future<Map<String, dynamic>> getPhoneNumber(AppInfo appInfo, Map<Object?, Object?> params);}
@overrideFuture<Map<String, dynamic>> getUserProfile(AppInfo appInfo, Map<Object?, Object?> params) async {print("getUserProfile:$appInfo params:$params");Map<String, dynamic> result = {"userInfo": {"nickName": "xcode","avatarUrl":"https://staticintl.cloudcachetci.com/cms/backend-cms/8WGP653_%E5%BC%80%E5%8F%91%E8%80%85%E5%B7%A5%E5%85%B7%E9%80%9A%E7%94%A8.png","gender": 1,"country": "China","province": "ChongQing","city": "ChongQing",}};return Future.value(result);}
Was this page helpful?