BBASMLifeCycleProtocol.h
1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// BBASMLifeCycleProtocol.h
// SWAN
//
// Created by baidu on 2018/10/10.
// Copyright © 2018 baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BBASMAdapterBaseImplement.h"
@protocol BBASMLifeCycleProtocol <NSObject>
#pragma mark - app life cycle (小程序&小游戏生命周期)
/// 小程序&小游戏初始化入口
+ (void)initLifeCycle;
/// 当前小程序&小游戏进入前台
/// @param appKey appKey 小程序&小游戏的appKey
+ (void)onLifeCycleForeground:(NSString *)appKey;
/// 当前小程序&小游戏进入后台
/// @param appKey appKey 小程序&小游戏的appKey
+ (void)onLifeCycleBackground:(NSString *)appKey;
/// 当前小程序&小游戏加载失败时,是否使用小程序默认错误页面, 宿主方回调决定是否使用小程序默认错误页面,如果不使用(宿主自己定制错误页),返回YES;如果使用,返回NO,或者不实现该方法
/// @param error error 失败信息
+ (BOOL)onLifeCycleFailed:(NSError *)error;
#pragma mark - page life cycle 小程序
/// 渲染视图完成加载
/// @param appID xcx appID
+ (void)onLifeCyclePageViewLoad:(NSString *)appID;
/// 渲染视图卸载
/// @param appID xcx appID
+ (void)onLifeCyclePageViewUnload:(NSString *)appID;
@end