Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // BuyTokensViewController.swift
- // PrankDial
- //
- // Created by Hasan Rafi on 5/30/16.
- // Copyright © 2016 KickBackApps. All rights reserved.
- //
- import UIKit
- import AccountKit
- import PopupKit
- import JTProgressHUD
- class GetTokensViewController: UIViewController {
- var loginRequirer: LoginRequirer!
- var hasShownVideoThroughAvailabilityFlag = false
- @IBOutlet weak var whyBuyTokensView: UIView!
- @IBOutlet var gestureRecognizers: [UILongPressGestureRecognizer]!
- override func viewDidLoad() {
- super.viewDidLoad()
- accountKitInitialization()
- Supersonic.sharedInstance().setOWDelegate(self)
- Supersonic.sharedInstance().setRVDelegate(self)
- ALIncentivizedInterstitialAd.shared().adDisplayDelegate = self
- ALIncentivizedInterstitialAd.preloadAndNotify(self)
- }
- @IBAction func watchVideosTapped(sender: AnyObject) {
- if DeviceState.sharedInstance.isUserLoggedIn {
- ALIncentivizedInterstitialAd.show()
- } else {
- loginRequirer = LoginRequirer.RVAd
- launchLoginRequiredPopup()
- }
- }
- internal enum LoginRequirer : Int {
- case BuyTokens = 0
- case EarnTokens = 1
- case RVAd = 2
- }
- }
- extension GetTokensViewController: ALAdLoadDelegate {
- func adService(adService: ALAdService, didLoadAd ad: ALAd) {
- log.info("ad loaded")
- }
- func adService(adService: ALAdService, didFailToLoadAdWithError code: Int32) {
- log.error("ad loading failed with code : \(code)")
- }
- }
- extension GetTokensViewController: ALAdDisplayDelegate {
- func ad(ad: ALAd, wasDisplayedIn view: UIView) {
- log.info("wasDisplayedIn")
- }
- func ad(ad: ALAd, wasClickedIn view: UIView) {
- log.info("wasClickedIn")
- }
- func ad(ad: ALAd, wasHiddenIn view: UIView) {
- log.info("wasHiddenIn")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement