BBASMPlugin+Motion.h
5.1 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
//
// BBASMPlugin+Motion.h
// SWAN
//
// Created by baidu on 2018/4/23.
// Copyright © 2018年 baidu. All rights reserved.
//
#import "BBASMPlugin.h"
@interface BBASMPlugin (Motion)
/**
* 描 述: 小程序框架开始监听加速度数据
* 示 例: baiduboxapp://swanAPI/startAccelerometer?params={"cb":"cb"}&callback=_bdbox_js_186&upgrade=0
* 文 档: http://ft.baidu.com/#/scheme/swan_startaccelerometer
* 备 注:
* ********** description ************
* @name: startAccelerometer
* @authority: swanAPI
* @path: /startAccelerometer
* @args: [{"name": "interval", "value": "string="}, {"name": "cb", "value": "string"}, {"name": "useEvent", "value": "boolean="}]
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge"}, "jsc": {"invoke": "swan.method.json", "method": "_naSwan.bridge.deviceBridge.startAccelerometer"}}}
*/
- (void)startAccelerometer:(BBASchemeDispatcher *)dispatcher;
/**
* 描 述: 停止监听加速度数据
* 示 例: baiduboxapp://swanAPI/stopAccelerometer?callback=_bdbox_js_186&upgrade=0
* 文 档: http://ft.baidu.com/#/scheme/swan_stopaccelerometer
* 备 注:
* ********** description ************
* @name: stopAccelerometer
* @authority: swanAPI
* @path: /stopAccelerometer
* @args: []
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge"}, "jsc": {"invoke": "swan.method.json", "method": "_naSwan.bridge.deviceBridge.stopAccelerometer"}}}
*/
- (void)stopAccelerometer:(BBASchemeDispatcher *)dispatcher;
/**
* 描 述: 开始监听设备方向数据
* 示 例: baiduboxapp://swanAPI/startDeviceMotion?params={"cb":"cb","interval":"normal"}&callback=_bdbox_js_186&upgrade=0
* 文 档: http://ft.baidu.com/#/scheme/swan_startdevicemotion
* 备 注:
* ********** description ************
* @name: startDeviceMotionListening
* @authority: swanAPI
* @path: /startDeviceMotion
* @args: [{"name": "interval", "value": "string="}, {"name": "cb", "value": "string"}, {"name": "useEvent", "value": "boolean="}]
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge"}, "jsc": {"invoke": "swan.method.url", "method": "_naSwan.bridge.postMessage"}}}
*/
- (void)startDeviceMotion:(BBASchemeDispatcher *)dispatcher;
/**
* 描 述: 停止监听设备方向数据
* 示 例: baiduboxapp://swanAPI/stopDeviceMotion?callback=_bdbox_js_186&upgrade=0
* 文 档: http://ft.baidu.com/#/scheme/swan_stopdevicemotion
* 备 注:
* ********** description ************
* @name: stopDeviceMotionListening
* @authority: swanAPI
* @path: /stopDeviceMotion
* @args: []
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge"}, "jsc": {"invoke": "swan.method.url", "method": "_naSwan.bridge.postMessage"}}}
*/
- (void)stopDeviceMotion:(BBASchemeDispatcher *)dispatcher;
/**
* 描 述: 开启监听键盘高度变化
* 示 例: baiduboxapp://swanAPI/startKeyboardHeightChange?callback=_bdbox_js_186&upgrade=0
* 文 档: http://es.baidu-int.com/index#/apidetail/1298
* 备 注:
* ********** description ************
* @name: startKeyboardHeightChange
* @authority: swanAPI
* @path: /startKeyboardHeightChange
* @args: []
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge"}, "jsc": {"invoke": "swan.method.json", "method": "_naSwan.bridge.deviceBridge.startKeyboardHeightChange"}}}
*/
- (void)startKeyboardHeightChange:(BBASchemeDispatcher *)dispatcher;
/**
* 描 述: 取消监听键盘高度变化
* 示 例: baiduboxapp://swanAPI/stopKeyboardHeightChange?callback=_bdbox_js_186&upgrade=0
* 文 档: http://es.baidu-int.com/index#/apidetail/1301
* 备 注:
* ********** description ************
* @name: stopKeyboardHeightChange
* @authority: swanAPI
* @path: /stopKeyboardHeightChange
* @args: []
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge"}, "jsc": {"invoke": "swan.method.json", "method": "_naSwan.bridge.deviceBridge.stopKeyboardHeightChange"}}}
*/
- (void)stopKeyboardHeightChange:(BBASchemeDispatcher *)dispatcher;
/**
* @brief 监听加速度数据
* @param params 端能力参数
* @param appId 调起的appId
* @param action 端能力名称
* @param completion 调能力调用block
* @return NSDictionary 端能力调用结果
*/
+ (NSDictionary *)startAccelerometerWithParams:(NSDictionary *)params
appId:(NSString *)appId
action:(NSString *)action
completion:(void (^)(NSDictionary *status))completion;
/**
* @brief 停止监听加速度数据
* @param action 端能力名称
* @param appId 调起的appId
* @return NSDictionary 端能力调用结果
*/
+ (NSDictionary *)stopAccelerometerWithAction:(NSString *)action appId:(NSString *)appId;
/// 开启监听键盘高度变化
/// @param appId appId
+ (NSDictionary *)startKeyboardHeightChangeWithAppId:(NSString *)appId;
/// 取消监听键盘高度变化
/// @param appId appId
+ (NSDictionary *)stopKeyboardHeightChangeWithAppId:(NSString *)appId;
@end