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

155 lines
6.0 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"
@protocol FATAppletDelegate <NSObject>
@optional
/// 小程序灰度扩展参数
/// @param appletId 小程序id
- (NSDictionary *)grayExtensionWithAppletId:(NSString *)appletId;
#pragma mark - button open-type
/** 转发事件
open-typeshareButtonshareAppMessage
@param contentInfo id54
{
appAvatar = "小程序图标地址";
appDescription = "小程序的描述信息";
appId = "小程序id";
appInfo = {}; // 客户可在appInfo中自定义字段appInfo内容会透传
appStartParams = {
path = "点击转发时的小程序页面路径";
};
appThumbnail = "小程序封面图的路径可能是网络路径或者本地路径宽高比是5:4";
appTitle = "小程序名称";
userId = "小程序开发者id";
}
@param completion block
*/
- (void)forwardAppletWithInfo:(NSDictionary *)contentInfo completion:(void (^)(FATExtensionCode code, NSDictionary *result))completion;
/// 调用获取用户信息APIgetUserInfo 或者 点击open-type属性为getUserInfo的Button时触发
/// @param appletInfo 小程序信息
- (NSDictionary *)getUserInfoWithAppletInfo:(FATAppletInfo *)appletInfo;
/// Button open-type属性为contact打开客服会话。
/// @param appletInfo 小程序信息
/// @param sessionFrom 会话来源
/// @param sendMessageTitle 会话内消息卡片标题
/// @param sendMessagePath 会话内消息卡片点击跳转小程序路径
/// @param sendMessageImg 会话内消息卡片图片
/// @param showMessageCard 小程序信息
- (void)contactWithAppletInfo:(FATAppletInfo *)appletInfo sessionFrom:(NSString *)sessionFrom sendMessageTitle:(NSString *)sendMessageTitle sendMessagePath:(NSString *)sendMessagePath sendMessageImg:(NSString *)sendMessageImg showMessageCard:(BOOL)showMessageCard;
/// Button open-type属性为getPhoneNumber获取用户手机号。
/// @param appletInfo 小程序信息
/// @param bindGetPhoneNumber 获取用户手机号回调
- (void)getPhoneNumberWithAppletInfo:(FATAppletInfo *)appletInfo bindGetPhoneNumber:(void (^)(NSDictionary *result))bindGetPhoneNumber;
/// Button open-type属性为launchApp打开APP。
/// @param appletInfo 小程序信息
/// @param appParameter 打开 APP 时,向 APP 传递的参数
/// @param bindError 打开 APP 发生错误的回调
/// @param bindLaunchApp 打开 APP 成功的回调
- (void)launchAppWithAppletInfo:(FATAppletInfo *)appletInfo appParameter:(NSString *)appParameter bindError:(void (^)(NSDictionary *result))bindError bindLaunchApp:(void (^)(NSDictionary *result))bindLaunchApp;
/// Button open-type属性为feedback打开“意见反馈”页面。APP 未实现时,则打开菜单栏里面的反馈)
/// @param appletInfo 小程序信息
- (void)feedbackWithAppletInfo:(FATAppletInfo *)appletInfo;
/// Button open-type属性为chooseAvatar获取用户头像。
/// @param appletInfo 小程序信息
/// @param bindChooseAvatar 获取用户头像回调
- (void)chooseAvatarWithAppletInfo:(FATAppletInfo *)appletInfo bindChooseAvatar:(void (^)(NSDictionary *result))bindChooseAvatar;
#pragma mark - applet open and close
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId didOpenCompletion:(NSError *)error;
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId didCloseCompletion:(NSError *)error;
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId initCompletion:(NSError *)error;
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId didActive:(NSError *)error;
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId resignActive:(NSError *)error;
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId didFail:(NSError *)error;
/**
@param appletId id
@param error
*/
- (void)applet:(NSString *)appletId dealloc:(NSError *)error;
#pragma mark - more menu
/**
...
@param appletInfo
@path pages/index/index
*/
- (void)applet:(FATAppletInfo *)appletInfo didClickMoreBtnAtPath:(NSString *)path;
/**
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;
@end