-
Notifications
You must be signed in to change notification settings - Fork 0
Core Segment Navigation Navigation
Mr.P edited this page Aug 29, 2026
·
2 revisions
Create a NavigationInfoModel for the current route step and send it to the device.
- The device is connected and conforms to
TurnByTurnNavigationAPI. -
instructionandroadNameare each no more than 128 bytes. - Distances and time use the units documented by the model.
AIBuds.xcframework
/// Turn by turn navigation API
protocol TurnByTurnNavigationAPI: DeviceAPI {
/// Send navigation info
/// - Parameters:
/// - info: Navigation info
/// - completion: A closure that is called when the operation completes.
/// - success: `true` if the operation was successful; otherwise `false`.
/// - statusCode: The status code returned by the device. `nil` if the operation failed.
/// - error: An `NSError` object that describes the error that occurred, or `nil` if the operation was successful.
func sendNavigationInfo(
_ info: NavigationInfoModel,
completion: AIBudsStatusCodeCompletionHandler?
)
}/// Turn by turn navigation API
@protocol AIBudsTurnByTurnNavigationAPI <AIBudsDeviceAPI>
/// Send navigation info
/// - Parameters:
/// - info: Navigation info
/// - completion: Reports success, device status code, and an optional error.
- (void)sendNavigationInfo:(AIBudsNavigationInfoModel *_Nonnull)info
completion:(AIBudsStatusCodeCompletionHandler _Nullable)completion;
@endSee sendNavigationInfo in the API Reference.
| Property | Meaning |
|---|---|
nextStepDistanceText |
Display-ready text such as 300m or 1.5km. |
maneuver |
Raw value defined by Navigation Maneuvers. |
instruction |
Instruction text, maximum 128 bytes. |
roadName |
Road name text, maximum 128 bytes. |
alertInfo |
Optional NavigationAlertInfoModel; use the values and parameter rules in Navigation Alerts. |
mapProvider |
Raw value defined by NavigationMapProvider. |
transportMode |
Raw value defined by NavigationTransportMode. |
remainingTime |
Remaining time in seconds. |
remainingDistance |
Remaining distance in meters. |
guard let device = device as? TurnByTurnNavigationAPI else { return }
let info = NavigationInfoModel()
info.nextStepDistanceText = "300m"
info.maneuver = NSNumber(value: NavigationManeuver.right.rawValue)
info.instruction = "Turn right"
info.roadName = "Market Street"
info.remainingTime = 420
info.remainingDistance = 1800
device.sendNavigationInfo(info) { success, statusCode, error in
guard success else {
print(error?.localizedDescription ?? "Navigation update failed")
return
}
print("Navigation sent: \(statusCode?.stringValue ?? "Unavailable")")
}id<AIBudsTurnByTurnNavigationAPI> device = (id<AIBudsTurnByTurnNavigationAPI>)self.device;
if (![device conformsToProtocol:@protocol(AIBudsTurnByTurnNavigationAPI)])
return;
AIBudsNavigationInfoModel *info = [[AIBudsNavigationInfoModel alloc] init];
info.nextStepDistanceText = @"300m";
info.maneuver = @(AIBudsNavigationManeuverRight);
info.instruction = @"Turn right";
info.roadName = @"Market Street";
info.remainingTime = @420;
info.remainingDistance = @1800;
[device
sendNavigationInfo:info
completion:^(BOOL success, NSNumber *_Nullable statusCode, NSError *_Nullable error) {
if (!success)
NSLog(@"Navigation update failed: %@", error.localizedDescription);
}];Validate byte limits before sending. Use success as the primary result and preserve the device statusCode; the public SDK does not currently document individual status-code meanings.
AIBuds SDK documentation · Full documentation · API Reference
- Introduction
- Getting Started
- Core Concepts
-
Core Features
- Basic Features
- Device Info
- Find Device
- Physical Operations
- Work Mode
- Work Status
- Wear Detection
- Volume Control
- Music Control
- TWS
- Equalizer
- ANC
- Audio
- Camera
- Remote Camera
- File Import
- Teleprompter
- Segment Navigation
- Live Streaming
- Device Applications
- OTA
- Camera OTA
- Service Auth
- AI Services
- Voice Assistant
- Logging
- Advanced Topics
- Releases
- Troubleshooting