BBASMPlugin+location.h
2.82 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
//
// BBASMPlugin+location.h
// SWAN
//
// Created by baidu on 06/12/2017.
// Copyright © 2017 baidu. All rights reserved.
//
#import "BBASMPlugin.h"
#define BBASMLocationModule @"mnp_location"
UIKIT_EXTERN NSString *const BBASMEventLocationChange; // 定位回调数据事件名
@interface BBASMPlugin (location)
/**
* 描 述: 获取地理位置
* 示 例: baiduboxapp://swanAPI/getLocation?params={"type":"wgs84","altitude":true,"cb":"_bdbox_pjs_577"}&callback=_bdbox_js_620&upgrade=0&oauthType=swan
* 文 档: http://ft.baidu.com/#/scheme/swan_getlocation
* 备 注:
* ********** description ************
* @name: getLocation
* @authority: swanAPI
* @path: /getLocation
* @args: [{"name": "type", "value": "string="}, {"name": "altitude", "value": "boolean="}, {"name": "cb", "value": "string"}, {"name": "needFullAccuracy", "value": "boolean="}]
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge"}, "webdegrade": {"invoke": "swan.message.url", "handler": "bridge"}, "jsc": {"invoke": "swan.method.url", "method": "_naSwan.bridge.postMessage"}}}
*/
- (void)getLocation:(BBASchemeDispatcher *)dispatcher;
/**
* 描 述: 开启连续定位
* 示 例: baiduboxapp://swanAPI/startLocationUpdate?params={"cb":"_bdbox_pjs_577"}
* 文 档: http://es.baidu-int.com/#/apidetail/995
* 备 注:
* ********** description ************
* @name: startLocationUpdate
* @authority: swanAPI
* @path: /startLocationUpdate
* @args: [{"name": "cb", "value": "string"}, {"name": "needFullAccuracy", "value": "boolean="}]
* @config: {"swan": {"web": {"invoke": "swan.message.url", "handler": "bridge"}, "webdegrade": {"invoke": "swan.message.url", "handler": "bridge"}, "jsc": {"invoke": "swan.method.json", "method": "_naSwan.bridge.location.startLocationUpdate"}}}
*/
- (void)startLocationUpdate:(BBASchemeDispatcher *)dispatcher;
/**
* 描 述: 关闭连续定位
* 示 例: baiduboxapp://swanAPI/stopLocationUpdate?params={}
* 文 档: http://es.baidu-int.com/#/apidetail/993
* 备 注:
* ********** description ************
* @name: stopLocationUpdate
* @authority: swanAPI
* @path: /stopLocationUpdate
* @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.location.stopLocationUpdate"}}}
*/
- (void)stopLocationUpdate:(BBASchemeDispatcher *)dispatcher;
#pragma mark - JSBinding methods
+ (NSDictionary *)startLocationUpdateWithAppID:(NSString *)appID params:(NSDictionary *)params completion:(void (^)(NSDictionary *completionData))completion;
+ (NSDictionary *)stopLocationUpdateWithAppID:(NSString *)appID completion:(void (^)(NSDictionary *completionData))completion;
@end