Code Monkey home page Code Monkey logo

sdkdaycheo's Introduction

SDKDayCheo

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Debug

SMConfig.setDebug(true)

Interstitial

Khởi tạo quảng cáo full

full = SMInterstitial()
full.rootViewController = self
full.delegate = self
full.load()

Hiển thị quảng cáo full

full.show()

Delegate

@objc optional func interstitialLoaded(interstitial:SMInterstitial)
@objc optional func interstitialError()
@objc optional func interstitialDidClick()
@objc optional func interstitialCloseClick()

Quảng cáo Native ( dạng hiển thị Dialog )

Khởi tạo quảng cáo dạng Native

var native: SMNativeView = SMNativeView()

Tải quảng cáo Native

       native.delegate = self
       native.load()

Delegate

   //Khi quảng cáo đã tải xong
   @objc optional func nativeViewDidLoad(_ ad: SMNativeView)
   
   //Khi tải quảng cáo native về bị failure
   @objc optional func nativeView(_ ad: SMNativeView, didFailWithError error: Error)
   
   //Khi người dùng click vào nút "Cancel"
   @objc optional func nativeViewDidClose(_ ad: SMNativeView)
   
   //Khi người dùng click vào nút "Get it!"
   @objc optional func nativeViewDidClick(_ ad: SMNativeView)
   
   //Hiện tại chưa dùng tới
   @objc optional func nativeViewDidFinishHandlingClick(_ ad: SMNativeView)

Ví dụ

    //Khi adNative load thành công. Gọi hiển thị dialog bằng cách :
    func nativeViewDidLoad(_ ad: SMNativeView) {
        ad.showDialog(UIController: self) // Gọi hiển thị quảng cáo Dialog
    }

Quảng cáo Native tùy chỉnh

Class SMNativeView : Hỗ trợ lấy Ad Unit, Redirect link, Call API report

   //Hàm trả về Ad Unit
   func getAdsObject() -> SMAds?
   
   //Khi người dùng ấn vào nút "download, hay get it!"
   //Việc này sẽ kiểm tra link từ server trả về  deeplink hay store link để điều hướng cho phù hợp
   func requestClickCampaign()
   
   //Kiểm tra store link hay deeplink
   func checkDynamicLink() -> Bool 
   
   //Hàm này chuyển sang 1 controller  trong SMNative.storyboard để xử  deeplink
   func openDeepLink()
   
   //Hàm này chuyển sang store
   func openAppStore()
   
   //Hàm này được gọi khi người dùng ấn "get it"
   func callAPIClickAd()
   
   //Hàm này được gọi khi native custom show
   func callAPIClickAd()

Requirements

  • iOS 9.0
  • Xcode 10.2+
  • Swift 4.2+

Installation

SDKDayCheo is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SDKDayCheo', :git => 'https://github.com/oneweekstudio/SDKDayCheo.git', :branch => 'master'

Author

truongtvd, [email protected]

License

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

sdkdaycheo's People

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.