This is the Swift SDK for IBM App Launch service.
The Bluemix App Launch service on Bluemix helps in controlled reach of app features. It provides a unified service to customize and personalize your applications to different audience with just few clicks.
Ensure that you go through Bluemix App Launch service documentation before you start.
- Setup App Launch Service
- Prerequisites
- Installation
- Initialize SDK
- Feature Toggle
- Metrics
- Samples and videos
##Setup App Launch Service
- iOS 10+
- Xcode 9
- Swift 3.2 - 4
- Cocoapods or Carthage
The Bluemix Mobile Services Swift SDKs are available via Cocoapods and Carthage.
To install AppLaunch using Cocoapods, add it to your Podfile:
use_frameworks!
target 'MyApp' do
platform :ios, '9.0'
pod 'IBMAppLaunch'
pod 'BMSCore', '~> 2.0'
pod 'SwiftyJSON'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.2'
end
end
end
From the Terminal, go to your project folder and install the dependencies with the following command:
pod install
Before running the pod install
command, make sure to use Cocoapods version 1.1.0.beta.1.
For apps built with Swift 3.2, you may receive a prompt saying "Convert to Current Swift Syntax?" when opening your project in Xcode 9 (following the installation of BMSCore) do not convert AppLaunch or BMSCore.
This will installs your dependencies and creates a new Xcode workspace. Note: Ensure that you always open the new Xcode workspace, instead of the original Xcode project file:
MyApp.xcworkspace
To install AppLaunch using Carthage, add it to your Cartfile:
github "ibm-bluemix-mobile-services/bms-clientsdk-swift-applaunch"
Then run the carthage update
command. Once the build is finished, drag AppLaunch.framework
and BMSCore.framework
into your Xcode project.
To complete the integration, follow the instructions here.
import IBMAppLaunch
AppLaunch.sharedInstance.initializeWithAppGUID(applicationId: "your AppLaunch appGUID", clientSecret: "your AppLaunch client secret",region: "region")
AppLaunch.sharedInstance.registerWith(userId: "chethan")
Provide a completion handler to get a callback with the status and result of the call.
AppLaunch.sharedInstance.actions
Provide a completion handler to get the status and response of the call.
-
Use the
AppLaunch.sharedInstance.hasFeatureWith(code: "feature code")
to check if the feature is enabled for the app. -
Use the
AppLaunch.sharedInstance.getPropertyValueFor(featureWithCode: "feature code", propertyWithCode: "property code")
to get the value of the particular property in a feature.
To send metrics to the server use the AppLaunch.sharedInstance.sendMetricsWith()
api. This sends the metrics information to the server.
AppLaunch.sharedInstance.sendMetricsWith(code: "metric code")