phizclip-uniapp-demo/finclip-uniapp-test/nativeplugins/MopSdk/ios/FinApplet.framework/Headers/FATAppletDelegate.h

381 lines
15 KiB
C
Raw Normal View History

2022-06-08 11:57:35 +08:00
//
// FATAppletDelegate.h
// FinApplet
//
// Created by Haley on 2019/11/4.
// Copyright © 2019 finogeeks. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "FATAppletMenuProtocol.h"
#import "FATConstant.h"
#import "FATAppletInfo.h"
2022-10-19 12:51:03 +08:00
#import "FATAppletConfig.h"
#import "FATAppletRequest.h"
2022-06-08 11:57:35 +08:00
@protocol FATAppletDelegate <NSObject>
@optional
2022-10-19 12:51:03 +08:00
#pragma mark - lifeCycleDelegate methods
2022-06-08 11:57:35 +08:00
2022-10-19 12:51:03 +08:00
/**
@param appletId id
@param error
2022-06-08 11:57:35 +08:00
*/
2022-10-19 12:51:03 +08:00
- (void)applet:(NSString *)appletId didOpenCompletion:(NSError *)error FATDeprecated("该api(自2.36.11起)废弃请使用appletInfo:didOpenCompletion:");
2022-06-08 11:57:35 +08:00
2022-10-19 12:51:03 +08:00
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId didCloseCompletion:(NSError *)error FATDeprecated("该api(自2.36.11起)废弃请使用appletInfo:didCloseCompletion:");
2022-06-08 11:57:35 +08:00
2022-10-19 12:51:03 +08:00
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId initCompletion:(NSError *)error FATDeprecated("该api(自2.36.11起)废弃请使用appletInfo:initCompletion:");
2022-06-08 11:57:35 +08:00
2022-10-19 12:51:03 +08:00
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId didActive:(NSError *)error FATDeprecated("该api(自2.36.11起)废弃请使用appletInfo:didActive:");
2022-06-08 11:57:35 +08:00
2022-10-19 12:51:03 +08:00
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId resignActive:(NSError *)error FATDeprecated("该api(自2.36.11起)废弃请使用appletInfo:resignActive:");
2022-06-08 11:57:35 +08:00
2022-10-19 12:51:03 +08:00
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId didFail:(NSError *)error FATDeprecated("该api(自2.36.11起)废弃请使用appletInfo:didFail:");
2022-06-08 11:57:35 +08:00
2022-10-19 12:51:03 +08:00
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId dealloc:(NSError *)error FATDeprecated("该api(自2.36.11起)废弃请使用appletInfo:dealloc:");
2022-06-08 11:57:35 +08:00
/**
2022-10-19 12:51:03 +08:00
@param appletInfo info
2022-06-08 11:57:35 +08:00
@param error
*/
2022-10-19 12:51:03 +08:00
- (void)appletInfo:(FATAppletInfo *)appletInfo didOpenCompletion:(NSError *)error;
2022-06-08 11:57:35 +08:00
/**
2022-10-19 12:51:03 +08:00
@param appletInfo info
2022-06-08 11:57:35 +08:00
@param error
*/
2022-10-19 12:51:03 +08:00
- (void)appletInfo:(FATAppletInfo *)appletInfo didCloseCompletion:(NSError *)error;
2022-06-08 11:57:35 +08:00
/**
2022-10-19 12:51:03 +08:00
@param appletInfo info
2022-06-08 11:57:35 +08:00
@param error
*/
2022-10-19 12:51:03 +08:00
- (void)appletInfo:(FATAppletInfo *)appletInfo initCompletion:(NSError *)error;
2022-06-08 11:57:35 +08:00
/**
2022-10-19 12:51:03 +08:00
@param appletInfo info
2022-06-08 11:57:35 +08:00
@param error
*/
2022-10-19 12:51:03 +08:00
- (void)appletInfo:(FATAppletInfo *)appletInfo didActive:(NSError *)error;
2022-06-08 11:57:35 +08:00
/**
2022-10-19 12:51:03 +08:00
@param appletInfo info
2022-06-08 11:57:35 +08:00
@param error
*/
2022-10-19 12:51:03 +08:00
- (void)appletInfo:(FATAppletInfo *)appletInfo resignActive:(NSError *)error;
2022-06-08 11:57:35 +08:00
/**
2022-10-19 12:51:03 +08:00
@param appletInfo info
2022-06-08 11:57:35 +08:00
@param error
*/
2022-10-19 12:51:03 +08:00
- (void)appletInfo:(FATAppletInfo *)appletInfo didFail:(NSError *)error;
2022-06-08 11:57:35 +08:00
/**
2022-10-19 12:51:03 +08:00
@param appletInfo info
2022-06-08 11:57:35 +08:00
@param error
*/
2022-10-19 12:51:03 +08:00
- (void)appletInfo:(FATAppletInfo *)appletInfo dealloc:(NSError *)error;
#pragma mark - button open-type
/** 转发事件
open-typeshareButtonshareAppMessage
@param contentInfo id54
{
appAvatar = "小程序图标地址";
logoImage=UIImage
appDescription = "小程序的描述信息";
appId = "小程序id";
appInfo = {}; // 客户可在appInfo中自定义字段appInfo内容会透传
appStartParams = {
path = "点击转发时的小程序页面路径";
};
appThumbnail = "小程序封面图的路径可能是网络路径或者本地路径宽高比是5:4";
appTitle = "小程序名称";
userId = "小程序开发者id";
}
@param completion block
https://www.finclip.com/mop/document/develop/component/form.html#button
*/
- (void)forwardAppletWithInfo:(NSDictionary *)contentInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion;
/**
APIgetUserInfo open-typegetUserInfoButton
@param appletInfo
result宿App
{
nickName = "昵称"
avatarUrl =
gender = "性别"
province = "省份"
city = "城市"
country = "国家"
userId = "值为[FATClient sharedClient].config.currentUserId" // sdk默认添加
baseUrl = "值为appletInfo.apiServer" //// sdk默认添加
}
https://www.finclip.com/mop/document/develop/component/form.html#button
*/
- (NSDictionary *)getUserInfoWithAppletInfo:(FATAppletInfo *)appletInfo
FATDeprecated("该api(自2.38.0起)废弃请使用getUserInfoWithAppletInfo:bindGetUserInfo:");
/**
APIgetUserInfo open-typegetUserInfoButton
@param appletInfo
@param bindGetUserInfo
result宿App
{
nickName = "昵称"
avatarUrl =
gender = "性别"
province = "省份"
city = "城市"
country = "国家"
userId = "值为[FATClient sharedClient].config.currentUserId" // sdk默认添加
baseUrl = "值为appletInfo.apiServer" //// sdk默认添加
}
https://www.finclip.com/mop/document/develop/component/form.html#button
*/
- (void)getUserInfoWithAppletInfo:(FATAppletInfo *)appletInfo bindGetUserInfo:(void (^)(NSDictionary *result))bindGetUserInfo;
/**
Button open-typecontact
@param appletInfo
@param sessionFrom
@param sendMessageTitle
@param sendMessagePath
@param sendMessageImg
@param showMessageCard
https://www.finclip.com/mop/document/develop/component/form.html#button
*/
- (void)contactWithAppletInfo:(FATAppletInfo *)appletInfo sessionFrom:(NSString *)sessionFrom sendMessageTitle:(NSString *)sendMessageTitle sendMessagePath:(NSString *)sendMessagePath sendMessageImg:(NSString *)sendMessageImg showMessageCard:(BOOL)showMessageCard;
/**
Button open-typegetPhoneNumber
@param appletInfo
@param bindGetPhoneNumber
result宿App
{
detail = {
code = """ // 这里参考微信小程序的数据格式如果宿主app不支持动态令牌功能可以自定义格式
}
}
https://www.finclip.com/mop/document/develop/component/form.html#button
*/
- (void)getPhoneNumberWithAppletInfo:(FATAppletInfo *)appletInfo bindGetPhoneNumber:(void (^)(NSDictionary *result))bindGetPhoneNumber;
/**
Button open-typelaunchAppAPP
@param appletInfo
@param appParameter APP APP
@param bindError APP
result宿App
{
detail = {
errMsg = "错误描述"
}
}
@param bindLaunchApp APP
https://www.finclip.com/mop/document/develop/component/form.html#button
*/
- (void)launchAppWithAppletInfo:(FATAppletInfo *)appletInfo appParameter:(NSString *)appParameter bindError:(void (^)(NSDictionary *result))bindError bindLaunchApp:(void (^)(NSDictionary *result))bindLaunchApp;
/// Button open-type属性为feedback打开“意见反馈”页面。APP 未实现时,则打开菜单栏里面的反馈)
/// @param appletInfo 小程序信息
/// 参考链接https://www.finclip.com/mop/document/develop/component/form.html#button
- (void)feedbackWithAppletInfo:(FATAppletInfo *)appletInfo;
/**
Button open-typechooseAvatar
@param appletInfo
@param bindChooseAvatar
result宿App
{
detail = {
avatalUrl = "头像地址"
}
}
https://www.finclip.com/mop/document/develop/component/form.html#button
*/
- (void)chooseAvatarWithAppletInfo:(FATAppletInfo *)appletInfo bindChooseAvatar:(void (^)(NSDictionary *result))bindChooseAvatar;
2022-06-08 11:57:35 +08:00
#pragma mark - more menu
/**
...
@param appletInfo
@path pages/index/index
*/
2022-10-19 12:51:03 +08:00
- (void)applet:(FATAppletInfo *)appletInfo didClickMoreBtnAtPath:(NSString *)path FATDeprecated("该api(自2.37.1起)废弃请使用appletInfo:didClickMoreBtnAtPath:");
/**
...YES
@param appletInfo
@param path pages/index/index
*/
- (BOOL)appletInfo:(FATAppletInfo *)appletInfo didClickMoreBtnAtPath:(NSString *)path;
2022-06-08 11:57:35 +08:00
/**
api
@param appletInfo
@param path
*/
- (NSArray<id<FATAppletMenuProtocol>> *)customMenusInApplet:(FATAppletInfo *)appletInfo atPath:(NSString *)path;
/**
-clickCustomItemMenuWithInfo:completion:
@param contentInfo
@param appletInfo
@param completion 1.code2.result
*/
- (void)clickCustomItemMenuWithInfo:(NSDictionary *)contentInfo inApplet:(FATAppletInfo *)appletInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion;
2022-10-19 12:51:03 +08:00
#pragma mark - Local Applet
/**
线
@param appletInfo
@param request request使request
@param currentVC
@param completion
*/
- (void)applet:(FATAppletInfo *)appletInfo
navigateToMiniProgram:(FATLocalAppletRequest *)request
currentVC:(UIViewController *)currentVC
completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion;
/**
宿Appzip
appzip
create folder references /.zip
@param appletInfo
@param packDict
@param zipPathCallback zip zipPathCallback(nil)
*/
- (void)localApplet:(FATAppletInfo *)appletInfo packDict:(NSDictionary *)packDict zipPathCallback:(void (^)(NSString *zipPath))zipPathCallback;
/// 获取本地小程序账号信息
/// @brief 获取本地小程序账号信息,返回的信息结构:
/// @{
/// @"miniProgram": @{
/// @"appId": ##小程序appId##,
/// @"envVersion": ##小程序版本##,
/// @"version": ##线上小程序版本号##
/// },
/// @"plugin": @{
/// @"appId": ##插件appId##,
/// @"version": ##插件版本号##
/// }
/// }
/// @param appletInfo 小程序信息
/// @return 小程序账号信息
- (NSDictionary *)localAppletAccountInfo:(FATAppletInfo *)appletInfo;
#pragma mark-- 小程序配置
/// 设置小程序的Cookie
/// @param appletId 小程序id
- (NSDictionary *)getCookieWithAppletInfo:(NSString *)appletId;
/// 给小程序设置配置项,使用场景:需要给某个特定小程序设置特殊配置项
/// @param appletInfo 小程序信息
- (FATAppletConfig *)getConfigWithAppletInfo:(FATAppletInfo *)appletInfo;
/// 小程序灰度扩展参数
/// @param appletId 小程序id
- (NSDictionary *)grayExtensionWithAppletId:(NSString *)appletId;
#pragma mark - JS SDK
/// 验证 js-sdk config信息 (未实现该代理方法则默认为验证通过)
/// @param appletInfo 小程序信息
/// @param config 验证信息
/// @param completion 执行完后的回调验证通过则code返回FATExtensionCodeSuccess失败返回FATExtensionCodeFailure
- (void)applet:(FATAppletInfo *)appletInfo
onJSSDKConfig:(NSDictionary *)config
completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion;
#pragma mark - H5 hook events
/**
H5requestbody
requestInfo
bodyType: body
requestHref: request
requestIdidqueryFinClipHookBridge-RequestId
requestUrlrequest
value: requestbody
{
bodyType = String;
requestHref = "http://aaronly.gitee.io/aymj";
requestId = 16499170263357297;
requestUrl = "https://www.finclip.com/api/v1/mop/mop-fast-trial-manager/web/visits/statistics";
value = "{\"type\":\"download_click\"}";
};
*/
- (void)applet:(FATAppletInfo *)appletInfo hookRequestInfo:(NSDictionary *)requestInfo;
#pragma mark - screen capture
/// 录屏事件回调
/// @param appletInfo 录屏事件时,当前正在运行的小程序
/// @param isCapture 是否在录制屏幕
/// @param pagePath 录屏事件时,小程序当前的页面路径
- (void)applet:(FATAppletInfo *)appletInfo screenCaptureStatusChanged:(BOOL)isCapture atPagePath:(NSString *)pagePath;
/// 截屏事件回调
/// @param appletInfo 截屏时,当前正在运行的小程序
/// @param pagePath 截屏时,小程序当前的页面路径
- (void)appletDidTakeScreenshot:(FATAppletInfo *)appletInfo atPagePath:(NSString *)pagePath;
#pragma mark - watermask
/// 自定义添加水印
/// @param appletInfo 小程序信息
/// @param watermaskView 水印容器视图,可在这个视图添加文字或图片等水印内容
- (void)applet:(FATAppletInfo *)appletInfo customizeWatermarkView:(UIView *)watermaskView;
2022-06-08 11:57:35 +08:00
@end