Skip Navigation

Manually add the 
BlackBerry Dynamics SDK
 to your 
Swift
 project 

Follow the steps below if you have an existing project. For new projects, see Create an Objective-C or Swift project with the Xcode template.
  1. In the 
    Link binary with binaries
     section or 
    Build
     section of your 
    Xcode
     project, add 
    GD.framework
    .
  2. Add the required frameworks and libraries to the project (see Software requirements).
  3. In your code, import the 
    BlackBerry Dynamics Runtime
     module:
    import GD.Runtime
  4. Modify the 
    AppDelegate
     class to implement the 
    GDiOSDelegate
     protocol to implement a 
    handleEvent
     (
    anEvent:
    ) method:
    class AppDelegate: UIResponder, UIApplicationDelegate, GDiOSDelegate { [...] func handle(_ anEvent:GDAppEvent) { [...] } }
  5. Add a variable to your 
    AppDelegate
    :
    var good: GDiOS?
  6. Add the following code to the 
    didFinishLaunchingWithOptions
     function:
    self.good = GDiOS.sharedInstance() // Get BlackBerry Dynamics shared instance self.good!.delegate = self // Set delegate self.good!.authorize() // Authorize
  7. In the 
    Info.plist
     file, add the entitlment ID (
    GDApplicationID
    ) and entitlement version (
    GDApplicationVersion
    ). For more information, see Using an entitlement ID and version to uniquely identify a BlackBerry Dynamics app.
  8. Define URL types with the same ID as the bundle ID and URL schemes with the required schemes described in Declaring a URL type to support BlackBerry Dynamics features.
  9. Add 
    GDAssets.bundle
     to the 
    Copy Bundle Resources
     build phase in 
    Xcode
    . Verify that the copy of the bundle that is distributed with the framework has been added to the project.
  10. Build your project.