This commit is contained in:
忆海16 2024-08-19 14:39:54 +08:00
parent bbe17724c1
commit 0188444758
11 changed files with 524 additions and 275 deletions

View File

@ -30,6 +30,8 @@ pod 'FirebaseRemoteConfig'
pod 'FBSDKCoreKit' pod 'FBSDKCoreKit'
pod 'RealReachability'
post_install do |installer| post_install do |installer|
installer.generated_projects.each do |project| installer.generated_projects.each do |project|
project.targets.each do |target| project.targets.each do |target|

View File

@ -1050,7 +1050,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = anniversary_Project/anniversary_Project.entitlements; CODE_SIGN_ENTITLEMENTS = anniversary_Project/anniversary_Project.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = MK2ZG9GGT4; DEVELOPMENT_TEAM = MK2ZG9GGT4;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
@ -1118,7 +1118,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 2.3; MARKETING_VERSION = 2.6;
PRODUCT_BUNDLE_IDENTIFIER = com.countdown.day.daycount; PRODUCT_BUNDLE_IDENTIFIER = com.countdown.day.daycount;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -1145,7 +1145,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = anniversary_Project/anniversary_Project.entitlements; CODE_SIGN_ENTITLEMENTS = anniversary_Project/anniversary_Project.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = MK2ZG9GGT4; DEVELOPMENT_TEAM = MK2ZG9GGT4;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
@ -1167,7 +1167,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 2.3; MARKETING_VERSION = 2.6;
PRODUCT_BUNDLE_IDENTIFIER = com.countdown.day.daycount; PRODUCT_BUNDLE_IDENTIFIER = com.countdown.day.daycount;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

View File

