All service products
Developer Channel
Service upgrade
Sign in
IOS Hawkeye Track SDK
Eagle Eye is a set of track management services, providing SDKs and APIs at all ends for developers to access conveniently and track moving objects such as vehicles/people you manage. Based on the interface and cloud services provided by Eagle Eye, developers can quickly build a complete, accurate and high-performance track management system completely belonging to you, which can be applied to team management, personnel management and other fields. Hawkeye iOS SDK is a part of Hawkeye series products, which is used to integrate Hawkeye services in iOS APP to achieve track tracking.

Important: In order to further take measures to strengthen the security protection of the end user's personal information, from the Eagle Eye SDK v3.1.5 version, the developer must ensure that the privacy compliance interface setAgreePrivacy is called before calling any interface of the SDK, or the related functions may not be used normally. For details, please refer to Development Guide - Development Considerations - Privacy Policy Interface Description.

Product Introduction
 trackbanner2.png

Hawkeye can realize track management for terminals with positioning capability, and support multi terminal access. It can query real-time/historical terminal location and track, and realize track information visualization. At the same time, Hawkeye electronic fence has the ability to actively push information, and can realize alarm push for terminals entering and exiting the fence. It is widely used in logistics, travel, finance, information technology, intelligent hardware and other industries. Eagle Eye adopts PB level data storage, and based on Baidu's mature distributed storage system, it carries out multi region, three backup storage, multi form data security protection, and has extremely high data security capabilities.

be careful: Hawkeye iOS SDK V3.1.0 and above has been adapted to iOS 13. When you use this service, you promise and guarantee to disclose the use of relevant data to users who use your products (web pages or applications), and ensure that you use the relevant services of Baidu Maps Open Platform to obtain user location data and other necessary data to provide relevant services when users are informed and authorized to do so. See details of specific privacy policy Baidu Map Open Platform Product and Service Privacy Policy

Experience Now

