IceIAP

2 min read

2 min read

2 min read

2 min read

2 min read

2 min read

2 min read

2 min read

2 min read

IceIAP provides the iap and TLS-protected iaps transports for C++ and Swift clients on iOS. It uses Apple's External Accessory framework to communicate with Ice servers on connected accessories. The accessory must provide the server side of the connection.

An accessory can be discovered based on a number of attributes:

  • its name
  • its manufacturer
  • its model number
  • an advertised protocol

IceIAP searches the accessories that iOS reports as connected. The protocol is the one required attribute: the accessory must advertise the endpoint's protocol, com.zeroc.ice unless the endpoint specifies another. The name, manufacturer, and model number are optional filters. An accessory matches only when each specified value equals the accessory's value.

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:

C++
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
initData.pluginFactories = {Ice::iapPluginFactory()};
Ice::CommunicatorPtr communicator = Ice::initialize(initData);

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

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 key.

To use TLS over iAP, replace iap with iaps and configure the SSL transport.