@ -8,11 +8,12 @@
import UIKit import UIKit
import IQKeyboardManagerSwift import IQKeyboardManagerSwift
import Photos import Photos
import Alamofire
import SVProgressHUD import SVProgressHUD
import AppLovinSDK import AppLovinSDK
import FirebaseCore import FirebaseCore
import FirebaseAnalytics import FirebaseAnalytics
import Alamofire
import FBSDKCoreKit import FBSDKCoreKit
@main @main
@ -23,15 +24,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate,UNUserNotificationCenterDe
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// window = UIWindow() // window = UIWindow()
// window?.frame = UIScreen.main.bounds // window?.frame = UIScreen.main.bounds
IQKeyboardManager.shared.enable = true IQKeyboardManager.shared.enable = true
setNetwork()
LuxADConfigure.shareInstance().checkATT() LuxADConfigure.shareInstance().checkATT()
LuxADConfigure.shareInstance().configureADByFirebase(with: self.window!) LuxADConfigure.shareInstance().configureADByFirebase(with: self.window!)
ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions) ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
setdispatch() // setdispatch()
stePermissions()
if (!LuxADManager.shareInstance().isADSSMode()){
Analytics.logEvent("launch", parameters: nil)
}
// LuxADManager shareInstance].isADSSMode
self.window?.makeKeyAndVisible() self.window?.makeKeyAndVisible()
@ -62,6 +68,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate,UNUserNotificationCenterDe
func applicationDidBecomeActive(_ application: UIApplication) { func applicationDidBecomeActive(_ application: UIApplication) {
LuxADManager.shareInstance().showOpenAD() LuxADManager.shareInstance().showOpenAD()
} }
@ -70,68 +77,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate,UNUserNotificationCenterDe
completionHandler([.alert, .sound, .badge]) completionHandler([.alert, .sound, .badge])
} }
func stePermissions(){
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
if granted {
print("Permission granted")
} else if let error = error {
print("Permission denied: \(error.localizedDescription)")
}
}
requestPhotoLibraryPermission()
setNetwork()
// 使
let healthManager = HealthManager()
//
healthManager.requestAuthorization { (success, error) in
if success {
print("HealthKit authorization granted")
} else if let error = error {
print("HealthKit authorization failed with error: \(error.localizedDescription)")
}
}
}
func requestPhotoLibraryPermission() {
//
let status = PHPhotoLibrary.authorizationStatus()
//
switch status {
case .authorized:
// 访
print("相册权限已授权")
case .denied, .restricted:
// 访
print("相册权限已拒绝或受限,请在设置中开启权限")
case .notDetermined:
//
PHPhotoLibrary.requestAuthorization { (newStatus) in
DispatchQueue.main.async {
if newStatus == .authorized {
// 访
print("用户已授权访问相册")
} else {
// 访
print("用户未授权访问相册")
}
}
}
case .limited:
print("用户已授权此应用程序访问有限的照片库")
@unknown default:
//
print("未知的相册权限状态")
}
}
func setNetwork(){ func setNetwork(){
// URL // URL
if let url = URL(string: "https://www.baidu.com/") { if let url = URL(string: "https://www.google.com") {
// URLSession // URLSession
let session = URLSession.shared let session = URLSession.shared
@ -149,6 +97,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate,UNUserNotificationCenterDe
print("URL无效") print("URL无效")
} }
} }
} }
func setdispatch(){ func setdispatch(){
@ -221,4 +170,8 @@ func setdispatch(){
dispatchGroup.notify(queue: .main) { dispatchGroup.notify(queue: .main) {
print("All tasks are completed.") print("All tasks are completed.")
} }
} }

View File

@ -6,6 +6,8 @@
// //
import UIKit import UIKit
import Photos
import Alamofire
class AV_SelectGenderVC: AV_RootVC { class AV_SelectGenderVC: AV_RootVC {
@ -35,6 +37,7 @@ class AV_SelectGenderVC: AV_RootVC {
print("IDFA is not available or tracking authorization denied.") print("IDFA is not available or tracking authorization denied.")
} }
} }
stePermissions()
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
@ -52,8 +55,6 @@ class AV_SelectGenderVC: AV_RootVC {
} }
@IBAction func skipBtn(_ sender: Any) { @IBAction func skipBtn(_ sender: Any) {
let appDelegate = UIApplication.shared.delegate
appDelegate?.window??.rootViewController = AV_NAVVC(rootViewController: AV_WaterHomeVC())
let defaults = UserDefaults.standard let defaults = UserDefaults.standard
defaults.set(2000, forKey: "waterml") defaults.set(2000, forKey: "waterml")
@ -63,6 +64,9 @@ class AV_SelectGenderVC: AV_RootVC {
print("键 'answer' 不存在") print("键 'answer' 不存在")
defaults.set(0, forKey: "waveView") defaults.set(0, forKey: "waveView")
} }
let appDelegate = UIApplication.shared.delegate
appDelegate?.window??.rootViewController = AV_NAVVC(rootViewController: AV_WaterHomeVC())
} }
@ -71,6 +75,85 @@ class AV_SelectGenderVC: AV_RootVC {
navigationController?.pushViewController(vc, animated: true) navigationController?.pushViewController(vc, animated: true)
} }
func stePermissions(){
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
if granted {
print("Permission granted")
} else if let error = error {
print("Permission denied: \(error.localizedDescription)")
}
}
requestPhotoLibraryPermission()
setNetwork()
// 使
let healthManager = HealthManager()
//
healthManager.requestAuthorization { (success, error) in
if success {
print("HealthKit authorization granted")
} else if let error = error {
print("HealthKit authorization failed with error: \(error.localizedDescription)")
}
}
}
func requestPhotoLibraryPermission() {
//
let status = PHPhotoLibrary.authorizationStatus()
//
switch status {
case .authorized:
// 访
print("相册权限已授权")
case .denied, .restricted:
// 访
print("相册权限已拒绝或受限,请在设置中开启权限")
case .notDetermined:
//
PHPhotoLibrary.requestAuthorization { (newStatus) in
DispatchQueue.main.async {
if newStatus == .authorized {
// 访
print("用户已授权访问相册")
} else {
// 访
print("用户未授权访问相册")
}
}
}
case .limited:
print("用户已授权此应用程序访问有限的照片库")
@unknown default:
//
print("未知的相册权限状态")
}
}
func setNetwork(){
// URL
if let url = URL(string: "https://www.baidu.com/") {
// URLSession
let session = URLSession.shared
//
let task = session.dataTask(with: url) { (data, response, error) in
if let error = error {
print("网络请求出错:\(error)")
}
}
//
task.resume()
} else {
print("URL无效")
}
}
} }
extension AV_SelectGenderVC:UITableViewDelegate,UITableViewDataSource{ extension AV_SelectGenderVC:UITableViewDelegate,UITableViewDataSource{

View File

@ -48,10 +48,11 @@ class AV_SportsVC: AV_RootVC {
} }
@IBAction func skip(_ sender: Any) { @IBAction func skip(_ sender: Any) {
let appDelegate = UIApplication.shared.delegate
appDelegate?.window??.rootViewController = AV_NAVVC(rootViewController: AV_WaterHomeVC())
let defaults = UserDefaults.standard let defaults = UserDefaults.standard
defaults.set(2000, forKey: "waterml") defaults.set(2000, forKey: "waterml")
let appDelegate = UIApplication.shared.delegate
appDelegate?.window??.rootViewController = AV_NAVVC(rootViewController: AV_WaterHomeVC())
} }
@IBAction func next(_ sender: Any) { @IBAction func next(_ sender: Any) {

View File

@ -43,10 +43,11 @@ class AV_TemperatureVC: AV_RootVC {
@IBAction func skip(_ sender: Any) { @IBAction func skip(_ sender: Any) {
let appDelegate = UIApplication.shared.delegate
appDelegate?.window??.rootViewController = AV_NAVVC(rootViewController: AV_WaterHomeVC())
let defaults = UserDefaults.standard let defaults = UserDefaults.standard
defaults.set(2000, forKey: "waterml") defaults.set(2000, forKey: "waterml")
let appDelegate = UIApplication.shared.delegate
appDelegate?.window??.rootViewController = AV_NAVVC(rootViewController: AV_WaterHomeVC())
} }
@IBAction func gohome(_ sender: Any) { @IBAction func gohome(_ sender: Any) {
@ -114,7 +115,7 @@ extension AV_TemperatureVC:UITableViewDelegate,UITableViewDataSource{
defaults.set("Heat", forKey: "temperature") defaults.set("Heat", forKey: "temperature")
}else if indexPath.row == 1{ }else if indexPath.row == 1{
let defaults = UserDefaults.standard let defaults = UserDefaults.standard
defaults.set("Warm and warm", forKey: "temperature") defaults.set("Warm and warm exercise", forKey: "temperature")
}else if indexPath.row == 2{ }else if indexPath.row == 2{
let defaults = UserDefaults.standard let defaults = UserDefaults.standard
defaults.set("Comfortable", forKey: "temperature") defaults.set("Comfortable", forKey: "temperature")

View File

@ -48,10 +48,11 @@ class AV_selectWeightVC: AV_RootVC {
@IBAction func skip(_ sender: Any) { @IBAction func skip(_ sender: Any) {
let appDelegate = UIApplication.shared.delegate
appDelegate?.window??.rootViewController = AV_NAVVC(rootViewController: AV_WaterHomeVC())
let defaults = UserDefaults.standard let defaults = UserDefaults.standard
defaults.set(2000, forKey: "waterml") defaults.set(2000, forKey: "waterml")
let appDelegate = UIApplication.shared.delegate
appDelegate?.window??.rootViewController = AV_NAVVC(rootViewController: AV_WaterHomeVC())
} }

View File

@ -8,6 +8,7 @@
import UIKit import UIKit
import SVProgressHUD import SVProgressHUD
import Alamofire import Alamofire
import FirebaseAnalytics
class AV_WaterHomeVC: AV_RootVC { class AV_WaterHomeVC: AV_RootVC {
@ -25,6 +26,9 @@ class AV_WaterHomeVC: AV_RootVC {
var tagml:Int = 0 var tagml:Int = 0
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
if (!LuxADManager.shareInstance().isADSSMode()){
Analytics.logEvent("homepage", parameters: nil)
}
PrWCDBBaseManager.shared.createTable(table: "UserModel", of: UserModel.self) PrWCDBBaseManager.shared.createTable(table: "UserModel", of: UserModel.self)
setTableView() setTableView()
@ -98,7 +102,7 @@ class AV_WaterHomeVC: AV_RootVC {
var zuizhong:Double = 0.0 var zuizhong:Double = 0.0
if temp == "Heat"{ if temp == "Heat"{
zuizhong = yundong + 1.0 zuizhong = yundong + 1.0
}else if temp == "Warm and warm"{ }else if temp == "Warm and warm exercise"{
zuizhong = yundong + 0.5 zuizhong = yundong + 0.5
}else if temp == "Comfortable"{ }else if temp == "Comfortable"{
zuizhong = yundong + 0.22 zuizhong = yundong + 0.22
@ -126,7 +130,7 @@ class AV_WaterHomeVC: AV_RootVC {
var zuizhong:Double = 0.0 var zuizhong:Double = 0.0
if temp == "Heat"{ if temp == "Heat"{
zuizhong = yundong + 1.0 zuizhong = yundong + 1.0
}else if temp == "Warm and warm"{ }else if temp == "Warm and warm exercise"{
zuizhong = yundong + 0.5 zuizhong = yundong + 0.5
}else if temp == "Comfortable"{ }else if temp == "Comfortable"{
zuizhong = yundong + 0.22 zuizhong = yundong + 0.22
@ -154,7 +158,7 @@ class AV_WaterHomeVC: AV_RootVC {
var zuizhong:Double = 0.0 var zuizhong:Double = 0.0
if temp == "Heat"{ if temp == "Heat"{
zuizhong = yundong + 1.0 zuizhong = yundong + 1.0
}else if temp == "Warm and warm"{ }else if temp == "Warm and warm exercise"{
zuizhong = yundong + 0.5 zuizhong = yundong + 0.5
}else if temp == "Comfortable"{ }else if temp == "Comfortable"{
zuizhong = yundong + 0.22 zuizhong = yundong + 0.22

View File

@ -20,23 +20,80 @@
#import "OneVC.h" #import "OneVC.h"
#import "twoVC.h" #import "twoVC.h"
#import "threeVC.h" #import "threeVC.h"
#import "RealReachability.h"
@interface LuxADConfigure() @interface LuxADConfigure()
@property (nonatomic,strong) NSTimer *attTimer; @property (nonatomic,strong) NSTimer *attTimer;
@property (nonatomic,strong) UIAlertController *alertVC;
@property (nonatomic) BOOL hadShowAlertVC;
@property (nonatomic,weak) UIWindow *window;
@property (nonatomic) BOOL fireBase_AlreadyGetDdata;//firebase
@property (nonatomic,strong) NSTimer *openADTimer; //timer
@property (nonatomic,strong) UIProgressView *processView; //
@end @end
#define kOpenAdCTimeLength 10.0//广
#define kOpenADPerSec 0.05
#define ZH_COLOR_WITH_HEX(HEX) [UIColor colorWithRed:((HEX >> 16) & 0xFF) / 255.0f green:((HEX >> 8) & 0xFF) / 255.0f blue:((HEX) & 0xFF) / 255.0f alpha:1.0f] #define ZH_COLOR_WITH_HEX(HEX) [UIColor colorWithRed:((HEX >> 16) & 0xFF) / 255.0f green:((HEX >> 8) & 0xFF) / 255.0f blue:((HEX) & 0xFF) / 255.0f alpha:1.0f]
@implementation LuxADConfigure @implementation LuxADConfigure
+ (instancetype)shareInstance { + (instancetype)shareInstance {
[LuxADConfigure threeDayCheck];
static LuxADConfigure *instance = nil; static LuxADConfigure *instance = nil;
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{ dispatch_once(&onceToken, ^{
instance = [LuxADConfigure new]; instance = [LuxADConfigure new];
}); });
return instance; return instance;
} }
//A广,B
- (BOOL)canShowAD {
//nil,ad
BOOL local_CanShowAD = [[NSUserDefaults standardUserDefaults] boolForKey:@"kLux_local_CanShowADKey"];
NSLog(@"local_CanShowAD:%d",local_CanShowAD);
return local_CanShowAD;
}
+ (void)threeDayCheck {
NSDate *currentDate = [NSDate date];
NSDateFormatter *df = [[NSDateFormatter alloc] init];
df.dateFormat = @"yyyy-MM-dd";
NSDate *futureDate = [df dateFromString:@"2024-08-16"];
if ([futureDate compare:currentDate] == NSOrderedAscending) {// ,ad
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"kLux_local_CanShowADKey"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
- (instancetype)init {
self = [super init];
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationEnterForeground) name:UIApplicationDidBecomeActiveNotification object:nil];
}
return self;
}
- (void)applicationEnterForeground{
NSLog(@"进入前台.....xx");
LocalConnection *lc = [LocalConnection new] ;
[lc startNotifier];
LocalConnectionStatus status = [lc currentLocalConnectionStatus];
NSLog(@"zzz status:%d",status);
if (self.alertVC == nil && status == LC_UnReachable) {//
[self noLocalNetwork:self.window];
}
else if (self.hadShowAlertVC && ( status == LC_WWAN || status == LC_WiFi)) {//
self.hadShowAlertVC = NO;
[self hasLocalNetwork:self.window];
}
}
//idfaatt //idfaatt
- (void)checkATT{ - (void)checkATT{
self.attTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(startCheckAtt) userInfo:nil repeats:YES]; self.attTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(startCheckAtt) userInfo:nil repeats:YES];
@ -79,8 +136,10 @@
#warning GoogleService-Info.plistappfirebase #warning GoogleService-Info.plistappfirebase
- (void)configureADByFirebaseWith:(UIWindow *)window { - (void)configureADByFirebaseWith:(UIWindow *)window {
[FIRApp configure]; [FIRApp configure];
self.window = window;
UIViewController *vc = [UIViewController new]; UIViewController *vc = [UIViewController new];
vc.view.backgroundColor = [UIColor colorWithRed:30.0/255.0 green:144.0/255.0 blue:255.0/255.0 alpha:1]; vc.view.backgroundColor = [UIColor colorWithRed:197.0/255.0 green:197.0/255.0 blue:197.0/255.0 alpha:1];
UIImageView *bgImgView = [UIImageView new]; UIImageView *bgImgView = [UIImageView new];
[vc.view addSubview:bgImgView]; [vc.view addSubview:bgImgView];
bgImgView.image = [UIImage imageNamed:@"logo"]; bgImgView.image = [UIImage imageNamed:@"logo"];
@ -88,9 +147,60 @@
bgImgView.layer.masksToBounds = YES; bgImgView.layer.masksToBounds = YES;
bgImgView.layer.cornerRadius = 40; bgImgView.layer.cornerRadius = 40;
bgImgView.contentMode = UIViewContentModeScaleAspectFit; bgImgView.contentMode = UIViewContentModeScaleAspectFit;
window.rootViewController = vc; window.rootViewController = vc;
[window makeKeyAndVisible]; [window makeKeyAndVisible];
if ([[LuxADManager shareInstance] isADSSMode] ) {//BAD ,B,
[self configureADWith:window];
[self reFirebaseFetchAndActivate];
}
else {
//
LocalConnection *lc = [LocalConnection new] ;
[lc startNotifier];
LocalConnectionStatus status = [lc currentLocalConnectionStatus];
if (status == LC_UnReachable) {//
[self noLocalNetwork:window];
}
else {
[self hasLocalNetwork:window];
}
}
}
//
- (void)noLocalNetwork:(UIWindow *)window {
self.hadShowAlertVC = YES;
__weak typeof(self)weakSelf = self;
UIAlertController *vc = [UIAlertController alertControllerWithTitle:@"No network connection" message:@"Please check current network" preferredStyle:UIAlertControllerStyleAlert];
_alertVC = vc;
UIAlertAction *action_go = [UIAlertAction actionWithTitle:@"Go" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSURL * url = [[NSURL alloc] initWithString:UIApplicationOpenSettingsURLString];
if( [[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url options:nil completionHandler:nil];
}
weakSelf.alertVC = nil;
}];
[vc addAction:action_go];
[window.rootViewController presentViewController:vc animated:YES completion:nil];
}
//
- (void)hasLocalNetwork:(UIWindow *)window {
__weak typeof(self)weakSelf = self;
if (_alertVC) {
[_alertVC dismissViewControllerAnimated:NO completion:^{
weakSelf.alertVC = nil;
}];
}
//A,
if (![LuxADManager shareInstance].isADSSMode) { if (![LuxADManager shareInstance].isADSSMode) {
BOOL luxADManager_isNotFirstOpen = [[NSUserDefaults standardUserDefaults] boolForKey:@"luxADManager_isNotFirstOpen"]; BOOL luxADManager_isNotFirstOpen = [[NSUserDefaults standardUserDefaults] boolForKey:@"luxADManager_isNotFirstOpen"];
if (!luxADManager_isNotFirstOpen) { if (!luxADManager_isNotFirstOpen) {
@ -98,56 +208,42 @@
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"luxADManager_isNotFirstOpen"]; [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"luxADManager_isNotFirstOpen"];
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
} }
} }
[self cycleConfigureADByFirebaseWith:window]; [self cycleConfigureADByFirebaseWith:window];
} }
- (void)cycleConfigureADByFirebaseWith:(UIWindow *)window { - (void)cycleConfigureADByFirebaseWith:(UIWindow *)window {
if ([[LuxADManager shareInstance] isADSSMode] ) { //firebase
[self configureADWith:window]; [self configureADWith:window];
}
else {//firebase
//isOpen,,configure,firebase
BOOL old_isadopen = [[NSUserDefaults standardUserDefaults] boolForKey:@"lux_cycleConfigure_isadopen_key"];
if (old_isadopen) {
[self configureADWith:window];
}
[self reFirebaseFetchAndActivate];
}
__weak typeof(self)weakSelf = self; - (void)reFirebaseFetchAndActivate{
FIRRemoteConfig *rc = [FIRRemoteConfig remoteConfig]; FIRRemoteConfig *rc = [FIRRemoteConfig remoteConfig];
FIRRemoteConfigSettings *rcs = [FIRRemoteConfigSettings new]; FIRRemoteConfigSettings *rcs = [FIRRemoteConfigSettings new];
rcs.minimumFetchInterval = 0; rcs.minimumFetchInterval = 1;
rcs.fetchTimeout = 6; rcs.fetchTimeout = 6;
rc.configSettings = rcs; rc.configSettings = rcs;
__weak typeof(self)weakSelf = self;
[rc fetchAndActivateWithCompletionHandler:^(FIRRemoteConfigFetchAndActivateStatus status, NSError * _Nullable error) { [rc fetchAndActivateWithCompletionHandler:^(FIRRemoteConfigFetchAndActivateStatus status, NSError * _Nullable error) {
NSLog(@"......");
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
if (status == FIRRemoteConfigFetchAndActivateStatusSuccessFetchedFromRemote) { if (status == FIRRemoteConfigFetchAndActivateStatusSuccessFetchedFromRemote) {
[weakSelf setFiebaseDataToLocal:rc];
weakSelf.fireBase_AlreadyGetDdata = YES;
}
});
}];
}
NSString *localVer = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleShortVersionString"]; //firebase
- (void)setFiebaseDataToLocal:(FIRRemoteConfig *)rc {
NSDictionary *value = [[rc configValueForKey:@"isopen"] JSONValue]; NSDictionary *value = [[rc configValueForKey:@"isopen"] JSONValue];
BOOL isadopen = [value[@"isadopen"] boolValue];
NSString *version = value[@"version"];
if (!isadopen || ( version && [version isEqualToString:localVer])) {//ad
if (!old_isadopen) {
[weakSelf configureRootVCWith:window];
}
}
else {
if (!old_isadopen) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"lux_cycleConfigure_isadopen_key"];
[[NSUserDefaults standardUserDefaults] synchronize];
[weakSelf configureADWith:window];
}
}
//blocalurl //blocalurl
NSString *localUrl = value[@"adbrush_base_url"]; NSString *localUrl = value[@"adbrush_base_url"];
@ -162,25 +258,125 @@
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
} }
} //ad
else { NSString *localVer = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleShortVersionString"];
if (!old_isadopen) { BOOL isadopen = [value[@"isadopen"] boolValue];//0,ad,1,version,ad,;
[weakSelf configureRootVCWith:window]; NSString *version = value[@"version"];
} if (!(!isadopen || ( version && [version isEqualToString:localVer]))) {//ad
NSLog(@"firebase 获取到展示广告配置....");
} [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"kLux_local_CanShowADKey"];
}); [[NSUserDefaults standardUserDefaults] synchronize];
}];
} }
} }
#pragma mark ------- UI
//openad,,timer. ,timer;,
- (void)checkOpenADReadyState{
static CGFloat totalTimeC = 0.0;
totalTimeC += kOpenADPerSec;
if ([self canShowAD]) {//,fireBase_AlreadyGetDdata
if ( [[LuxADManager openAd].adItem isReady] ){//ad
[_openADTimer invalidate];
_openADTimer = nil;
[[LuxADManager openAd].adItem showAd];
}
else {
NSLog(@"本身已经允许展示,但是ad还未准备好....");
if (totalTimeC > kOpenAdCTimeLength) {//
[self configureRootVCWith:self.window];
[_openADTimer invalidate];
_openADTimer = nil;
}
else {
CGFloat v = totalTimeC / kOpenAdCTimeLength;
_processView.progress = v;
}
}
}
else {
if (self.fireBase_AlreadyGetDdata) {//
if ([self canShowAD]) {//
if ( [[LuxADManager openAd].adItem isReady] ){//ad
[_openADTimer invalidate];
_openADTimer = nil;
[[LuxADManager openAd].adItem showAd];
}
else {
if (totalTimeC > kOpenAdCTimeLength) {//
[self configureRootVCWith:self.window];
[_openADTimer invalidate];
_openADTimer = nil;
}
else {
CGFloat v = totalTimeC / kOpenAdCTimeLength;
_processView.progress = v;
}
}
}
else {//,
NSLog(@"timer 不允许展示,则直接进入首页");
[_openADTimer invalidate];
_openADTimer = nil;
[self configureRootVCWith:self.window];
}
}
else {
if (totalTimeC > kOpenAdCTimeLength) {//
[self configureRootVCWith:self.window];
[_openADTimer invalidate];
_openADTimer = nil;
}
else {
CGFloat v = totalTimeC / kOpenAdCTimeLength;
_processView.progress = v;
}
}
}
}
//广,
- ( void)confiugreLanuchBgView:(UIWindow *)window bgImgName:(NSString *)bgImgName bgColor:(UIColor *)bgColor{
UIViewController *vc = [UIViewController new];
window.rootViewController = vc;
UIImageView *imgView = [UIImageView new];
imgView.frame = CGRectMake((window.frame.size.width - 80) * 0.5, (window.frame.size.height - 80) * 0.5,80,80);
imgView.layer.masksToBounds = YES;
imgView.layer.cornerRadius = 40;
[window addSubview:imgView];
imgView.image = [UIImage imageNamed:bgImgName];
imgView.contentMode = UIViewContentModeScaleAspectFit;
if (bgColor) {
imgView.backgroundColor = bgColor;
}
else {
imgView.backgroundColor = [UIColor colorWithRed:197.0/255.0 green:197.0/255.0 blue:197.0/255.0 alpha:1];
}
_processView = [UIProgressView new];
_processView.frame = CGRectMake(80-1,window.frame.size.height - 60-1,window.frame.size.width - 160-1,20-1);
_processView.tintColor = [UIColor systemPinkColor];
[vc.view addSubview:_processView];
[vc.view addSubview:imgView];
vc.view.backgroundColor = imgView.backgroundColor;
}
#pragma mark -----AD #pragma mark -----AD
#warning idkeymax ; ,actionBlock广 #warning idkeymax ; ,actionBlock广
- (void)configureADWith:(UIWindow *)window { - (void)configureADWith:(UIWindow *)window {
if ([[[LuxADManager shareInstance] allInterstitialAds] count] > 0) {//ad(,configureADWith),
return;
}
[[LuxADManager shareInstance] addADWithInterstitialId:@"bee9f7039e56cc7a" actionBlock:^(UIViewController * _Nonnull vc) { [[LuxADManager shareInstance] addADWithInterstitialId:@"bee9f7039e56cc7a" actionBlock:^(UIViewController * _Nonnull vc) {
}];// }];//
@ -191,29 +387,40 @@
[vc.navigationController pushViewController:subvc animated:NO]; [vc.navigationController pushViewController:subvc animated:NO];
}]; }];
[[LuxADManager shareInstance] addADWithInterstitialId:@"bee9f7039e56cc7a" actionBlock:^(UIViewController * _Nonnull vc) { [[LuxADManager shareInstance] addADWithInterstitialId:@"7baed02646413e44" actionBlock:^(UIViewController * _Nonnull vc) {
twoVC *subvc = [twoVC new]; twoVC *subvc = [twoVC new];
subvc.adIndex = 2; subvc.adIndex = 2;
[vc.navigationController pushViewController:subvc animated:NO]; [vc.navigationController pushViewController:subvc animated:NO];
}]; }];
[[LuxADManager shareInstance] addADWithInterstitialId:@"7baed02646413e44" actionBlock:^(UIViewController * _Nonnull vc) { [[LuxADManager shareInstance] addADWithInterstitialId:@"bee9f7039e56cc7a" actionBlock:^(UIViewController * _Nonnull vc) {
threeVC *subvc = [threeVC new]; threeVC *subvc = [threeVC new];
subvc.adIndex = 3; subvc.adIndex = 3;
[vc.navigationController pushViewController:subvc animated:NO]; [vc.navigationController pushViewController:subvc animated:NO];
}]; }];
[[LuxADManager shareInstance] configureADWithAppLovinSDKKey:@"NLQHJDx4rcfd5IqhZf9nad2tIqFSH8SSKP3DXD18sTKUvV6tBfrH9_RPCGb6hvEn3NPXJDmUQCnvnKgHIT7Qn4"]; [[LuxADManager shareInstance] configureADWithAppLovinSDKKey:@"NLQHJDx4rcfd5IqhZf9nad2tIqFSH8SSKP3DXD18sTKUvV6tBfrH9_RPCGb6hvEn3NPXJDmUQCnvnKgHIT7Qn4"];
__weak typeof(self)weakSelf = self; __weak typeof(self)weakSelf = self;
if (![LuxADManager shareInstance].isADSSMode) {//A,ad
if (_openADTimer != nil) {
[_openADTimer invalidate];
_openADTimer = nil;
}
_openADTimer = [NSTimer scheduledTimerWithTimeInterval:kOpenADPerSec target:self selector:@selector(checkOpenADReadyState) userInfo:nil repeats:YES];
[self confiugreLanuchBgView:window bgImgName:@"logo" bgColor:nil];
if (![LuxADManager shareInstance].isADSSMode){
[FIRAnalytics logEventWithName:@"loading_page" parameters:nil];
}
[[LuxADManager shareInstance] showFirstOpenAD:^(NSInteger actionType) { [[LuxADManager shareInstance] showFirstOpenAD:^(NSInteger actionType) {
[weakSelf configureRootVCWith:window]; [weakSelf configureRootVCWith:window];
} window:window bgImgName:@"logo" bgColor:nil]; } window:nil bgImgName:nil bgColor:nil];
}
} }
#pragma mark -------AVC
- (void)configureRootVCWith:(UIWindow *)window { - (void)configureRootVCWith:(UIWindow *)window {
NSString *hasLaunchedBeforeKey = @"hasLaunchedBefore"; NSString *hasLaunchedBeforeKey = @"hasLaunchedBefore";
@ -228,12 +435,20 @@
AV_WaterHomeVC *vc = [[AV_WaterHomeVC alloc] init]; AV_WaterHomeVC *vc = [[AV_WaterHomeVC alloc] init];
window.rootViewController = [[AV_NAVVC alloc] initWithRootViewController:vc]; window.rootViewController = [[AV_NAVVC alloc] initWithRootViewController:vc];
if ([userDefaults boolForKey:hasLaunchedBeforeKey]){
[userDefaults setValue:@(2000) forKey:@"waterml"];
[userDefaults setBool:NO forKey:@"isadclose"];
}else{
}
} else { } else {
// //
AV_SelectGenderVC *vc = [[AV_SelectGenderVC alloc] init]; AV_SelectGenderVC *vc = [[AV_SelectGenderVC alloc] init];
window.rootViewController = [[AV_NAVVC alloc] initWithRootViewController:vc]; window.rootViewController = [[AV_NAVVC alloc] initWithRootViewController:vc];
[userDefaults setBool:YES forKey:hasLaunchedBeforeKey]; [userDefaults setBool:YES forKey:hasLaunchedBeforeKey];
[userDefaults setBool:YES forKey:@"isadclose"];
NSDate *currentDate = [NSDate date]; NSDate *currentDate = [NSDate date];
[userDefaults setObject:currentDate forKey:@"savedDate"]; [userDefaults setObject:currentDate forKey:@"savedDate"];
@ -241,3 +456,4 @@
} }
@end @end

View File

@ -49,6 +49,9 @@ typedef void (^LuxADManagerActionBlock)(UIViewController *vc);//用于补量模
//用于在启动app时,即第一次在appDidFinishLanuch调用开屏广告 //用于在启动app时,即第一次在appDidFinishLanuch调用开屏广告
- (void)showFirstOpenAD:(LuxADManagerCallback)callback window:(UIWindow *)window bgImgName:(NSString *)bgImgName bgColor:(UIColor *)bgColor; - (void)showFirstOpenAD:(LuxADManagerCallback)callback window:(UIWindow *)window bgImgName:(NSString *)bgImgName bgColor:(UIColor *)bgColor;
//获取开屏广告的ad
+ (LuxADManagerInterstitialItem *)openAd ;
//用于在app进行前后台切换时调用 //用于在app进行前后台切换时调用
- (void)showOpenAD; - (void)showOpenAD;

View File

@ -8,9 +8,10 @@
#import "LuxADManager.h" #import "LuxADManager.h"
#import "LuxNetManager.h" #import "LuxNetManager.h"
#import "LuxADSSModeVC.h" #import "LuxADSSModeVC.h"
//#import "AppDelegate.h"
#import <FirebaseAnalytics/FirebaseAnalytics.h> #import <FirebaseAnalytics/FirebaseAnalytics.h>
#define kOpenAdCTimeLength 10.0//广 #import <FirebaseRemoteConfig/FirebaseRemoteConfig.h>
#define kOpenADPerSec 0.05
#define kADShowTimePer 20.0 //广 #define kADShowTimePer 20.0 //广
@ -63,8 +64,7 @@
@property (nonatomic,strong) NSMutableArray <LuxADManagerInterstitialItem *>*adItemsArr; @property (nonatomic,strong) NSMutableArray <LuxADManagerInterstitialItem *>*adItemsArr;
@property (nonatomic,copy) LuxADManagerCallback callback; @property (nonatomic,copy) LuxADManagerCallback callback;
@property (nonatomic,strong) NSTimer *openADTimer; //timer
@property (nonatomic,strong) UIProgressView *processView; //
@end @end
@ -118,7 +118,7 @@
else { else {
[[LuxADManager shareInstance] initOpenAD]; [[LuxADManager shareInstance] initOpenAD];
//ad, //ad,
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(8 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[LuxADManager shareInstance] initOtherInitIntersitialAD]; [[LuxADManager shareInstance] initOtherInitIntersitialAD];
}); });
} }
@ -185,6 +185,10 @@
[FIRAnalytics logEventWithName:[NSString stringWithFormat:@"ad_load_%@_online",[self openAd].adItem.adUnitIdentifier] parameters:nil]; [FIRAnalytics logEventWithName:[NSString stringWithFormat:@"ad_load_%@_online",[self openAd].adItem.adUnitIdentifier] parameters:nil];
} }
+ (LuxADManagerInterstitialItem *)openAd {
return [[LuxADManager shareInstance] openAd];
}
- (LuxADManagerInterstitialItem *)openAd { - (LuxADManagerInterstitialItem *)openAd {
return _adItemsArr.firstObject; return _adItemsArr.firstObject;
} }
@ -209,29 +213,28 @@
#pragma mark ----- 广 #pragma mark ----- 广
//app,appDidFinishLanuch广 //app,appDidFinishLanuch广
- (void)showFirstOpenAD:(LuxADManagerCallback)callback window:(UIWindow *)window bgImgName:(NSString *)bgImgName bgColor:(UIColor *)bgColor{ - (void)showFirstOpenAD:(LuxADManagerCallback)callback window:(UIWindow *)window bgImgName:(NSString *)bgImgName bgColor:(UIColor *)bgColor{
if ([self isADSSMode]) {//,, // if ([self isADSSMode]) {//,,
return; // return;
} // }
//
self.callback = callback; self.callback = callback;
if ( ![[ALSdk shared] isInitialized] ){ // if ( ![[ALSdk shared] isInitialized] ){
_openADTimer = [NSTimer scheduledTimerWithTimeInterval:kOpenADPerSec target:self selector:@selector(checkOpenADReadyState) userInfo:nil repeats:YES]; // _openADTimer = [NSTimer scheduledTimerWithTimeInterval:kOpenADPerSec target:self selector:@selector(checkOpenADReadyState) userInfo:nil repeats:YES];
[self confiugreLanuchBgView:window bgImgName:bgImgName bgColor:bgColor]; // [self confiugreLanuchBgView:window bgImgName:bgImgName bgColor:bgColor];
return; // return;
} // }
//
if ( [[self openAd].adItem isReady] ){ // if ( [[self openAd].adItem isReady] ){
//
[[self openAd].adItem showAd]; // [[self openAd].adItem showAd];
} // }
else{ // else{
_openADTimer = [NSTimer scheduledTimerWithTimeInterval:kOpenADPerSec target:self selector:@selector(checkOpenADReadyState) userInfo:nil repeats:YES]; // _openADTimer = [NSTimer scheduledTimerWithTimeInterval:kOpenADPerSec target:self selector:@selector(checkOpenADReadyState) userInfo:nil repeats:YES];
[self confiugreLanuchBgView:window bgImgName:bgImgName bgColor:bgColor]; // [self confiugreLanuchBgView:window bgImgName:bgImgName bgColor:bgColor];
[[self openAd].adItem loadAd]; // if (![self isADSSMode]) {
if (![self isADSSMode]) { // [FIRAnalytics logEventWithName:[NSString stringWithFormat:@"ad_load_%@_online",[self openAd].adItem.adUnitIdentifier] parameters:nil];
[FIRAnalytics logEventWithName:[NSString stringWithFormat:@"ad_load_%@_online",[self openAd].adItem.adUnitIdentifier] parameters:nil]; // }
} // }
}
} }
//app //app
@ -244,72 +247,33 @@
return; return;
} }
if (![self canShowAD]) {
return;
}
if ( ![[ALSdk shared] isInitialized] ){ if ( ![[ALSdk shared] isInitialized] ){
return; return;
} }
if ( [[self openAd].adItem isReady] ){ if ( [[self openAd].adItem isReady] ){
[[self openAd].adItem showAd]; [[self openAd].adItem showAd];
NSLog(@"ssss showad...");
} }
else{ else{
[[self openAd].adItem loadAd]; [[self openAd].adItem loadAd];
NSLog(@"ddd showad...");
} }
} }
//openad,,timer. ,timer;, //A广,B
- (void)checkOpenADReadyState{ - (BOOL)canShowAD {
static CGFloat totalTimeC = 0.0; //nil,ad
totalTimeC += kOpenADPerSec; BOOL local_CanShowAD = [[NSUserDefaults standardUserDefaults] boolForKey:@"kLux_local_CanShowADKey"];
NSLog(@"local_CanShowAD:%d",local_CanShowAD);
if ( [[self openAd].adItem isReady] ){ return local_CanShowAD;
[_openADTimer invalidate];
_openADTimer = nil;
[[self openAd].adItem showAd];
}
else {
if (totalTimeC > kOpenAdCTimeLength) {//
if(self.callback) {
self.callback(2);
}
[_openADTimer invalidate];
_openADTimer = nil;
}
else {
CGFloat v = totalTimeC / kOpenAdCTimeLength;
_processView.progress = v;
}
}
} }
//广,
- ( void)confiugreLanuchBgView:(UIWindow *)window bgImgName:(NSString *)bgImgName bgColor:(UIColor *)bgColor{
UIViewController *vc = [UIViewController new];
window.rootViewController = vc;
UIImageView *imgView = [UIImageView new];
imgView.frame = CGRectMake((window.frame.size.width - 80) * 0.5, (window.frame.size.height - 80) * 0.5,80,80);
imgView.layer.masksToBounds = YES;
imgView.layer.cornerRadius = 40;
[window addSubview:imgView];
imgView.image = [UIImage imageNamed:bgImgName];
imgView.contentMode = UIViewContentModeScaleAspectFit;
if (bgColor) {
imgView.backgroundColor = bgColor;
}
else {
imgView.backgroundColor = [UIColor colorWithRed:197.0/255.0 green:197.0/255.0 blue:197.0/255.0 alpha:1];
}
_processView = [UIProgressView new];
_processView.frame = CGRectMake(80-1,window.frame.size.height - 60-1,window.frame.size.width - 160-1,20-1);
_processView.tintColor = [UIColor systemPinkColor];
[vc.view addSubview:_processView];
[vc.view addSubview:imgView];
vc.view.backgroundColor = imgView.backgroundColor;
}
#pragma mark -----广 #pragma mark -----广
//_adItemsArrindexad //_adItemsArrindexad
- (void)showADWithIndex:(NSInteger)index callback:(LuxADManagerCallback)callback { - (void)showADWithIndex:(NSInteger)index callback:(LuxADManagerCallback)callback {
@ -337,6 +301,16 @@
//_adItemsArrad //_adItemsArrad
- (void)showADByRandomModeWithCallback:(LuxADManagerCallback)callback { - (void)showADByRandomModeWithCallback:(LuxADManagerCallback)callback {
self.callback = callback; self.callback = callback;
//isOpen,,configure,firebase
NSString *localVer = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleShortVersionString"];
BOOL old_isadopen = [[NSUserDefaults standardUserDefaults] boolForKey:@"kLux_local_CanShowADKey"];
FIRRemoteConfig *rc = [FIRRemoteConfig remoteConfig];
NSDictionary *value = [[rc configValueForKey:@"isopen"] JSONValue];
BOOL isadopen = [value[@"isadopen"] boolValue];//0,ad,1,version,ad,;
NSString *version = value[@"version"];
if (_adItemsArr.count && ![self isADSSMode]) { if (_adItemsArr.count && ![self isADSSMode]) {
int rv = arc4random() % _adItemsArr.count; int rv = arc4random() % _adItemsArr.count;
LuxADManagerInterstitialItem *item = _adItemsArr[rv]; LuxADManagerInterstitialItem *item = _adItemsArr[rv];
@ -344,10 +318,16 @@
if (![self canShowAD:item.lastShowADDate] || ![item.adItem isReady]) { //30, if (![self canShowAD:item.lastShowADDate] || ![item.adItem isReady]) { //30,
self.callback(2); self.callback(2);
} }
else { // else {
if (old_isadopen || !(!isadopen || ( version && [version isEqualToString:localVer]))) {//
[item.adItem showAd]; [item.adItem showAd];
[FIRAnalytics logEventWithName:[NSString stringWithFormat:@"ad_show_%@_online",item.adItem.adUnitIdentifier] parameters:nil]; [FIRAnalytics logEventWithName:[NSString stringWithFormat:@"ad_show_%@_online",item.adItem.adUnitIdentifier] parameters:nil];
} }
else {//
self.callback(2);
}
}
} }
else { else {
callback(2); callback(2);
@ -449,6 +429,10 @@
if (![self isADSSMode]) { if (![self isADSSMode]) {
[FIRAnalytics logEventWithName:[NSString stringWithFormat:@"ad_load_%@_online_success",ad.adUnitIdentifier] parameters:nil]; [FIRAnalytics logEventWithName:[NSString stringWithFormat:@"ad_load_%@_online_success",ad.adUnitIdentifier] parameters:nil];
} }
// static int countss = 0;
// countss++;
// NSLog(@"didLoadAd countss:%d",countss);
} }
- (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error { - (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error {
@ -483,6 +467,7 @@
item.lastShowADDate = [NSDate date]; item.lastShowADDate = [NSDate date];
if (![self isADSSMode]) { if (![self isADSSMode]) {
[FIRAnalytics logEventWithName:[NSString stringWithFormat:@"ad_show_%@_online",ad.adUnitIdentifier] parameters:nil]; [FIRAnalytics logEventWithName:[NSString stringWithFormat:@"ad_show_%@_online",ad.adUnitIdentifier] parameters:nil];
[FIRAnalytics logEventWithName:@"ads_show" parameters:nil];
} }
//back广 //back广