Skip to content

LudaFuxPlaybuzz/PlaybuzzSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

112 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

playbuzz logo

Support Swift 3 compatible Platform iOS License: MIT

Get Started

The Playbuzz SDK enabled developers easily embed Playbuzz items in native apps.

Prerequisites

Example

To check out the example, download the repo run the sample project.

Instalation

  1. Add Playbuzz SDK using CocoaPods
pod 'PlaybuzzSDK'
  1. Enable html loads in the plist Enable Allow Arbitrary Loads in App Transport Security Settings in your Info.plist

plist

Usage

  1. Add import PlaybuzzSDK to ViewController.swift so the compiler knows that PlaybuzzView is a valid class.
  2. Create PlaybuzzView with appropriate frame
  3. Load PlaybuzzView with embedCode and your company domain
  4. Add PlaybuzzView to your view

ViewController.swift

import UIKit
import PlaybuzzSDK

class ViewController: UIViewController{
    
    override func viewDidLoad()
    {
        super.viewDidLoad() 

        let embedCode = "<script type=\"text/javascript\" src=\"//cdn.playbuzz.com/widget/feed.js\"></script><div class=\"pb_feed\" data-embed-by=\"bcf88815-8496-421d-89ad-76793fdcd387\" data-item=\"7885f470-9bf5-468b-8eff-1c1ac7f7738a\" ></div>"
        
        let companyDomain = "http://www.example.com"
        
        let playbuzzView = PlaybuzzView.init(frame: self.view.frame)
        
        playbuzzView.loadItem(embedCode,
                              companyDomain: companyDomain,
                              showItemInfo: true)
                              
        self.view.addSubview(playbuzzView)
    }
}

Congratulations!

You've embedded you're first Playbuzz quiz

screenshot

License

PlaybuzzSDK is available under the MIT license. See the LICENSE file for more info.

About

Playbuzz SDK for iOS

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors