Coder Social home page Coder Social logo

front-row-seat-ios-cocoapod's Introduction

IMGA SDK for iOS is library for iOS providing a powerful high-level webview abstractions to interact with the IMGA web app.

Installation

IMGA SDK supports multiple methods for installing the library in a project.

Installation with CocoaPods

To integrate IMGA SDK into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'IMGASDK', :git => '[email protected]:IMGARENA/front-row-seat-ios-cocoapod.git', :tag => 'v0.9'

Installation with SPM

To integrate IMGA SDK into your Swift project using SPM, specify it in your Package.swift

dependencies: [
    .package(url: "https://github.com/IMGARENA/front-row-seat-ios-cocoapod", from: "0.9.0")
],

Requirements

IMGA SDK requires iOS 14 and xCode 14.1

Usage

Creating an instance

 let imga = IMGASDK(logLevel: .debug)

Initialiasing de SDK (launch)

Launching the SDK with raw data
let eventCentreData:IMGAData = [
            "operator": "[OPERATOR-NAME]",
            "sport": "golf",
            "targetModule": "full",
            "eventId": "269",
            "language": "en",
            "version": "5.x",
            "initialContext" : [
                "view": "GroupDetail",
                "roundNo": "1",
                "groupNo": "37"],
            "targetElementSelector": "#img-arena-event-centre",
            "options":["videoPlaybackEnabled": "false"]
        ]
//Launch with the event centre data
try? imga.launch(with: eventCentreData) { imgaView in
    if let newView = imgaView {
        //Do something with the imgaView
    }
}
Launching the SDK with IMGAEventCentreParams object
let initialContex:IMGAData = [
            "view": "GroupDetail",
            "roundNo": "1",
            "groupNo": "37"]
        
let eventCentreDataParams = IMGAEventCentreParams(operatorName: "operatorName",
                                         sport: "sport",
                                         version: "version",
                                         eventId: "eventId",
                                         language: "language",
                                         theme: "theme",
                                         targetModule: "targetModule",
                                         initialContext: initialContex,
                                         options: nil,
                                         targetElementSelector: "targetElementSelector")

//Launch with the event centre data
try? imga.launch(with: eventCentreDataParams) { imgaView in
    if let newView = imgaView {
        //Do something with the imgaView
    }
}
Launching the SDK and append the IMGA View to a container
let initialContex:IMGAData = [
"view": "GroupDetail",
"roundNo": "1",
"groupNo": "37"]

let eventCentreDataParams = IMGAEventCentreParams(operatorName: "operatorName",
                        sport: "sport",
                        version: "version",
                        eventId: "eventId",
                        language: "language",
                        theme: "theme",
                        targetModule: "targetModule",
                        initialContext: initialContex,
                        options: nil,
                        targetElementSelector: "targetElementSelector")

//Container where to add the IMGA view
let myContainer = UIView()

//Launch with the event centre data
try? imga.launch(andAddTo: myContainer, with: eventTest1)
Subscribing to status changes
//Instance the sdk
let imga = IMGASDK(logLevel: .debug)
//Subscribe to the sdk status changes
imga.onStatusChange = {status, error in
    print("Status:\(status)")
    if let e = error {
        print("Error on status:\(e)")
    }
}
Subscribing to new messages

There are several types of messages/topics

  • CONTEXT_UPDATE: Topic for covering general UI state updates, for example navigation changes or the user selecting a player in the UI.
  • HANDSHAKE_FAILED: Topic to signify the handshake between Event Centre and your site failed to complete.
//Instance the sdk
let imga = IMGASDK(logLevel: .debug)
imga.onNewMessage = {name, message, error in
    print("New Message:\(name)-\(message)")
    if let e = error {
        print("Error on message:\(e.description)")
    }
}
Stop the sdk
//Instance the sdk
let imga = IMGASDK(logLevel: .debug)
//Stop the instance
imga.stop()

Credits

IMGA SDK is owned and maintained by the IMGA Development team.

License

IMG Media Limited

front-row-seat-ios-cocoapod's People

Contributors

david2coders avatar johanlajili avatar imgarena-devops-github-bot avatar paulfairless avatar wjadoon avatar

Watchers

 avatar Dailos Medina avatar Darius Robson avatar

Forkers

djups

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.