Skip to content

Core Tws Get Support

Mr.P edited this page Aug 25, 2026 · 2 revisions

Identify a TWS Device

Read the device's TWS identity from the current SDK snapshot.

Prerequisites

  • You have a DeviceConvertible instance.
  • The device conforms to DeviceTWSAPI.

API Reference

Framework

AIBuds.xcframework

Import

Swift

import AIBuds

Objective-C

#import <AIBuds/AIBuds.h>
#import <AIBuds/AIBuds-Swift.h>

Protocol

Swift

/// 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 }
}

Objective-C

/// 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

Properties

Property Type Description
isTws Bool / BOOL Whether the device identifies itself as a TWS device.

Usage Examples

Swift

import AIBuds

guard let device = device as? DeviceTWSAPI else {
    print("TWS information is unavailable")
    return
}

print(device.isTws ? "TWS device" : "Not a TWS device")

Objective-C

id<AIBudsDeviceTWSAPI> device = (id<AIBudsDeviceTWSAPI>)self.device;
if ([device conformsToProtocol:@protocol(AIBudsDeviceTWSAPI)]) {
    NSLog(@"%@", device.isTws ? @"TWS device" : @"Not a TWS device");
}

Error Handling

This property has no completion handler. Handle unsupported protocol conformance separately from a valid false value.

Best Practices

  1. Do Not Collapse Unsupported and False: Missing protocol conformance is not the same as isTws == false.
  2. Use Connection State Separately: Read isTwsConnected only when connection state is relevant.

Notes

  • This API is a synchronous property read, not a getTWSSupport request.
  • It does not manage TWS pairing.

AIBuds SDK iOS Wiki

Clone this wiki locally