worked on real ads.
This commit is contained in:
@@ -9,10 +9,14 @@ import Foundation
|
||||
|
||||
extension K{
|
||||
struct GoogleAdIDs{
|
||||
static let webSeries = "ca-app-pub-3940256099942544/2934735716"
|
||||
static let webSeries = "ca-app-pub-5699008063638916/1393141241"
|
||||
|
||||
static let test = "ca-app-pub-3940256099942544/2934735716"
|
||||
|
||||
static let karaoke = "ca-app-pub-3940256099942544/2934735716"
|
||||
static let audioBooks = "ca-app-pub-3940256099942544/2934735716"
|
||||
static let games = "ca-app-pub-3940256099942544/2934735716"
|
||||
static let themeTwo = "ca-app-pub-3940256099942544/2934735716"
|
||||
// static let themeTwo = "ca-app-pub-3940256099942544/2934735716"
|
||||
static let themeTwo = "ca-app-pub-5699008063638916/1393141241"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSUserTrackingUsageDescription</key>
|
||||
<string>This identifier will be used to deliver personalized ads to you.</string>
|
||||
<key>GADApplicationIdentifier</key>
|
||||
<string>ca-app-pub-5699008063638916~6654980943</string>
|
||||
<key>API_KEY_ID</key>
|
||||
|
||||
@@ -10,6 +10,9 @@ import AVFoundation
|
||||
import JWPlayerKit
|
||||
import Alamofire
|
||||
|
||||
import AppTrackingTransparency
|
||||
import AdSupport
|
||||
|
||||
class ThemeOneVM{
|
||||
|
||||
weak var vc : ThemeOneVC!
|
||||
@@ -27,7 +30,27 @@ class ThemeOneVM{
|
||||
let queue = DispatchQueue.global(qos: .background)
|
||||
var isNetworkMonitored = false
|
||||
|
||||
func requestIDFA() {
|
||||
ATTrackingManager.requestTrackingAuthorization { status in
|
||||
switch status {
|
||||
case .authorized:
|
||||
// User granted permission, now you can access IDFA
|
||||
let idfa = ASIdentifierManager.shared().advertisingIdentifier.uuidString
|
||||
print("IDFA: \(idfa)")
|
||||
case .denied:
|
||||
print("User denied tracking permission")
|
||||
case .restricted:
|
||||
print("Tracking is restricted")
|
||||
case .notDetermined:
|
||||
print("Tracking authorization dialog has not been shown")
|
||||
@unknown default:
|
||||
print("Unknown authorization status")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func initView(){
|
||||
requestIDFA()
|
||||
AuthFunc.shareInstance.initTimePeriods()
|
||||
startInitialTimer()
|
||||
// moveCloudView()
|
||||
|
||||
@@ -125,12 +125,11 @@ class WebSeriesVM{
|
||||
// particular orientation,
|
||||
let adaptiveSize = GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(viewWidth)
|
||||
bannerView = GADBannerView(adSize: adaptiveSize)
|
||||
|
||||
|
||||
bannerView.center = vc.headerView.center
|
||||
|
||||
// bannerView.frame = CGRect(x: 0, y: 0, width: vc.headerView.frame.width, height: vc.headerView.frame.height)
|
||||
bannerView.frame = CGRect(x: 0, y: 0, width: vc.headerView.frame.width, height: vc.headerView.frame.height)
|
||||
vc.headerView.addSubview(bannerView)
|
||||
|
||||
bannerView.adUnitID = K.GoogleAdIDs.themeTwo
|
||||
bannerView.rootViewController = self.vc
|
||||
bannerView.load(GADRequest())
|
||||
|
||||
Reference in New Issue
Block a user