Skip Navigation

Manually add the 
BlackBerry Dynamics SDK
 to your 
Swift
 project 

Follow the steps below if you have an existing project. Otherwise, for new projects, consider using the 
BlackBerry Dynamics SDK
 
Xcode
 template described in Create Objective-C or Swift project with 
BlackBerry Dynamics
 SDK Xcode template
.
  1. In the 
    Link binary with binaries
     section or 
    Build
     section of your 
    Xcode
     project, add the 
    GD.framework
    .
  2. Add the frameworks and libraries listed in Software requirements to the project.
  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, as shown here:
    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. Modify the app's 
    Info.plist
     file to include the proper values for 
    GDApplicationID
     and 
    GDApplicationVersion
    , as described in BlackBerry Dynamics entitlement ID and version.
  8. Define URL types with the same ID as the bundle ID, and URL schemes with the required discovery schemes detailed in Required build-time declarations: URL type (and any other discovery schemes required by your app).
  9. Enable FIPS Linking (see Link for FIPS in Swift).
  10. Include the GDAssets.bundle in the build phase (see GDAssets.bundle required in build phase).
  11. Build your project.