Configuring IOS

To use this library on iOS, there are some frameworks, which Delphi should be aware of, but by default isn’t, so you need to perform the following changes in the IDE (you need to do this just once, it will apply to all projects):

  1. Go to Tools -> Options -> SDK Manager à iOS Device, for each iPhoneOS device:
  2. Click on any framework (just a click: there is a bug in IDE).
  3. Click “Add a new path item” image button (top one)
    1. Set “Path on remote machine” to “/System/Library/Frameworks” or “$(SDKROOT)/System/Library/Frameworks” (same as other frameworks).
    2. Set “Framework name” to “SystemConfiguration”.
    3. Click Ok (nothing should be selected in the radio and leave the checkbox unchecked).
  4. Repeat step 3 with Framework name “AdSupport”, “StoreKit”, “Social”, “CoreData”, “CoreTelephony”, “CoreMedia”, “SystemConfiguration”, “Security”, “EventKit”, “EventKitUI”, “AVFoundation”, “iAd”, “AudioToolbox”, “CoreBluetooth”, “SafariServices”, “CoreMotion”, “MediaPlayer”, “MobileCoreServices”, “CoreVideo” and “MessageUI” (no need to duplicate already existing items: Delphi XE5, for example, already includes StoreKit and iAd).
  5. Click “Update Local File Cache” button.

 

In each project, which is using this library, you need to perform the following changes:

  1. Go to Project -> Options -> Delphi Compiler à Linking.
  2. Choose Target “All Configurations – iOS Device platform”.
  3. Enter the following value in “Options passed to the LD linked” (this should be written as a single line):
      -lz -framework SystemConfiguration -weak_framework Social
      -weak_framework iAd -framework StoreKit -framework MessageUI
      -framework AudioToolbox -weak_framework AdSupport
      -framework Security -framework CoreData -framework EventKit
      -framework AVFoundation -framework CoreTelephony
      -framework EventKitUI -framework CoreMedia
      -framework CoreBluetooth -weak_framework SafariServices
      -weak_framework CoreMotion -framework MediaPlayer
      -framework CoreVideo -weak_framework MobileCoreServices

 

You should use iOS SDK version at least 9.0, as otherwise you might not have SafariServices framework (notice, it is weak-linked, so the app will work in iOS 7 even if you use SDK for iOS 9).

In addition to this the Receive Push Notifications should be selected within Project Option’s entitlements list, if you want to use push notifications.