Giter VIP home page Giter VIP logo

bms-clientsdk-swift-applaunch's Introduction

IBM Cloud Mobile Services - AppLaunch iOS Swift Client SDK

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.


Contents


##Setup App Launch Service

Creating the service

Create feature

Creating a feature

Create feature

Creating an audience

Create audience

Creating an engagement

Create engagement

Prerequisites

  • iOS 10+
  • Xcode 9
  • Swift 3.2 - 4
  • Cocoapods or Carthage

Installation

The Bluemix Mobile Services Swift SDKs are available via Cocoapods and Carthage.

Cocoapods

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

Swift 3.2

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

Carthage (coming soon)

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.


Enabling iOS applications to use IBM App Launch

Reference the SDK in your code.

import IBMAppLaunch

Initializing the AppLaunch SDK

AppLaunch.sharedInstance.initializeWithAppGUID(applicationId: "your AppLaunch appGUID", clientSecret: "your AppLaunch client secret",region: "region")

Register the user

AppLaunch.sharedInstance.registerWith(userId: "chethan")

Provide a completion handler to get a callback with the status and result of the call.

Get Client Actions

AppLaunch.sharedInstance.actions

Provide a completion handler to get the status and response of the call.

Get features and its properties

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

Metrics

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

bms-clientsdk-swift-applaunch's People

Contributors

vittalpai avatar chethankumar avatar sam-almighty avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.