PSSDK-inner 1.0.5

PSSDK-inner 1.0.5

测试已测试
Lang语言 Obj-CObjective C
许可 MIT
Released最后发布2017年1月

zhouyehong 维护。



需求

  • iOS 8.0+
  • 需要 ARC
  • xcode 8.0+

安装

手动,使用 SDK 下载

  1. 下载并解压 PSSDK-iOS
  2. 将 PSSDK-iOS 文件夹拖到您的 Xcode 应用程序组中(请确保勾选“复制到目标组的文件夹”选项)。
  3. 将以下框架或库添加到您的项目中。为此,请点击您的应用程序目标,然后点击构建 phases,展开“链接二进制与库”组。
    1. 需要以下框架
      1. 'CoreGraphics.framework'
      2. 'UIKit.framework'
      3. 'Foundation.framework'
      4. 'QuartzCore.framework'
      5. 'StoreKit.framework'
      6. 'SystemConfiguration.framework'
      7. 'CoreTelephony.framework'
      8. 'Security.framework'
      9. 'AdSupport.framework'
    2. 需要以下库
      1. libz.tbd
  4. 转到目标-\t构建设置-\t所有
    搜索 "其他链接器标志", 在其他链接器标志中添加 "-ObjC"

使用

oc

//1、property
@property(nonatomic,strong)PSVideoView *adView;

//2、init
self.adView = [[PSVideoView alloc] initWithPublisherId:YOUR_PUBLISHER_ID slotId:YOUR_SLOT_ID];
_adView.delegate = self;
[_adView loadAd];

//3、delegate
-(void)psAdViewVideoDidLoad:(PSVideoView*)view{
    [view presentToViewController:self];
}
***other delegate***

查看完成示例

#import "ViewController.h"
#import "PingStart.h"

@interface ViewController ()<PSVideoDelegate>
@property(nonatomic,strong)PSVideoView *adView;
@end

@implementation ViewController
- (void)viewDidLoad {
    [super viewDidLoad];

    self.adView = [[PSVideoView alloc] initWithPublisherId:YOUR_PUBLISHER_ID slotId:YOUR_SLOT_ID];
    _adView.delegate = self;
    [_adView loadAd];
}

-(void)psAdViewVideoDidLoad:(PSVideoView *)view{
    [view presentToViewController:self];
}
@end

swift

将以下行添加到 YOUR_PROJECT-Bridging-Header.h

#import "PingStart.h"
//1、property
var adView : PSVideoView?

//2、init
adView = PSVideoView(publisherId:YOUR_PUBLISHER_ID,slotId:YOUR_SLOT_ID)
adView?.delegate = self
adView?.loadAd()

//3、delegate
func psAdViewVideoDidLoad(_ view: PSVideoView) {
    view.present(to: self)
}
***other delegate***

查看完成示例

import UIKit

class ViewController: UIViewController,PSVideoDelegate {
    var adView : PSVideoView?

    override func viewDidLoad() {
        super.viewDidLoad()
        PingStart.enableDebug(true)

        adView = PSVideoView(publisherId: YOUR_PUBLISHER_ID, slotId: YOUR_SLOT_ID)
        adView?.delegate = self
        adView?.loadAd()
    }

    func psAdViewVideoDidLoad(_ view: PSVideoView) {
        view.present(to: self)
    }
}

更多示例