Git Product home page Git Product logo

mparticle-apple-media-sdk's Introduction


mParticle Apple Media SDK

Hello! This is the public repo of the mParticle Apple Media SDK. We've built the mParticle platform to take a new approach to web and mobile app data and the platform has grown to support 200+ services and SDKs, including developer tools, analytics, attribution, messaging, and advertising services. mParticle is designed to serve as the connector between all of these services - check out our site, or hit us at [email protected] to learn more.

Documentation

Fully detailed documentation and other information about mParticle Apple SDK can be found at our doc site

Getting Started

Please be aware that this SDK is built as an extension of and requires the use of the mParticle Apple SDK.

Include and Initialize the SDK

Below summarizes the major steps to get the Apple Media SDK up and running. In addition to the below, we have built a sample app that provides a more in depth look at how to send Media Events to Adobe's Heartbeat Kit. See that sample app here

Load mParticle via your app's Podfile or Cartfile:

pod 'mParticle-Apple-Media-SDK', '~> 1.0'

OR

github "mparticle/mparticle-apple-media-sdk" ~> 1.0
// AppDelegate.swift
import mParticle_Apple_SDK
import mParticle_Apple_Media_SDK

let options = MParticleOptions(key: "REPLACEME", secret: "REPLACEME")
let mParticle = MParticle.sharedInstance()
mParticle.start(with: options)

// Later in your code, when a user begins to engage with your content
let mediaSession = MPMediaSession.init(
    coreSDK: mParticle,                 // mParticle SDK Instance
    mediaContentId: '1234567',          // Custom media ID
    title: 'Funny internet cat video',  // Custom media Title
    duration: 120000,                   // Duration in milliseconds
    contentType: .video,                // Content Type (Video or Audio)
    streamType: .onDemand)              // Stream Type (OnDemand, Live, etc.)


mediaSession.logMediaSessionStart()
mediaSession.logPlay()

// If you'd like to update playhead position frequently or add custom data to each event you may pass an option object into each log method
let options = Options()
options.currentPlayheadPosition = 48000
options.customAttributes = ["testKey": "testValue"]

mediaSession.logPause(options: options)

Contribution Guidelines

At mParticle, we are proud of our code and like to keep things open source. If you'd like to contribute, simply fork this repo, push any code changes to your fork, and submit a Pull Request against the master branch of mParticle-apple-media-sdk.

Running the Tests

You can use xcodebuild from the command line or just Product > Test (Command-U) in Xcode.

SwiftLint

By default Xcode will add trailing whitespace on whitespace only lines, which causes SwiftLint to fail. You can work around this without changing Xcode settings by running swiftlint autocorrect before committing.

Support

[email protected]

License

The mParticle Apple Media SDK is available under the Apache License, Version 2.0. See the LICENSE file for more info.

mparticle-apple-media-sdk's People

Contributors

alexs-mparticle avatar brandonstalnaker avatar peterjenkins avatar willpassidomo avatar

Watchers

 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.