BBASMPlugin+System.h
6.13 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//
// BBASMPlugin+System.h
// SWAN
//
// Created by baidu on 2018/6/4.
// Copyright © 2018年 baidu. All rights reserved.
//
#import "BBASMPlugin.h"
@interface BBASMPlugin (System)
/**
* 描 述: 实际非普通h5框架,属于小程序框架,由小程序调起,内部使用 该端能力目前主要是内部产品线(比如贴吧)使用,用于获取手机相关信息(比如cuid\imei等),同时要鉴权之后方可获取
* 示 例: baiduboxapp://swanAPI/getCommonSysInfo?params=\$params&callback=\$callback&upgrade=0
* 文 档: http://ft.baidu.com/#/scheme/swan_getcommonsysinfo
* 备 注:
* ********** description ************
* @name: baidu.getCommonSysInfo
* @authority: swanAPI
* @path: /getCommonSysInfo
* @args: [{"name": "cb", "value": "string"}]
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge", "extension" : "swan"}, "jsc": {"invoke": "swan.method.json", "method": "_naSwan.bridge.deviceBridge.getCommonSysInfo", "extension" : "swan"}}}
*/
- (void)getCommonSysInfo:(BBASchemeDispatcher *)dispatcher;
/**
* 描 述: iOS, Android获取系统信息, 用于前端组件. 目前返回有双端设备ID, 用于广告组件, 后续可能增加其他字段.
* 示 例: baiduboxapp://swanAPI/getCommonSysInfoSync?callback=_bdbox_js_932&upgrade=0
* 文 档: http://es.baidu-int.com/?#/apidetail/278
* 备 注: 公开端能力, 小程序开发者无法调用(此逻辑由前端处理). 目前只有广告组件使用, 返回idfa值, 后续可能增加其他返回值.
* ********** description ************
* @name: getCommonSysInfoSync
* @authority: swanAPI
* @path: /getCommonSysInfoSync
* @args: []
* @config: {"swan": {"web": {"invoke": "swan.prompt"}, "jsc": {"invoke": "swan.method.json", "method": "_naSwan.bridge.getCommonSysInfoSync"}}}
*/
- (void)getCommonSysInfoSync:(BBASchemeDispatcher *)command;
/**
* 描 述: 同步获取系统信息
* 示 例: baiduboxapp://swanAPI/getSystemInfoSync?callback=_bdbox_js_738&upgrade=0&oauthType=swan
* 文 档: http://ft.baidu.com/#/scheme/utils_getsysteminfosync
* 备 注:
* ********** description ************
* @name: getSystemInfoSync
* @authority: swanAPI
* @path: /getSystemInfoSync
* @args: []
* @config: {"swan": {"web": {"invoke": "swan.prompt"}, "webdegrade": {"invoke": "swan.prompt"}, "jsc": {"invoke": "swan.method.json", "method": "_naSwan.bridge.getSystemInfoSync"}}}
*/
- (void)getSystemInfoSync:(BBASchemeDispatcher *)command;
/**
* 描 述: 异步获取系统信息
* 示 例: baiduboxapp://swanAPI/getSystemInfo?callback=_bdbox_js_734&upgrade=0&oauthType=swan
* 文 档: http://ft.baidu.com/#/scheme/utils_getsysteminfo
* 备 注:
* ********** description ************
* @name: getSystemInfo
* @authority: swanAPI
* @path: /getSystemInfo
* @args: []
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge"}, "webdegrade": {"invoke": "swan.message.url", "handler": "bridge"}, "jsc": {"invoke": "swan.method.json", "method": "_naSwan.bridge.utils.getSystemInfo"}}}
*/
- (void)getSystemInfo:(BBASchemeDispatcher *)command;
/**
* 描 述: 小程序获取设备相关信息,用于获取手机相关信息(idfa),同时要鉴权之后方可获取
* 示 例: baiduboxapp://swanAPI/getDeviceInfo?params=\$params&callback=\$callback&upgrade=0
* 文 档: http://es.baidu-int.com/index#/apidetail/1168
* 备 注:
* ********** description ************
* @name: getDeviceInfo
* @authority: swanAPI
* @path: /getDeviceInfo
* @args: [{"name": "cb", "value": "string"}]
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge"}, "jsc": {"invoke": "swan.method.json", "method": "_naSwan.bridge.deviceBridge.getDeviceInfo"}}}
*/
- (void)getDeviceInfo:(BBASchemeDispatcher *)dispatcher;
/**
* 描 述: 小程序获取当前时刻设备状态信息,如cpu、内存
* 示 例: baiduboxapp://swanAPI/getDeviceProfile?params=\$params&callback=\$callback&upgrade=0
* 文 档: http://es.baidu-int.com/index#/apidetail/1519
* 备 注:
* ********** description ************
* @name: boxjs.getDeviceProfile
* @authority: swanAPI
* @path: /getDeviceProfile
* @args: [{"name": "cb", "value": "string"}]
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge"}, "jsc": {"invoke": "swan.method.json", "method": "_naSwan.bridge.deviceBridge.getDeviceProfile"}}}
*/
- (void)getDeviceProfile:(BBASchemeDispatcher *)dispatcher;
#pragma mark - not API
+ (NSDictionary *)getCommonSysInfoWithAppID:(NSString *)appID;
/**
* @brief 获取系统信息
*
* @param appID appID
* @return 返回字典
*/
+ (NSDictionary *)getSystemInfoWithAppID:(NSString *)appID;
/**
* @brief 用于获取手机相关信息(比如cuid\imei等),同时要鉴权之后可获取
* @param appID 小程序appID
* @param params 端能力参数
* @param isBinding 是否binding
* @param completion 端能力回调block
* @return 端能力调用结果
*/
+ (NSDictionary *)executeGetCommonSysInfoWithAppId:(NSString *)appID
params:(NSDictionary *)params
isBinding:(BOOL)isBinding
completion:(void (^)(NSDictionary *))completion;
/**
* @brief 用于获取设备相关信息(idfa),同时要鉴权之后可获取
* @param appID 小程序appID
* @param params 端能力参数
* @param completion 端能力回调block
* @return 端能力调用结果
*/
+ (NSDictionary *)getDeviceInfoWithAppID:(NSString *)appID
params:(NSDictionary *)params
completion:(void (^)(NSDictionary *))completion;
/**
* @brief 小程序获取当前时刻设备状态信息,如cpu、内存
* @param appID 小程序appID
* @param params 端能力参数
* @param completion 端能力回调block
* @return 端能力调用结果
*/
+ (NSDictionary *)getDeviceProfileWithAppID:(NSString *)appID
params:(NSDictionary *)params
completion:(void (^)(NSDictionary *))completion;
@end