Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
Z
ZxAd_Unity
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
王雪伟
ZxAd_Unity
Commits
fde19213
Commit
fde19213
authored
May 20, 2021
by
zhangzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改iOS报错
parent
e9460770
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
8 deletions
+34
-8
CSJRewardUtil.cs
Assets/AdSDK/AD/CSJ/CSJRewardUtil.cs
+2
-2
CSJSplshADUtils.cs
Assets/AdSDK/AD/CSJ/CSJSplshADUtils.cs
+32
-6
No files found.
Assets/AdSDK/AD/CSJ/CSJRewardUtil.cs
View file @
fde19213
...
...
@@ -57,11 +57,11 @@ public class CSJRewardUtil
.
SetCodeId
(
iosSlotID
)
#else
.
SetCodeId
(
AndroidSlotID
)
.
SetRewardName
(
"金币"
)
// 奖励的名称
.
SetRewardAmount
(
3
)
// 奖励的数量
#endif
.
SetSupportDeepLink
(
true
)
.
SetImageAcceptedSize
(
1080
,
1920
)
.
SetRewardName
(
"金币"
)
// 奖励的名称
.
SetRewardAmount
(
3
)
// 奖励的数量
.
SetUserID
(
"user123"
)
// 用户id,必传参数
.
SetMediaExtra
(
"media_extra"
)
// 附加参数,可选
.
SetOrientation
(
AdOrientation
.
Horizontal
)
// 必填参数,期望视频的播放方向
...
...
Assets/AdSDK/AD/CSJ/CSJSplshADUtils.cs
View file @
fde19213
...
...
@@ -59,8 +59,15 @@ public class CSJSplshADUtils
/// <param name="activity"></param>
/// <param name="splashAdManager"></param>
/// <param name="listener"></param>
public
void
LoadSplshAd
(
AdEntity
entity
,
AndroidJavaObject
activity
,
AndroidJavaObject
splashAdManager
,
ZXADSplashListener
listener
,
Action
<
bool
>
callback
)
public
void
LoadSplshAd
(
AdEntity
entity
,
AndroidJavaObject
activity
,
AndroidJavaObject
splashAdManager
,
ZXADSplashListener
listener
,
Action
<
bool
>
callback
)
{
#if UNITY_IOS
if
(
this
.
splashAd
!=
null
)
{
this
.
splashAd
.
Dispose
();
this
.
splashAd
=
null
;
}
#endif
//string iosSlotID = "800546808";
//string AndroidSlotID = "801121648";
string
iosSlotID
=
entity
.
codeId
;
...
...
@@ -81,7 +88,7 @@ public class CSJSplshADUtils
.
SetImageAcceptedSize
(
1080
,
1920
)
.
Build
();
#if UNITY_IOS
this
.
AdNative
.
LoadSplashAd
(
adSlot
,
new
SplashAdListener
(
entity
,
this
,
listener
,
callback
));
splashAd
=
this
.
AdNative
.
LoadSplashAd_iOS
(
adSlot
,
new
SplashAdListener
(
entity
,
this
,
listener
,
callback
));
#else
this
.
AdNative
.
LoadSplashAd
(
adSlot
,
new
SplashAdListener
(
entity
,
this
,
listener
,
activity
,
splashAdManager
,
callback
));
#endif
...
...
@@ -99,7 +106,7 @@ public class CSJSplshADUtils
private
AndroidJavaObject
activity
;
private
AndroidJavaObject
splashAdManager
;
private
const
int
INTERACTION_TYPE_DOWNLOAD
=
4
;
public
SplashAdListener
(
AdEntity
entity
,
CSJSplshADUtils
example
,
ZXADSplashListener
listener
,
Action
<
bool
>
callback
)
public
SplashAdListener
(
AdEntity
entity
,
CSJSplshADUtils
example
,
ZXADSplashListener
listener
,
Action
<
bool
>
callback
)
{
this
.
entity
=
entity
;
this
.
csjAD
=
example
;
...
...
@@ -107,7 +114,7 @@ public class CSJSplshADUtils
this
.
callback
=
callback
;
}
public
SplashAdListener
(
AdEntity
entity
,
CSJSplshADUtils
example
,
ZXADSplashListener
listener
,
AndroidJavaObject
activity
,
AndroidJavaObject
splashAdManager
,
Action
<
bool
>
callback
)
public
SplashAdListener
(
AdEntity
entity
,
CSJSplshADUtils
example
,
ZXADSplashListener
listener
,
AndroidJavaObject
activity
,
AndroidJavaObject
splashAdManager
,
Action
<
bool
>
callback
)
{
this
.
entity
=
entity
;
this
.
csjAD
=
example
;
...
...
@@ -127,6 +134,7 @@ public class CSJSplshADUtils
public
void
OnSplashAdLoad
(
BUSplashAd
ad
)
{
EventUtils
.
onEventPullSuccess
(
entity
);
if
(
ad
!=
null
)
{
...
...
@@ -134,7 +142,7 @@ public class CSJSplshADUtils
this
.
csjAD
.
splashAd
=
ad
;
Debug
.
Log
(
"splash load Onsucc:"
);
#if UNITY_IOS
ad
.
SetSplashInteractionListener
(
new
SplashAdInteractionListener
(
entity
,
this
.
csjAD
,
listener
));
ad
.
SetSplashInteractionListener
(
new
SplashAdInteractionListener
(
entity
,
this
.
csjAD
,
listener
));
#else
ad
.
SetSplashInteractionListener
(
new
SplashAdInteractionListener
(
entity
,
this
.
csjAD
,
listener
,
this
.
activity
,
this
.
splashAdManager
));
if
(
ad
.
GetInteractionType
()
==
INTERACTION_TYPE_DOWNLOAD
)
...
...
@@ -144,6 +152,20 @@ public class CSJSplshADUtils
}
#endif
}
#if UNITY_IOS
else
if
(
this
.
csjAD
.
splashAd
!=
null
)
{
callback
(
true
);
ad
=
this
.
csjAD
.
splashAd
;
Debug
.
Log
(
"splash load Onsucc:"
);
ad
.
SetSplashInteractionListener
(
new
SplashAdInteractionListener
(
entity
,
this
.
csjAD
,
listener
));
}
#endif
else
{
callback
(
false
);
}
#if UNITY_ANDROID
if
(
ad
!=
null
&&
this
.
splashAdManager
!=
null
&&
this
.
activity
!=
null
)
{
...
...
@@ -160,7 +182,7 @@ public class CSJSplshADUtils
private
ZXADSplashListener
listener
;
private
AndroidJavaObject
activity
;
private
AndroidJavaObject
splashAdManager
;
public
SplashAdInteractionListener
(
AdEntity
entity
,
CSJSplshADUtils
example
,
ZXADSplashListener
listener
)
public
SplashAdInteractionListener
(
AdEntity
entity
,
CSJSplshADUtils
example
,
ZXADSplashListener
listener
)
{
this
.
entity
=
entity
;
this
.
csjAD
=
example
;
...
...
@@ -222,7 +244,9 @@ public class CSJSplshADUtils
EventUtils
.
onEventAdComplete
(
entity
);
//listener.onAdSkip();
Debug
.
Log
(
"splash Ad OnAdSkip"
);
#if UNITY_ANDROID
DestorySplash
();
#endif
}
/// <summary>
...
...
@@ -231,7 +255,9 @@ public class CSJSplshADUtils
public
void
OnAdTimeOver
()
{
Debug
.
Log
(
"splash Ad OnAdTimeOver"
);
#if UNITY_ANDROID
DestorySplash
();
#endif
}
public
void
OnAdClose
()
...
...
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