The Playbuzz SDK enabled developers easily embed Playbuzz items in native apps.
To check out the example, download the repo run the sample project.
- Add Playbuzz SDK using CocoaPods
pod 'PlaybuzzSDK'
- Enable html loads in the plist Enable Allow Arbitrary Loads in App Transport Security Settings in your Info.plist
- Add import PlaybuzzSDK to ViewController.swift so the compiler knows that PlaybuzzView is a valid class.
- Create PlaybuzzView with appropriate frame
- Load PlaybuzzView with embedCode and your company domain
- 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)
}
}
You've embedded you're first Playbuzz quiz
PlaybuzzSDK is available under the MIT license. See the LICENSE file for more info.


