<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "IOBluetooth",
  "identifier" : "/documentation/IOBluetooth/IOBluetoothOBEXSession/withIncomingRFCOMMChannel(_:eventSelector:selectorTarget:refCon:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "IOBluetooth"
    ],
    "preciseIdentifier" : "c:objc(cs)IOBluetoothOBEXSession(cm)withIncomingRFCOMMChannel:eventSelector:selectorTarget:refCon:"
  },
  "title" : "withIncomingRFCOMMChannel(_:eventSelector:selectorTarget:refCon:)"
}
-->

# withIncomingRFCOMMChannel(_:eventSelector:selectorTarget:refCon:)

Creates a Bluetooth-based OBEX Session using an incoming RFCOMM channel.

```
class func withIncomingRFCOMMChannel(_ inChannel: IOBluetoothRFCOMMChannel!, eventSelector inEventSelector: Selector!, selectorTarget inEventSelectorTarget: Any!, refCon inUserRefCon: UnsafeMutableRawPointer!) -> Self!
```

## Parameters

`inChannel`

The channel to use to create a connection to a device.

`inEventSelector`

The selector that gets called when an event occurs on the OBEX Session.

`inEventSelectorTarget`

The object that is used to call the above selector.

`inUserRefCon`

The reference constant. Pass whatever you wish - it will be returned to you in the selector.

## Discussion

*IMPORTANT NOTE* In Bluetooth framework version 1.0.0, the session returned will NOT be autoreleased as it should be according to objc convention. This has been changed starting in Bluetooth version 1.0.1 and later, so it WILL be autoreleased upon return, so you will need to retain it if you want to reference it later.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)