Skip to content

recommend-pro/recommend-ios-sdk

Repository files navigation

Recommend iOS SDK

Requirements

  • iOS 11.0+

Installation

See the subsections below for details about the different installation methods.

  1. CocoaPods
  2. Swift Package Manager

CocoaPods

  1. Prepare project for CocoaPods usage by CocoaPods - Install / Get Started
  2. Add pod to project's profile
pod 'Recommend'
  1. Install pods
cd {PATH_TO_PROJECT}
pod install

Swift Package Manager

  1. Go to project
  2. FileAdd Packages...
  3. Search for library, using URL:
https://github.com/recommend-pro/recommend-ios-sdk
  1. Set the Dependency Rule to Up to Next Major Version or Exact Version
  2. Add Package

Configuration

  1. Add SDK to project (See Installation)
  2. Configure shared instance or create custom.

Important: Account Id must not be empty.

Shared instance configuration

Shared instance can be configured from plist or directly with parameters.

import Recommend

...

func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
    Recommend.configure()
    return true
}
import Recommend

...

func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
    Recommend.configure(accoundId: "0e1x2a3m4p5l")
    return true
}

Custom intance creation

let recommend = Recommend(accoundId: "0e1x2a3m4p5l")

Plist creation

Unless plist is not auto-generation, it can be created manually following instructions. All information is in access on control.recommend.pro

Example file provided in repo -> Recommend-Info.plist

Field Type Required Description
ACCOUNT_ID String + Account id
PUSH_APPLICATION_NAME_PROD String - Apple-iOS-Prod Push integration Application Name. Uses for release builds, usually from Xcode.
PUSH_APPLICATION_NAME_DEV String - Apple-iOS-Dev Push integration Application Name. Uses for debug builds, usually from App Store Connect / TestFlight.
API_HOST String - API host (domain). Can be empty. By default: api.recommend.pro.

License

The contents of this repository are licensed under the MIT License.