-
Notifications
You must be signed in to change notification settings - Fork 0
Core Tws Get Support
Mr.P edited this page Aug 29, 2026
·
2 revisions
Read the device's TWS identity from the current SDK snapshot.
- You have a
DeviceConvertibleinstance. - The device conforms to
DeviceTWSAPI.
AIBuds.xcframework
import AIBuds#import <AIBuds/AIBuds-Swift.h>
#import <AIBuds/AIBuds.h>/// The protocol for device True Wireless Stereo (TWS) related API.
protocol DeviceTWSAPI: DeviceAPI {
/// Indicates whether the device is a True Wireless Stereo (TWS) device.
var isTws: Bool { get }
}/// The protocol for device True Wireless Stereo (TWS) related API.
@protocol AIBudsDeviceTWSAPI <AIBudsDeviceAPI>
/// Indicates whether the device is a True Wireless Stereo (TWS) device.
@property(nonatomic, readonly) BOOL isTws;
@end| Property | Type | Description |
|---|---|---|
isTws |
Bool / BOOL
|
Whether the device identifies itself as a TWS device. |
import AIBuds
guard let device = device as? DeviceTWSAPI else {
print("TWS information is unavailable")
return
}
print(device.isTws ? "TWS device" : "Not a TWS device")id<AIBudsDeviceTWSAPI> device = (id<AIBudsDeviceTWSAPI>)self.device;
if ([device conformsToProtocol:@protocol(AIBudsDeviceTWSAPI)]) {
NSLog(@"%@", device.isTws ? @"TWS device" : @"Not a TWS device");
}This property has no completion handler. Handle unsupported protocol conformance separately from a valid false value.
-
Do Not Collapse Unsupported and False: Missing protocol conformance is not the same as
isTws == false. -
Use Connection State Separately: Read
isTwsConnectedonly when connection state is relevant.
- This API is a synchronous property read, not a
getTWSSupportrequest. - It does not manage TWS pairing.
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