---
title: "IceIAP"
url: https://docs.zeroc.com/ice/3.8/plugins/iceiap
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# IceIAP

Parts of this page are for some programming languages only, and name them. For one language's text alone, see [C++](https://docs.zeroc.com/ice/3.8/plugins/iceiap/cpp.md), [C#](https://docs.zeroc.com/ice/3.8/plugins/iceiap/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/plugins/iceiap/java.md), [JavaScript](https://docs.zeroc.com/ice/3.8/plugins/iceiap/js.md), [MATLAB](https://docs.zeroc.com/ice/3.8/plugins/iceiap/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/plugins/iceiap/php.md), [Python](https://docs.zeroc.com/ice/3.8/plugins/iceiap/python.md), [Ruby](https://docs.zeroc.com/ice/3.8/plugins/iceiap/ruby.md), and [Swift](https://docs.zeroc.com/ice/3.8/plugins/iceiap/swift.md).

IceIAP provides the `iap` and TLS-protected `iaps` transports for C++ and Swift clients on iOS. It uses [Apple's External Accessory framework](https://developer.apple.com/documentation/externalaccessory) to communicate with Ice servers on connected accessories. The accessory must provide the server side of the connection.

## Accessory Discovery

IceIAP looks for the accessory among those attached to the iOS device, through its port or over Bluetooth. The accessory must advertise the endpoint's protocol, `com.zeroc.ice` unless the endpoint specifies another. The endpoint can also specify a name, manufacturer, and model number; each one it specifies must equal the accessory's value.

## Installing IceIAP

> **C++**
>
> The IceIAP plug-in is included in all builds of the Ice C++ library for iOS. You enable (“load”) the plug-in by adding it to the `pluginFactories` field of `InitializationData`:
>
> ```cpp
> Ice::InitializationData initData;
> initData.properties = Ice::createProperties(argc, argv);
> initData.pluginFactories = {Ice::iapPluginFactory()};
>
> Ice::CommunicatorPtr communicator = Ice::initialize(initData);
> ```

> **C#, Java, JavaScript, MATLAB, PHP, Python, and Ruby**
>
> > **Note**
> >
> > IceIAP supports C++ and Swift clients on iOS.

> **Swift**
>
> The IceIAP plug-in is always enabled on iOS, just like the TCP and UDP transports.

## Using IceIAP

An iAP endpoint in a proxy specifies attributes that are used to find and connect to a matching accessory. An iAP endpoint has the following syntax:

`iap [-p protocol] [-n name] [-m manufacturer] [-o modelNumber] [-z]`

For example, to invoke on a proxy for the `greeter` object running on an accessory that implements the `com.example.visitor` protocol, use the following stringified proxy:

`greeter:iap -p com.example.visitor`

The app's Info.plist lists the protocols the app uses, such as `com.example.visitor`, in the [UISupportedExternalAccessoryProtocols](https://developer.apple.com/documentation/bundleresources/information-property-list/uisupportedexternalaccessoryprotocols) key.

To use TLS over iAP, replace `iap` with `iaps` and configure the [SSL transport](https://docs.zeroc.com/ice/3.8/runtime/ssl-transport.md).

## See Also

- [Plug-in Facility](https://docs.zeroc.com/ice/3.8/plugins/plug-in-facility.md)
- [Proxy and Endpoint Syntax](https://docs.zeroc.com/ice/3.8/runtime/endpoint-syntax.md)
