iOS开发(第三方使用)——百度地图鹰眼轨迹SDK接入

本文介绍了如何在iOS应用中接入百度地图鹰眼轨迹SDK,包括>=3.0版本和<3.0版本的接入步骤,涉及XCode配置、SDK导入、权限设置、问题解决等方面。
摘要由CSDN通过智能技术生成

iOS开发交流群:301058503(如果不是开发者,做广告的就不用进了,因为迟早都被踢)

>=3.0版本的接入(适配XCode8.3以上)

  1. 登录百度地图开放平台,找到iOS的鹰眼轨迹的SDK,下载,然后把BaiduTraceSDK.framework导入工程(选择工程->General ,把SDK拖到Embedded Baniaries)
    这里写图片描述

  2. 在buidsettings输入bite,选择Enable bite code,值为NO;

  3. 在plist添加NSLocationAlwaysUsageDescription

  4. 。。。
    这里写图片描述

  5. 使用
    —1—

#import "BaiduTraceSDK/BaiduTraceSDK.h"

添加代理BTKTraceDelegate, BTKFenceDelegate, BTKTrackDelegate, BTKEntityDelegate
- (void)viewDidLoad {
    [super viewDidLoad];
    // 使用SDK的任何功能前,都需要先调用initInfo:方法设置基础信息。
    BTKServiceOption *sop = [[BTKServiceOption alloc] initWithAK:AK mcode:mcode serviceID:serviceID keepAlive:false];
    [[BTKAction sharedInstance] initInfo:sop];
}

—2—开启服务

BTKStartServiceOption *op = [[BTKStartServiceOption alloc] initWithEntityName:entityName];
    [[BTKAction sharedInstance] startService:op delegate:self];

服务回调
-(void)onStartService:(BTKServiceErrorCode)error {
    NSLog(@"start service response: %lu", (unsigned long)error);//0成功
}

—3—收集轨迹

[[BTKAction sharedInstance] startGather:self];


回调
-(void)onStartGather:(BTKGatherErrorCode)error {
    NSLog(@"start gather response: %lu", (unsigned long)error);//0成功,正在收集轨迹
}

—4—结束

[[BTKAction sharedInstance] stopGather:self];

回调
-(void)onStopGather:(BTKGatherErrorCode)error {
    NSLog(@"stop gather response: %lu", (unsigned long)error)
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值