Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckFarm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmj
LuckFarm
Commits
60fcc8e8
Commit
60fcc8e8
authored
Nov 12, 2020
by
zhangshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理bug
parent
6b2f4d0c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
231 additions
and
80 deletions
+231
-80
GYPrefixHeader.pch
GYDemo/GYDemo/GYPrefixHeader.pch
+1
-1
AddCSJADManager.m
GYDemo/GYDemo/SCAds/AddCSJADManager.m
+24
-19
AddGDTADManager.m
GYDemo/GYDemo/SCAds/AddGDTADManager.m
+11
-3
AddRuiShiADManager.m
GYDemo/GYDemo/SCAds/AddRuiShiADManager.m
+9
-3
AddSigmobADManager.m
GYDemo/GYDemo/SCAds/AddSigmobADManager.m
+42
-1
GYAdsTrackModel.h
GYDemo/GYDemo/SCAds/GYAdsTrackModel.h
+15
-7
IOSADManager.h
GYDemo/GYDemo/SCAds/IOSADManager.h
+10
-1
IOSADManager.m
GYDemo/GYDemo/SCAds/IOSADManager.m
+111
-37
project.pbxproj
UnityiOSFarm/Unity-iPhone.xcodeproj/project.pbxproj
+8
-8
No files found.
GYDemo/GYDemo/GYPrefixHeader.pch
View file @
60fcc8e8
...
...
@@ -81,7 +81,7 @@
#import "MBProgressHUD+MJ.h"
#import "Masonry.h"
#import "GYBaseModel.h"
#import <MJExtension/MJExtension.h>
#import <UMCommon/MobClick.h>
#import "IOSADManager.h" //AD
...
...
GYDemo/GYDemo/SCAds/AddCSJADManager.m
View file @
60fcc8e8
...
...
@@ -13,7 +13,7 @@
@interface
AddCSJADManager
()
@property
(
nonatomic
,
retain
)
GYAdsTrackModel
*
c
sjLoad
Data
;
@property
(
nonatomic
,
retain
)
GYAdsTrackModel
*
c
urrent
Data
;
@property
(
nonatomic
,
copy
)
NSString
*
clk_tracking
;
//防止多次上报点击
...
...
@@ -24,7 +24,7 @@
-
(
void
)
loadAdWithData
:(
GYAdsTrackModel
*
)
loadADModel
withADType
:(
eADType
)
AdType
{
self
.
c
sjLoad
Data
=
loadADModel
;
self
.
c
urrent
Data
=
loadADModel
;
WEAKSELF
;
GYAdsTrackModel
*
model
=
loadADModel
;
if
(
AdType
==
ADType_OpenScreen
)
{
// 开屏
...
...
@@ -92,7 +92,9 @@
This method is called when splash ad material loaded successfully.
*/
-
(
void
)
splashAdDidLoad
:
(
BUSplashAdView
*
)
splashAd
;{
self
.
loadSuccessCallbackBlock
(
self
.
csjLoadData
,
YES
);
self
.
loadSuccessCallbackBlock
(
self
.
currentData
,
YES
);
WEAKSELF
;
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
UIWindow
*
keyWindow
=
[
UIApplication
sharedApplication
].
windows
.
lastObject
;
...
...
@@ -107,7 +109,7 @@
@param error : the reason of error
*/
-
(
void
)
splashAd
:
(
BUSplashAdView
*
)
splashAd
didFailWithError
:
(
NSError
*
_Nullable
)
error
;{
self
.
loadSuccessCallbackBlock
(
self
.
c
sjLoad
Data
,
NO
);
self
.
loadSuccessCallbackBlock
(
self
.
c
urrent
Data
,
NO
);
}
...
...
@@ -116,10 +118,10 @@
*/
-
(
void
)
splashAdWillVisible
:
(
BUSplashAdView
*
)
splashAd
;{
self
.
showSuccessCallbackBlock
(
self
.
c
sjLoad
Data
,
YES
);
self
.
showSuccessCallbackBlock
(
self
.
c
urrent
Data
,
YES
);
// [[CGUserManager shared] addLocCollection:@"splash_display" value:@"splash_display_success"];
// NSString * clkTracking = self.c
sjLoad
Data.imp_tracking[0];
// NSString * clkTracking = self.c
urrent
Data.imp_tracking[0];
// if (clkTracking.length > 0) {
// [[CGNetworkTools shared] pureGetWithAdsTrackingAction:clkTracking success:^(id _Nonnull response) {
//
...
...
@@ -134,7 +136,9 @@
*/
-
(
void
)
splashAdDidClick
:
(
BUSplashAdView
*
)
splashAd
;{
// NSString * clkTracking = self.csjLoadData.clk_tracking[0];
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
// NSString * clkTracking = self.currentData.clk_tracking[0];
// if ([self.clk_tracking isEqualToString:clkTracking]) {
// return;
...
...
@@ -194,7 +198,7 @@
*/
-
(
void
)
nativeExpressRewardedVideoAdDidLoad
:
(
BUNativeExpressRewardedVideoAd
*
)
rewardedVideoAd
;{
self
.
loadSuccessCallbackBlock
(
self
.
c
sjLoad
Data
,
YES
);
self
.
loadSuccessCallbackBlock
(
self
.
c
urrent
Data
,
YES
);
}
...
...
@@ -203,7 +207,7 @@
@param error : the reason of error
*/
-
(
void
)
nativeExpressRewardedVideoAd
:
(
BUNativeExpressRewardedVideoAd
*
)
rewardedVideoAd
didFailWithError
:
(
NSError
*
_Nullable
)
error
;{
self
.
loadSuccessCallbackBlock
(
self
.
c
sjLoad
Data
,
NO
);
self
.
loadSuccessCallbackBlock
(
self
.
c
urrent
Data
,
NO
);
self
.
splashAd_CSJ
.
hidden
=
YES
;
[
self
.
splashAd_CSJ
removeFromSuperview
];
...
...
@@ -265,14 +269,14 @@
This method is called when video ad is closed.
*/
-
(
void
)
nativeExpressRewardedVideoAdDidClose
:
(
BUNativeExpressRewardedVideoAd
*
)
rewardedVideoAd
;{
self
.
showSuccessCallbackBlock
(
self
.
c
sjLoad
Data
,
YES
);
self
.
showSuccessCallbackBlock
(
self
.
c
urrent
Data
,
YES
);
}
/**
This method is called when video ad is clicked.
This method is called when video ad is clicked.
点击
*/
-
(
void
)
nativeExpressRewardedVideoAdDidClick
:
(
BUNativeExpressRewardedVideoAd
*
)
rewardedVideoAd
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
}
/**
...
...
@@ -296,7 +300,7 @@
@param verify :return YES when return value is 2000.
*/
-
(
void
)
nativeExpressRewardedVideoAdServerRewardDidSucceed
:
(
BUNativeExpressRewardedVideoAd
*
)
rewardedVideoAd
verify
:
(
BOOL
)
verify
;{
// self.showSuccessCallbackBlock(self.c
sjLoad
Data, YES);
// self.showSuccessCallbackBlock(self.c
urrent
Data, YES);
}
...
...
@@ -307,7 +311,7 @@
@param error request error info
*/
-
(
void
)
nativeExpressRewardedVideoAdServerRewardDidFail
:
(
BUNativeExpressRewardedVideoAd
*
)
rewardedVideoAd
error
:
(
NSError
*
_Nullable
)
error
;{
self
.
showSuccessCallbackBlock
(
self
.
c
sjLoad
Data
,
NO
);
self
.
showSuccessCallbackBlock
(
self
.
c
urrent
Data
,
NO
);
}
...
...
@@ -324,7 +328,7 @@
* Sent when views successfully load ad
*/
-
(
void
)
nativeExpressAdSuccessToLoad
:
(
BUNativeExpressAdManager
*
)
nativeExpressAd
views
:
(
NSArray
<
__kindof
BUNativeExpressAdView
*>
*
)
views
;{
self
.
loadSuccessCallbackBlock
(
self
.
c
sjLoad
Data
,
YES
);
self
.
loadSuccessCallbackBlock
(
self
.
c
urrent
Data
,
YES
);
if
([
nativeExpressAd
isMemberOfClass
:[
BUNativeExpressAdManager
class
]])
{
if
(
views
.
count
)
{
...
...
@@ -341,7 +345,7 @@
* Sent when views fail to load ad
*/
-
(
void
)
nativeExpressAdFailToLoad
:
(
BUNativeExpressAdManager
*
)
nativeExpressAd
error
:
(
NSError
*
_Nullable
)
error
;{
self
.
loadSuccessCallbackBlock
(
self
.
c
sjLoad
Data
,
NO
);
self
.
loadSuccessCallbackBlock
(
self
.
c
urrent
Data
,
NO
);
}
...
...
@@ -349,14 +353,14 @@
* This method is called when rendering a nativeExpressAdView successed, and nativeExpressAdView.size.height has been updated
*/
-
(
void
)
nativeExpressAdViewRenderSuccess
:
(
BUNativeExpressAdView
*
)
nativeExpressAdView
;{
self
.
showSuccessCallbackBlock
(
self
.
c
sjLoad
Data
,
YES
);
self
.
showSuccessCallbackBlock
(
self
.
c
urrent
Data
,
YES
);
}
/**
* This method is called when a nativeExpressAdView failed to render
*/
-
(
void
)
nativeExpressAdViewRenderFail
:
(
BUNativeExpressAdView
*
)
nativeExpressAdView
error
:
(
NSError
*
_Nullable
)
error
;{
self
.
showSuccessCallbackBlock
(
self
.
c
sjLoad
Data
,
NO
);
self
.
showSuccessCallbackBlock
(
self
.
c
urrent
Data
,
NO
);
}
/**
...
...
@@ -370,6 +374,7 @@
* Sent when an ad view is clicked
*/
-
(
void
)
nativeExpressAdViewDidClick
:
(
BUNativeExpressAdView
*
)
nativeExpressAdView
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
}
...
...
GYDemo/GYDemo/SCAds/AddGDTADManager.m
View file @
60fcc8e8
...
...
@@ -85,6 +85,7 @@
* 开屏广告成功展示
*/
-
(
void
)
splashAdSuccessPresentScreen
:
(
GDTSplashAd
*
)
splashAd
;{
}
...
...
@@ -127,7 +128,10 @@
/**
* 开屏广告点击回调
*/
-
(
void
)
splashAdClicked
:
(
GDTSplashAd
*
)
splashAd
;{}
-
(
void
)
splashAdClicked
:
(
GDTSplashAd
*
)
splashAd
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
}
/**
* 开屏广告将要关闭回调
...
...
@@ -230,6 +234,7 @@
@param rewardedVideoAd GDTRewardVideoAd 实例
*/
-
(
void
)
gdt_rewardVideoAdDidClicked
:
(
GDTRewardVideoAd
*
)
rewardedVideoAd
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
}
...
...
@@ -335,7 +340,10 @@
/**
* 原生模板广告点击回调
*/
-
(
void
)
nativeExpressAdViewClicked
:
(
GDTNativeExpressAdView
*
)
nativeExpressAdView
;{}
-
(
void
)
nativeExpressAdViewClicked
:
(
GDTNativeExpressAdView
*
)
nativeExpressAdView
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
}
/**
* 原生模板广告被关闭
...
...
GYDemo/GYDemo/SCAds/AddRuiShiADManager.m
View file @
60fcc8e8
...
...
@@ -107,6 +107,7 @@
开屏广告点击回调
*/
-
(
void
)
vl_splashAdDidClick
:
(
VLNSplashAd
*
)
splashAd
{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
}
...
...
@@ -159,7 +160,10 @@
/**
视频广告信息点击回调
*/
-
(
void
)
vl_rewardVideoAdDidClicked
:
(
VLNRewardedVideoAd
*
)
rewardedVideoAd
{}
-
(
void
)
vl_rewardVideoAdDidClicked
:
(
VLNRewardedVideoAd
*
)
rewardedVideoAd
{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
}
/**
视频广告加载错误信息回调
...
...
@@ -223,7 +227,9 @@
/**
广告点击回调
*/
-
(
void
)
vl_nativeAdDidClick
:
(
VLNNativeAd
*
)
nativeAd
;{}
-
(
void
)
vl_nativeAdDidClick
:
(
VLNNativeAd
*
)
nativeAd
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
}
/**
广告点击关闭
...
...
GYDemo/GYDemo/SCAds/AddSigmobADManager.m
View file @
60fcc8e8
...
...
@@ -96,6 +96,7 @@
* 开屏广告点击回调
*/
-
(
void
)
onSplashAdClicked
:
(
WindSplashAd
*
)
splashAd
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
}
...
...
@@ -166,6 +167,46 @@
}
/**
激励视频广告开始播放
@param placementId 广告位Id
*/
-
(
void
)
onVideoAdPlayStart
:
(
NSString
*
)
placementId
;{
}
/**
激励视频广告发生点击
@param placementId 广告位Id
*/
-
(
void
)
onVideoAdClicked
:
(
NSString
*
)
placementId
;{
[
self
trackingADWith
:
self
.
currentData
.
clk_tracking
.
firstObject
];
}
/**
激励视频广告AdServer返回广告(表示渠道有广告填充)
@param placementId 广告位Id
*/
-
(
void
)
onVideoAdServerDidSuccess
:
(
NSString
*
)
placementId
;{
}
/**
激励视频广告AdServer无广告返回(表示渠道无广告填充)
@param placementId 广告位Id
*/
-
(
void
)
onVideoAdServerDidFail
:
(
NSString
*
)
placementId
;{
}
//MARK: ---- 大图 ---- 原生
...
...
GYDemo/GYDemo/SCAds/GYAdsTrackModel.h
View file @
60fcc8e8
...
...
@@ -20,20 +20,28 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
strong
)
NSString
*
adPlatform
;
// guangdiantong 平台
@property
(
nonatomic
,
assign
)
NSInteger
adType
;
// 忽略 //
@property
(
nonatomic
,
strong
)
NSArray
*
clk_tracking
;
// 点击广告 调用
@property
(
nonatomic
,
strong
)
NSString
*
codeId
;
// codeId = 945568416; //广告位ID 请求广告
@property
(
nonatomic
,
strong
)
NSArray
*
imp_tracking
;
// 展示 调用
@property
(
nonatomic
,
assign
)
NSInteger
platformId
;
// 平台 ID
@property
(
nonatomic
,
strong
)
NSString
*
showfail_tracking
;
//showfail_tracking 显示 失败
@property
(
nonatomic
,
strong
)
NSString
*
pullfail_tracking
;
//showfail_tracking 拉 失败
@property
(
nonatomic
,
strong
)
NSString
*
pullsucc_tracking
;
//showfail_tracking 拉 成功
@property
(
nonatomic
,
assign
)
NSInteger
codeAppId
;
//广告商APP ID
@property
(
nonatomic
,
assign
)
NSInteger
slot_id
;
//
@property
(
nonatomic
,
strong
)
NSString
*
slotName
;
//
// 广告事件回调
@property
(
nonatomic
,
strong
)
NSArray
*
imp_tracking
;
// 展示 调用
@property
(
nonatomic
,
strong
)
NSArray
*
showfail_tracking
;
//showfail_tracking 显示 失败
@property
(
nonatomic
,
strong
)
NSArray
*
pullfail_tracking
;
//showfail_tracking 拉 失败
@property
(
nonatomic
,
strong
)
NSArray
*
pullsucc_tracking
;
//showfail_tracking 拉 成功
@property
(
nonatomic
,
strong
)
NSArray
*
clk_tracking
;
// 点击广告 调用
@property
(
nonatomic
,
strong
)
NSArray
*
playcomplete_trackings
;
//播放成功
@property
(
nonatomic
,
strong
)
NSMutableArray
<
GYAdsTrackModel
*>
*
backups
;
// 用于缓存.成功几率比较高
@property
(
nonatomic
,
assign
)
BOOL
loadSuccess
;
//加载成功
//逻辑字段
@property
(
nonatomic
,
assign
)
BOOL
firstFailure
;
// 第一个失败
@property
(
nonatomic
,
assign
)
eADType
loadADType
;
//这个广告所属的广告类型
+
(
instancetype
)
modelWithDic
:(
NSDictionary
*
)
dict
;
...
...
GYDemo/GYDemo/SCAds/IOSADManager.h
View file @
60fcc8e8
...
...
@@ -80,6 +80,16 @@ NS_ASSUME_NONNULL_BEGIN
-
(
void
)
showADType
:(
eADType
)
AdType
resultBlock
:(
void
(
^
)(
BOOL
success
))
adShowBlock
;
//MARK: 广告链接上报
/// 广告事件上报
/// @param url 要上报的地址
-
(
void
)
trackingADWith
:(
NSString
*
)
url
;
//------------------------------------- 以下下方法是不要主动调用可以 -----------------------------
/// 加载一条缓存
/// @param loadADModel 广告对象
/// @param AdType 广告类型
...
...
@@ -91,7 +101,6 @@ NS_ASSUME_NONNULL_BEGIN
/// @param adType 广告类型
-
(
void
)
showAdWithData
:(
GYAdsTrackModel
*
)
showData
withADType
:(
eADType
)
adType
;
/// 请求开平数据
-
(
void
)
requestOpenScreenAD
;
...
...
GYDemo/GYDemo/SCAds/IOSADManager.m
View file @
60fcc8e8
This diff is collapsed.
Click to expand it.
UnityiOSFarm/Unity-iPhone.xcodeproj/project.pbxproj
View file @
60fcc8e8
...
...
@@ -1431,7 +1431,7 @@
CODE_SIGN_IDENTITY
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Distribution"
;
COPY_PHASE_STRIP
=
NO
;
CURRENT_PROJECT_VERSION
=
10
3
;
CURRENT_PROJECT_VERSION
=
10
4
;
DEVELOPMENT_TEAM
=
""
;
GCC_DYNAMIC_NO_PIC
=
NO
;
GCC_ENABLE_CPP_EXCEPTIONS
=
NO
;
...
...
@@ -1441,7 +1441,7 @@
IPHONEOS_DEPLOYMENT_TARGET
=
11.0
;
LD_GENERATE_MAP_FILE
=
YES
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
MARKETING_VERSION
=
1.0.
2
;
MARKETING_VERSION
=
1.0.
3
;
ONLY_ACTIVE_ARCH
=
YES
;
OTHER_CFLAGS
=
(
"$(inherited)"
,
...
...
@@ -1478,14 +1478,14 @@
CODE_SIGN_IDENTITY
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Distribution"
;
COPY_PHASE_STRIP
=
YES
;
CURRENT_PROJECT_VERSION
=
10
3
;
CURRENT_PROJECT_VERSION
=
10
4
;
DEVELOPMENT_TEAM
=
""
;
GCC_ENABLE_CPP_EXCEPTIONS
=
NO
;
INFOPLIST_FILE
=
Info.plist
;
IPHONEOS_DEPLOYMENT_TARGET
=
11.0
;
LD_GENERATE_MAP_FILE
=
YES
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
MARKETING_VERSION
=
1.0.
2
;
MARKETING_VERSION
=
1.0.
3
;
ONLY_ACTIVE_ARCH
=
NO
;
OTHER_CFLAGS
=
(
"$(inherited)"
,
...
...
@@ -1640,7 +1640,7 @@
CODE_SIGN_IDENTITY
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Distribution"
;
COPY_PHASE_STRIP
=
YES
;
CURRENT_PROJECT_VERSION
=
10
3
;
CURRENT_PROJECT_VERSION
=
10
4
;
DEBUG_INFORMATION_FORMAT
=
dwarf
;
DEVELOPMENT_TEAM
=
""
;
GCC_ENABLE_CPP_EXCEPTIONS
=
NO
;
...
...
@@ -1648,7 +1648,7 @@
IPHONEOS_DEPLOYMENT_TARGET
=
11.0
;
LD_GENERATE_MAP_FILE
=
YES
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
MARKETING_VERSION
=
1.0.
2
;
MARKETING_VERSION
=
1.0.
3
;
ONLY_ACTIVE_ARCH
=
YES
;
OTHER_CFLAGS
=
(
"$(inherited)"
,
...
...
@@ -1751,14 +1751,14 @@
CODE_SIGN_IDENTITY
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Distribution"
;
COPY_PHASE_STRIP
=
YES
;
CURRENT_PROJECT_VERSION
=
10
3
;
CURRENT_PROJECT_VERSION
=
10
4
;
DEVELOPMENT_TEAM
=
""
;
GCC_ENABLE_CPP_EXCEPTIONS
=
NO
;
INFOPLIST_FILE
=
Info.plist
;
IPHONEOS_DEPLOYMENT_TARGET
=
11.0
;
LD_GENERATE_MAP_FILE
=
YES
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
MARKETING_VERSION
=
1.0.
2
;
MARKETING_VERSION
=
1.0.
3
;
ONLY_ACTIVE_ARCH
=
YES
;
OTHER_CFLAGS
=
(
"$(inherited)"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment