Building iOS
Getting Started
- For instructions on how to obtain and build the AllJoyn™ Core source for iOS, go here.
- For instructions on how to obtain and build the AllJoyn™ Base Services source for iOS, go here. Please note that building Core is a prerequisite for Base Services.
Add the AllJoyn™ framework to an iOS application
- Make sure you know the location of the AllJoyn SDK folder. The AllJoyn SDK folder contains your build, services, and alljoyn_objc folders.
- Open Xcode, open your project, and select the root of the tree in Project Navigator. Then select the app's target under Targets.
Add the AllJoyn Core library and dependencies:
- Select the Building Settings tab for the app target. Click the All option at the top of the list.
- At the top of the Build Settings list, click Architectures and then select Standard architectures (armv7, armv7s).
- Set Build Active Architecture only to Yes.
Scroll down to the Linking section, and set Other Linker Flags to the following:
-lalljoyn -lajrouter -lBundledRouter.o -lssl -lcrypto- Scroll down to the list of settings until you see the Search Paths group.
Double-click the Header Search Paths field and enter the following:
$(ALLJOYN_ROOT)/core/alljoyn/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/inc$(ALLJOYN_ROOT)/core/alljoyn/alljoyn_objc/AllJoynFramework/AllJoynFramework/Double-click the Library Search Paths field and enter the following:
$(ALLJOYN_ROOT)/core/alljoyn/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib$(OPENSSL_ROOT)/build/$(CONFIGURATION)-$(PLATFORM_NAME)Look through the Build Settings table until you see the Apple LLVM 5.0 - Language - C++ group and set the following:
- Enable C++ Exceptions to No.
- Enable C++ Runtime Types to No.
- C++ Language Dialect to Compiler Default.
Look through the Build Settings table until you see the Apple LLVM 5.0 - Custom Compiler Flags group and set the following:
Enter the following in the Other C Flags field for Debug field:
-DQCC_OS_GROUP_POSIX -DQCC_OS_DARWINEnter the following in the Other C Flags field for Release field:
-DNS_BLOCK_ASSERTIONS=1 -DQCC_OS_GROUP_POSIX -DQCC_OS_DARWIN
Look through the Build Settings table until you see the Apple LLVM 5.0 - Language group and set the following:
- C Language Dialect to Compiler Default.
- Compile Sources As to Objective-C++.
- Select the Build Phases tab.
- Expand the Link Binary With Libraries group and click the + sign at
the lower left corner. A dialog will appear.
- Select the SystemConfiguration.framework file.
- Click the + button again and add the following libraries to link against, if not already included:
- libstdc++.6.0.9.dylib
- libstdc++.6.dylib
- libstdc++.dylib
- libc++abi.dylib
- libc++.1.dylib
- libc++.dylib
Add the service frameworks
- Select the Build Phases tab for the app target. Click the All option at the top of the list.
Under Link Binary with Libraries, click on the '+' button, choose Add Other..., and add the following:
General libs (needed by all apps using one or more service frameworks):
$(AJ_ROOT)/core/alljoyn/build/darwin/arm/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/about/lib/- liballjoyn_about_cpp.a
- liballjoyn_about_objc.a
- libAllJoynFramework_iOS.a
$(AJ_ROOT)/services/base/services_common/ios/samples/alljoyn_services_cpp/build/$(PLATFORM)-$(CONFIGURATION)/- liballjoyn_services_common_cpp.a
$(AJ_ROOT)/services/base/services_common/ios/samples/alljoyn_services_objc/build/$(PLATFORM)-$(CONFIGURATION)/- liballjoyn_services_common_objc.a
Configuration libs:
$(AJ_ROOT)/core/alljoyn/build/darwin/$(CURRENT_ARCH)/$(PLATFORM_NAME)/$(CONFIGURATION)/dist/cpp/lib/- liballjoyn_config.a
Control Panel libs:
$(AJ_ROOT)/services/base/controlpanel/ios/samples/alljoyn_services_cpp/build/$(PLATFORM)-$(CONFIGURATION)/- liballjoyn_controlpanel_cpp.a
$(AJ_ROOT)/services/base/controlpanel/ios/samples/alljoyn_services_objc/build/$(PLATFORM)-$(CONFIGURATION)/- liballjoyn_controlpanel_objc.a
Notification libs:
$(AJ_ROOT)/services/base/notification/ios/samples/alljoyn_services_cpp/build/$(PLATFORM)-$(CONFIGURATION)/- liballjoyn_notification_cpp.a
$(AJ_ROOT)/services/base/notification/ios/samples/alljoyn_services_objc/build/$(PLATFORM)-$(CONFIGURATION)/- liballjoyn_notification_objc.a
Onboarding libs:
$(AJ_ROOT)/services/base/onboarding/ios/samples/alljoyn_services_cpp/build/$(PLATFORM)-$(CONFIGURATION)/- liballjoyn_onboarding_cpp.a
$(AJ_ROOT)/services/base/onboarding/ios/samples/alljoyn_services_objc/build/$(PLATFORM)-$(CONFIGURATION)/- liballjoyn_onboarding_objc.a
Social Links