2022-06-08 11:57:35 +08:00
|
|
|
|
//
|
|
|
|
|
// FATAppletRequest.h
|
|
|
|
|
// FinApplet
|
|
|
|
|
//
|
|
|
|
|
// Created by Haley on 2020/11/15.
|
|
|
|
|
// Copyright © 2020 finogeeks. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
2022-10-19 12:51:03 +08:00
|
|
|
|
#import <UIKit/UIKit.h>
|
2022-06-08 11:57:35 +08:00
|
|
|
|
#import "FATConstant.h"
|
|
|
|
|
|
|
|
|
|
@interface FATAppletBaseRequest : NSObject
|
|
|
|
|
#pragma mark - server info
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
服务器地址,客户部署的后台地址,必填
|
|
|
|
|
* 例:https://mp.finogeeks.com
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, copy) NSString *apiServer;
|
|
|
|
|
|
|
|
|
|
#pragma mark - 小程序 info
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
小程序id,必填
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, copy) NSString *appletId;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
小程序名称,非必填
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, copy) NSString *appName;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
小程序图标的网络地址,非必填
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, copy) NSString *appletLogo;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
小程序的启动参数,非必填。
|
|
|
|
|
支持的key,请参考FATStartParamKey
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, copy) NSDictionary<FATStartParamKey, NSString *> *startParams;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
打开小程序时的转场动画方式
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, assign) FATTranstionStyle transitionStyle;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
是否动画,默认为YES
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, assign) BOOL animated;
|
|
|
|
|
|
2022-10-19 12:51:03 +08:00
|
|
|
|
///**
|
|
|
|
|
// 自定义的scheme数组(非必填)
|
|
|
|
|
// */
|
|
|
|
|
//@property (nonatomic, strong) NSArray<NSString *> *scheme;
|
|
|
|
|
|
2022-06-08 11:57:35 +08:00
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@interface FATAppletRequest : FATAppletBaseRequest
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
小程序的索引。
|
|
|
|
|
每提交一次小程序,都会生成一个索引,所以想打开指定版本小程序,就必须传该值
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, strong) NSNumber *sequence;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
离线小程序压缩包路径
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, copy) NSString *offlineMiniprogramZipPath;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
离线基础库压缩包路径
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, copy) NSString *offlineFrameworkZipPath;
|
|
|
|
|
|
|
|
|
|
/// 体验版小程序会带小程序信息
|
|
|
|
|
@property (nonatomic, copy) NSDictionary *trialInfo;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
/// 小程序解密请求(二维码打开小程序)
|
|
|
|
|
@interface FATAppletDecryptRequest : NSObject
|
|
|
|
|
|
|
|
|
|
@property (nonatomic, copy) NSString *appletId; //管理小程序打开体验版,info加密信息中没有带appletId字段
|
|
|
|
|
/**
|
|
|
|
|
加密信息
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, copy) NSString *info;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
打开小程序时的转场动画方式
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, assign) FATTranstionStyle transitionStyle;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
是否动画,默认为YES
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, assign) BOOL animated;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@interface FATAppletQrCodeRequest : NSObject
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
二维码内容
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, strong) NSString *qrCode;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
打开小程序时的转场动画方式
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, assign) FATTranstionStyle transitionStyle;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
是否动画,默认为YES
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, assign) BOOL animated;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
2022-10-19 12:51:03 +08:00
|
|
|
|
/**
|
|
|
|
|
运行本地小程序
|
|
|
|
|
*/
|
2022-06-08 11:57:35 +08:00
|
|
|
|
@interface FATLocalAppletRequest : FATAppletBaseRequest
|
|
|
|
|
|
2022-10-19 12:51:03 +08:00
|
|
|
|
/**
|
|
|
|
|
小程序的logo图片对象,非必填
|
|
|
|
|
如果为nil,则会加载appletLogo。
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, strong) UIImage *logoImage;
|
|
|
|
|
|
2022-06-08 11:57:35 +08:00
|
|
|
|
/**
|
|
|
|
|
小程序可访问的域名白名单列表,非必填
|
2022-10-19 12:51:03 +08:00
|
|
|
|
如果domainList 为空,即nil 或[],则不校验域名
|
2022-06-08 11:57:35 +08:00
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, copy) NSArray *domainList;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
小程序分包信息,必填。
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, copy) NSArray *packages;
|
|
|
|
|
|
|
|
|
|
/**
|
2022-10-19 12:51:03 +08:00
|
|
|
|
小程序压缩包密码,必填
|
2022-06-08 11:57:35 +08:00
|
|
|
|
*/
|
2022-10-19 12:51:03 +08:00
|
|
|
|
@property (nonatomic, copy) NSString *zipPassword;
|
2022-06-08 11:57:35 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2022-10-19 12:51:03 +08:00
|
|
|
|
基础库离线包地址,必填
|
2022-06-08 11:57:35 +08:00
|
|
|
|
*/
|
2022-10-19 12:51:03 +08:00
|
|
|
|
@property (nonatomic, copy) NSString *offlineFrameworkZipPath;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
是否使用基础库缓存,非必填
|
|
|
|
|
如果设置为YES,则会使用的基础库缓存。
|
|
|
|
|
否则,则每次打开小程序都会使用传入的基础库
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, assign) BOOL useFrameworkCache;
|
|
|
|
|
|
|
|
|
|
#pragma mark - 小程序分包加载
|
|
|
|
|
/**
|
|
|
|
|
可以是小程序版本号,也可以是小程序版本的唯一标识比如md5(适用于小程序分包加载,小程序分包加载必填)
|
|
|
|
|
小程序会根据version来缓存小程序,小程序需要加载分包时优先查找缓存中相同version的小程序,没找到则会触发代理方法,由宿主app提供
|
|
|
|
|
小程序分包路径通过[FATClient sharedClient].delegate的代理方法localApplet:packDict:zipPathCallback:设置
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, copy) NSString *version;
|
2022-06-08 11:57:35 +08:00
|
|
|
|
|
2022-10-19 12:51:03 +08:00
|
|
|
|
#pragma mark - 加载整个小程序
|
2022-06-08 11:57:35 +08:00
|
|
|
|
/**
|
2022-10-19 12:51:03 +08:00
|
|
|
|
是否使用本地小程序缓存,默认值为NO(适用于加载整个小程序,加载整个小程序非必填)
|
2022-06-08 11:57:35 +08:00
|
|
|
|
如果设置为YES,则会使用的小程序缓存。
|
|
|
|
|
否则,则每次打开小程序都会使用传入的小程序离线包
|
|
|
|
|
*/
|
|
|
|
|
@property (nonatomic, assign) BOOL useAppletCache;
|
|
|
|
|
|
|
|
|
|
/**
|
2022-10-19 12:51:03 +08:00
|
|
|
|
小程序的离线包地址(适用于加载整个小程序,加载整个小程序必填)
|
2022-06-08 11:57:35 +08:00
|
|
|
|
*/
|
2022-10-19 12:51:03 +08:00
|
|
|
|
@property (nonatomic, copy) NSString *offlineMiniprogramZipPath;
|
2022-06-08 11:57:35 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2022-10-19 12:51:03 +08:00
|
|
|
|
小程序的自定义API白名单列表(非必填)
|
2022-06-08 11:57:35 +08:00
|
|
|
|
*/
|
2022-10-19 12:51:03 +08:00
|
|
|
|
@property (nonatomic, strong) NSArray<NSString *> *extApiWhiteList;
|
2022-06-08 11:57:35 +08:00
|
|
|
|
|
|
|
|
|
@end
|