Introduction to key functions
Track tracking
brief introduction
Hawkeye provides each application with more than 10 million terminal track management capabilities, and supports global track tracking. Eagle Eye provides a variety of APIs and SDKs for developers to track tracks from various terminals, such as mobile phones, satellite locators, smart rear-view mirrors and other hardware devices. In addition, Eagle Eye also supports developers to upload tracks from the server.
Hawkeye stores track data of the last year for developers for free. Hawkeye adopts multi machine room and multi instance distributed storage, and automatically backs up regularly to ensure data storage security.
Function display
# import < BaiduTraceSDK / BaiduTraceSDK . h >
//Start to configure the basic information of the trace service between services
BTKServiceOption * basicInfoOption = [ [ BTKServiceOption alloc ] initWithAK : @ "Your AK" mcode : @ "Your bundle id" serviceID : @ "Your serviceID" keepAlive : YES ] ;
[ [ BTKAction sharedInstance ] initInfo : basicInfoOption ] ;
//Open service
BTKStartServiceOption * startServiceOption = [ [ BTKStartServiceOption alloc ] initWithEntityName : @ "entityName" ] ;
[ [ BTKAction sharedInstance ] startService : startServiceOption delegate : self ] ;
//Stop service
[ [ BTKAction sharedInstance ] stopService : self ] ;
//Start acquisition
[ [ BTKAction sharedInstance ] startGather : self ] ;
//End acquisition
[ [ BTKAction sharedInstance ] stopGather : self ] ;
/**
Enable the callback method of the trace service
@Param error The result of opening the trace service
*/
- ( void ) onStartService : ( BTKServiceErrorCode ) error {
}
/**
Callback method for stopping trace service
@Param error The result of stopping the trace service
*/
- ( void ) onStopService : ( BTKServiceErrorCode ) error {
}
/**
Callback method for starting collection
@Param error Start collecting operation results
*/
- ( void ) onStartGather : ( BTKGatherErrorCode ) error {
}
/**
Callback method for stopping collection
@Param error Operation result of stopping collection
*/
- ( void ) onStopGather : ( BTKGatherErrorCode ) error {
}
Space Search
brief introduction
Eagle Eye provides rich spatial search capability, supports searching the real-time location of terminals within the circle, polygon and administrative region, and counts the number of terminals. With this service, developers can realize functions such as searching terminals in the current map view, terminals in Beijing, etc.
Function display
//Set the filter conditions for retrieval
BTKQueryEntityFilterOption * filterOption = [ [ BTKQueryEntityFilterOption alloc ] init ] ;
filterOption . entityNames = @ [ @ "Test" ] ;
filterOption . activeTime = [ [ NSDate date ] timeIntervalSince1970 ] - seven * twenty-four * three thousand and six hundred ;
//Set the sorting method of retrieval results
BTKSearchEntitySortByOption * sortbyOption = [ [ BTKSearchEntitySortByOption alloc ] init ] ;
sortbyOption . fieldName = @ "loc_time" ;
sortbyOption . sortType = BTK_ENTITY_SORT_TYPE_DESC ;
//Construct the retrieval request object
BTKAroundSearchEntityRequest * request = [ [ BTKAroundSearchEntityRequest alloc ] initWithCenter : center inputCoordType : BTK_COORDTYPE_BD09LL radius : one thousand filter : filterOption sortby : sortbyOption outputCoordType : BTK_COORDTYPE_BD09LL pageIndex : one pageSize : ten ServiceID : @ "Your serviceID" tag : @ "Identification of this request" ] ;
//Initiate retrieval request
[ [ BTKEntityAction sharedInstance ] aroundSearchEntityWith : request delegate : self ] ;
#pragma mark - Entity terminal retrieval
/**
Callback Method for Retrieving Entity Terminal Entity in Circular Area
@Param response search results
*/
- ( void ) onEntityAroundSearch : ( NSData * ) response {
dispatch_async ( dispatch_get_main_queue ( ) , ^ {
NSDictionary * content = [ NSJSONSerialization JSONObjectWithData : response options : NSJSONReadingMutableContainers error : nil ] ; //Convert Data Format
NSLog ( @ Search result:% @ , content ) ;
} ) ;
}
Track query, deviation correction and display
brief introduction
Track query: using Hawkeye high-performance track query service, developers can query the track at any time in real time. Real time query means that once a track point is successfully uploaded to the Eagle Eye Cloud, it can be queried through the interface within less than 100 milliseconds. Eagle Eye also provides track batch export function for developers to download historical track data. Track correction: In order to correct track drift, Hawkeye provides professional track correction binding. With this service, developers can correct track drift and display smooth and coherent tracks. Eagle Eye provides different track correction and road binding algorithms for driving, cycling and walking, which are suitable for track correction of various vehicles.
Function display
//Construct request object
NSUInteger endTime = [ [ NSDate date ] timeIntervalSince1970 ] ;
BTKQueryHistoryTrackRequest * request = [ [ BTKQueryHistoryTrackRequest alloc ] initWithEntityName : @ "entityA" startTime : endTime - eighty-four thousand and four hundred endTime : endTime isProcessed : TRUE processOption : nil supplementMode : BTK_TRACK_PROCESS_OPTION_SUPPLEMENT_MODE_WALKING outputCoordType : BTK_COORDTYPE_BD09LL sortType : BTK_TRACK_SORT_TYPE_DESC pageIndex : one pageSize : ten serviceID : one hundred and three thousand and forty-four tag : thirteen ] ;
//Initiate query request
[ [ BTKTrackAction sharedInstance ] queryHistoryTrackWith : request delegate : self ] ;
/**
Callback Method of Track Query
@Param response query result
*/
- ( void ) onQueryHistoryTrack : ( NSData * ) response {
//Parse data and plot tracks
}
Mileage calculation and compensation
brief introduction
The Hawkeye iOS SDK provides the mileage query function, which can query the mileage of a terminal entity in a period of time, support the calculation of the mileage after deviation correction, and use route planning to compensate the mileage of the interrupted track.
Function display
//Set deviation correction options
BTKQueryTrackProcessOption * option = [ [ BTKQueryTrackProcessOption alloc ] init ] ;
option . denoise = TRUE ;
option . mapMatch = TRUE ;
option . radiusThreshold = fifteen ;
option . transportMode = BTK_TRACK_PROCESS_OPTION_TRANSPORT_MODE_DRIVING ;
NSUInteger endTime = [ [ NSDate date ] timeIntervalSince1970 ] ;
//Construct request object
BTKQueryTrackDistanceRequest * request = [ [ BTKQueryTrackDistanceRequest alloc ] initWithEntityName : @ "entityA" startTime : endTime - eighty-four thousand and four hundred endTime : endTime isProcessed : TRUE processOption : nil supplementMode : BTK_TRACK_PROCESS_OPTION_SUPPLEMENT_MODE_WALkING serviceID : one hundred thousand tag : twelve ] ;
//Initiate query request
[ [ BTKTrackAction sharedInstance ] queryTrackDistanceWith : request delegate : self ] ;
Geographic fence (monitoring terminal status)
brief introduction
Hawkeye provides geographic fence monitoring services. Developers can use Hawkeye to create polygon, route, administrative region and other types of geographic fences. Hawkeye automatically monitors the behavior of the terminal entering and exiting the fence, and pushes an alarm to the Hawkeye SDK or the developer server. With this service, developers can realize functions such as monitoring whether vehicles drive out of Haidian District by using the administrative fence, and monitoring whether logistics vehicles arrive at the station on time by using the polygon fence
Function display
//Create Fence
//Center
CLLocationCoordinate2D center = CLLocationCoordinate2DMake ( forty point zero four seven eight , one hundred and sixteen point three one three four ) ;
//Construct a new fence object to be created
BTKServerCircleFence * fence = [ [ BTKServerCircleFence alloc ] initWithCenter : center radius : fifty coordType : BTK_COORDTYPE_BD09LL denoiseAccuracy : fifty fenceName : @ "server_circle_fence" monitoredObject : @ "entityA" ] ;
//Construct request object
BTKCreateServerFenceRequest * circleRequest = [ [ BTKCreateServerFenceRequest alloc ] initWithServerCircleFence : fence serviceID : one hundred thousand tag : twenty-one ] ;
//Initiate creation request
[ [ BTKFenceAction sharedInstance ] createServerFenceWith : circleRequest delegate : self ] ;
//Delete fence
//Construct request object
BTKDeleteServerFenceRequest * request = [ [ BTKDeleteServerFenceRequest alloc ] initWithMonitoredObject : @ "entityA" fenceIDs : nil serviceID : one hundred thousand tag : twenty-two ] ;
//Initiate deletion request
[ [ BTKFenceAction sharedInstance ] deleteServerFenceWith : request delegate : self ] ;
//Real time status query
//Build request object
BTKQueryServerFenceStatusRequest * request = [ [ BTKQueryServerFenceStatusRequest alloc ] initWithMonitoredObject : @ "entityA" fenceIDs : nil ServiceID : one hundred thousand tag : twenty-five ] ;
//Initiate query request
[ [ BTKFenceAction sharedInstance ] queryServerFenceStatusWith : request delegate : self ] ;
Trajectory analysis (dwell point)
brief introduction
Hawkeye provides developers with analysis of movement behaviors such as stopping points, overspeed (based on road speed limit), and rapid speed change. With this service, developers can analyze which stops are in a track and where dangerous driving behaviors such as speeding occur
Function display
//Dwell point analysis
NSUInteger endTime = [ [ NSDate date ] timeIntervalSince1970 ] ;
//Construct request object
BTKStayPointAnalysisRequest * request = [ [ BTKStayPointAnalysisRequest alloc ] initWithEntityName : @ "entityA" startTime : endTime - twelve * sixty * sixty endTime : endTime stayTime : one hundred stayRadius : twenty processOption : nil outputCoordType : BTK_COORDTYPE_BD09LL serviceID : one hundred thousand tag : two hundred and twenty-two ] ;
//Initiate request
[ [ BTKAnalysisAction sharedInstance ] analyzeStayPointWith : request delegate : self ] ;
/**
Callback method of dwell point analysis
@Param response dwell point analysis results
*/
- ( void ) onAnalyzeStayPoint : ( NSData * ) response {
}
//Driving behavior analysis
NSUInteger endTime = [ [ NSDate date ] timeIntervalSince1970 ] ;
//Construct request object
BTKDrivingBehaviourAnalysisRequest * request = [ [ BTKDrivingBehaviourAnalysisRequest alloc ] initWithEntityName : @ "zhubei" startTime : endTime - twelve * sixty * sixty endTime : endTime speedingThreshold : fifty processOption : nil outputCoordType : BTK_COORDTYPE_BD09LL serviceID : one hundred and three thousand and forty-four tag : two hundred and twenty-three ] ;
//Initiate request
[ [ BTKAnalysisAction sharedInstance ] analyzeDrivingBehaviourWith : request delegate : self ] ;
/**
Callback method of driving behavior analysis
@Param response driving behavior analysis results
*/
- ( void ) onAnalyzeDrivingBehaviour : ( NSData * ) response {
}
Eagle Eye Service Process
 overview1.png
Instructions
Baidu Hawkeye iOS SDK, you need to Request Key (AK) , please read first Baidu Map API Terms of Use Baidu Maps iOS Hawkeye SDK is provided for developers who have some experience in iOS programming and understand object-oriented concepts. In addition, readers should also have a certain understanding of the basic knowledge of maps. If you encounter any problems in use, you can go to Feedback platform Give us feedback, and then technical support personnel will deal with the problem one-on-one for you.
Related services

Web Tracks Console

Next

Get Key

Is this article helpful to you?