Search form

Documentation

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

  1. Make sure you know the location of the AllJoyn SDK folder. The AllJoyn SDK folder contains your build, services, and alljoyn_objc folders.
  2. 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:

  1. Select the Building Settings tab for the app target. Click the All option at the top of the list.
  2. At the top of the Build Settings list, click Architectures and then select Standard architectures (armv7, armv7s).
  3. Set Build Active Architecture only to Yes.
  4. Scroll down to the Linking section, and set Other Linker Flags to the following:

    -lalljoyn -lajrouter -lBundledRouter.o -lssl -lcrypto

  5. Scroll down to the list of settings until you see the Search Paths group.
  6. 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/

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

  8. 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.
  9. 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_DARWIN

    • Enter the following in the Other C Flags field for Release field:

      -DNS_BLOCK_ASSERTIONS=1 -DQCC_OS_GROUP_POSIX -DQCC_OS_DARWIN

  10. 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++.
  11. Select the Build Phases tab.
  12. Expand the Link Binary With Libraries group and click the + sign at the lower left corner. A dialog will appear.
    1. Select the SystemConfiguration.framework file.
    2. Click the + button again and add the following libraries to link against, if not already included:
    3. libstdc++.6.0.9.dylib
    4. libstdc++.6.dylib
    5. libstdc++.dylib
    6. libc++abi.dylib
    7. libc++.1.dylib
    8. libc++.dylib

Add the service frameworks

  1. Select the Build Phases tab for the app target. Click the All option at the top of the list.
  2. 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
For future news and updates, please follow or visit https://t.co/MKr1Z9NPji
8 months 2 weeks ago