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
2e3d6597
Commit
2e3d6597
authored
Nov 11, 2020
by
Mazy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
parent
dd37ed05
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
9 deletions
+71
-9
GYDemo.xcscheme
...o/GYDemo.xcodeproj/xcshareddata/xcschemes/GYDemo.xcscheme
+7
-0
xcschememanagement.plist
...rdata/mazy.xcuserdatad/xcschemes/xcschememanagement.plist
+1
-1
AppDelegate.h
GYDemo/GYDemo/AppDelegate.h
+5
-0
AppDelegate.mm
GYDemo/GYDemo/AppDelegate.mm
+25
-0
GYAdsManager.m
GYDemo/GYDemo/SCAds/GYAdsManager.m
+3
-1
GYWebViewController.m
GYDemo/GYDemo/ViewController/GYWebViewController.m
+20
-2
xcschememanagement.plist
...rdata/mazy.xcuserdatad/xcschemes/xcschememanagement.plist
+8
-3
xcschememanagement.plist
...rdata/mazy.xcuserdatad/xcschemes/xcschememanagement.plist
+2
-2
UserInterfaceState.xcuserstate
...cuserdata/mazy.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
No files found.
GYDemo/GYDemo.xcodeproj/xcshareddata/xcschemes/GYDemo.xcscheme
View file @
2e3d6597
...
@@ -70,6 +70,13 @@
...
@@ -70,6 +70,13 @@
ReferencedContainer =
"container:GYDemo.xcodeproj"
>
ReferencedContainer =
"container:GYDemo.xcodeproj"
>
</BuildableReference>
</BuildableReference>
</BuildableProductRunnable>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key =
"OS_ACTIVITY_MODE"
value =
"disable"
isEnabled =
"YES"
>
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
</LaunchAction>
<ProfileAction
<ProfileAction
buildConfiguration =
"Release"
buildConfiguration =
"Release"
...
...
GYDemo/GYDemo.xcodeproj/xcuserdata/mazy.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
2e3d6597
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<
k
e
y
>
GYDemo.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
GYDemo.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
7
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
5
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
...
...
GYDemo/GYDemo/AppDelegate.h
View file @
2e3d6597
...
@@ -26,5 +26,10 @@
...
@@ -26,5 +26,10 @@
-
(
void
)
ios_getOrderData
;
-
(
void
)
ios_getOrderData
;
-
(
void
)
unityVideo
:(
BOOL
)
video
;
-
(
void
)
unityVideo
:(
BOOL
)
video
;
// 获取当前window
-
(
UIWindow
*
)
getMainWindow
;
// 获取当前window 最上方控制器
-
(
UIViewController
*
)
getTopViewController
;
@end
@end
GYDemo/GYDemo/AppDelegate.mm
View file @
2e3d6597
...
@@ -688,6 +688,31 @@ NSDictionary* appLaunchOpts;
...
@@ -688,6 +688,31 @@ NSDictionary* appLaunchOpts;
NSLog(@"---");
NSLog(@"---");
}
}
- (UIWindow *)getMainWindow {
return [[self ufw] appController].window;
}
- (UIViewController *)getTopViewController {
UIViewController *resultVC;
//这里的window有时取得不是delegate的window
resultVC = [self _topViewController:[[self getMainWindow] rootViewController]];
while (resultVC.presentedViewController) {
resultVC = [self _topViewController: resultVC.presentedViewController];
}
return resultVC;
}
- (UIViewController *)_topViewController:(UIViewController *)vc {
if ([vc isKindOfClass:[UINavigationController class]]) {
return [self _topViewController:[(UINavigationController *)vc topViewController]];
} else if ([vc isKindOfClass:[UITabBarController class]]) {
return [self _topViewController:[(UITabBarController *)vc selectedViewController]];
} else {
return vc;
}
return nil;
}
@end
@end
GYDemo/GYDemo/SCAds/GYAdsManager.m
View file @
2e3d6597
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#import "GYAdsManager+OpenScreen.h"
#import "GYAdsManager+OpenScreen.h"
#import "GYAdsManager+Flow.h"
#import "GYAdsManager+Flow.h"
#import "GYAdsManager+RewardedVideo.h"
#import "GYAdsManager+RewardedVideo.h"
#import "AppDelegate.h"
static
GYAdsManager
*
manager
;
static
GYAdsManager
*
manager
;
@implementation
GYAdsManager
@implementation
GYAdsManager
...
@@ -24,7 +25,8 @@ static GYAdsManager * manager;
...
@@ -24,7 +25,8 @@ static GYAdsManager * manager;
-
(
instancetype
)
init
{
-
(
instancetype
)
init
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
self
.
mainWindow
=
[(
AppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
getMainWindow
];
self
.
currentVC
=
[(
AppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
getTopViewController
];
}
}
return
self
;
return
self
;
}
}
...
...
GYDemo/GYDemo/ViewController/GYWebViewController.m
View file @
2e3d6597
...
@@ -55,6 +55,8 @@
...
@@ -55,6 +55,8 @@
}
else
{
}
else
{
// Fallback on earlier versions
// Fallback on earlier versions
}
}
[
webViewConfig
.
userContentController
addScriptMessageHandler
:
self
name
:
@"eventUtils"
];
[
webViewConfig
.
userContentController
addScriptMessageHandler
:
self
name
:
@"closeView"
];
[
webViewConfig
.
userContentController
addScriptMessageHandler
:
self
name
:
@"backTrack"
];
[
webViewConfig
.
userContentController
addScriptMessageHandler
:
self
name
:
@"backTrack"
];
[
webViewConfig
.
userContentController
addScriptMessageHandler
:
self
name
:
@"settingCallBack"
];
[
webViewConfig
.
userContentController
addScriptMessageHandler
:
self
name
:
@"settingCallBack"
];
[
webViewConfig
.
userContentController
addScriptMessageHandler
:
self
name
:
@"withDraw"
];
[
webViewConfig
.
userContentController
addScriptMessageHandler
:
self
name
:
@"withDraw"
];
...
@@ -343,6 +345,15 @@
...
@@ -343,6 +345,15 @@
"script.content=
\"
width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0, user-scalable=no
\"
;"
"script.content=
\"
width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0, user-scalable=no
\"
;"
"document.getElementsByTagName('head')[0].appendChild(script);"
;
"document.getElementsByTagName('head')[0].appendChild(script);"
;
[
webView
evaluateJavaScript
:
injectionJSString
completionHandler
:
nil
];
[
webView
evaluateJavaScript
:
injectionJSString
completionHandler
:
nil
];
NSString
*
method
=
[
NSString
stringWithFormat
:
@"getStatusBarHeight(
\"
%.0f
\"
)"
,
UIApplication
.
sharedApplication
.
statusBarFrame
.
size
.
height
/
2
+
22
];
[
webView
evaluateJavaScript
:
method
completionHandler
:
^
(
id
_Nullable
obj
,
NSError
*
_Nullable
error
)
{
if
(
error
)
{
NSLog
(
@"%@"
,
error
);
}
else
{
NSLog
(
@"getStatusBarHeight JS方法调用成功"
);
}
}];
}
}
//加载失败
//加载失败
...
@@ -434,7 +445,7 @@
...
@@ -434,7 +445,7 @@
-
(
void
)
userContentController
:
(
WKUserContentController
*
)
userContentController
didReceiveScriptMessage
:
(
WKScriptMessage
*
)
message
{
-
(
void
)
userContentController
:
(
WKUserContentController
*
)
userContentController
didReceiveScriptMessage
:
(
WKScriptMessage
*
)
message
{
NSLog
(
@"%@"
,
message
.
name
);
// 方法名
NSLog
(
@"%@"
,
message
.
name
);
// 方法名
__weak
typeof
(
self
)
weakSelf
=
self
;
__weak
typeof
(
self
)
weakSelf
=
self
;
if
([
message
.
name
isEqualToString
:
@"backTrack"
]){
if
([
message
.
name
isEqualToString
:
@"backTrack"
]
||
[
message
.
name
isEqualToString
:
@"closeView"
]
){
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
5
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
5
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
weakSelf
goBackController
];
[
weakSelf
goBackController
];
});
});
...
@@ -497,7 +508,7 @@
...
@@ -497,7 +508,7 @@
[
self
.
webView
reload
];
[
self
.
webView
reload
];
};
};
}
else
if
([
message
.
name
isEqualToString
:
@"jumpWebActivity"
]){
}
else
if
([
message
.
name
isEqualToString
:
@"jumpWebActivity"
]){
NSString
*
bodyStr
=
message
.
body
;
NSString
*
bodyStr
=
message
.
body
;
NSData
*
data
=
[
bodyStr
dataUsingEncoding
:
NSUTF8StringEncoding
];
NSData
*
data
=
[
bodyStr
dataUsingEncoding
:
NSUTF8StringEncoding
];
NSDictionary
*
dict
=
[
NSJSONSerialization
JSONObjectWithData
:
data
options
:
NSJSONReadingMutableLeaves
error
:
nil
];
NSDictionary
*
dict
=
[
NSJSONSerialization
JSONObjectWithData
:
data
options
:
NSJSONReadingMutableLeaves
error
:
nil
];
...
@@ -513,6 +524,13 @@
...
@@ -513,6 +524,13 @@
UINavigationController
*
nav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
web
];
UINavigationController
*
nav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
web
];
nav
.
modalPresentationStyle
=
UIModalPresentationFullScreen
;
nav
.
modalPresentationStyle
=
UIModalPresentationFullScreen
;
[
self
presentViewController
:
nav
animated
:
YES
completion
:
nil
];
[
self
presentViewController
:
nav
animated
:
YES
completion
:
nil
];
}
else
if
([
message
.
name
isEqualToString
:
@"eventUtils"
]){
//上报
NSString
*
bodyStr
=
message
.
body
;
if
(
bodyStr
)
{
[[
CGUserManager
shared
]
addLocCollection
:
bodyStr
value
:
@""
];
}
}
}
}
}
...
...
GYDemo/Pods/Pods.xcodeproj/xcuserdata/mazy.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
2e3d6597
...
@@ -14,12 +14,17 @@
...
@@ -14,12 +14,17 @@
<
k
e
y
>
Bytedance-UnionAD.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
Bytedance-UnionAD.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
6
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
12
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
k
e
y
>
GDTMobSDK.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
11
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
KSAdSDK.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
KSAdSDK.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
9
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
7
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
MBProgressHUD.xcscheme
<
/k
e
y
>
<
k
e
y
>
MBProgressHUD.xcscheme
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
...
@@ -57,7 +62,7 @@
...
@@ -57,7 +62,7 @@
<
k
e
y
>
WechatOpenSDK.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
WechatOpenSDK.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
5
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
9
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
SuppressBuildableAutocreation
<
/k
e
y
>
<
k
e
y
>
SuppressBuildableAutocreation
<
/k
e
y
>
...
...
UnityiOSFarm/Unity-iPhone.xcodeproj/xcuserdata/mazy.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
2e3d6597
...
@@ -7,12 +7,12 @@
...
@@ -7,12 +7,12 @@
<
k
e
y
>
Unity-iPhone.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
Unity-iPhone.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
10
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
6
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
k
e
y
>
UnityFramework.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
k
e
y
>
UnityFramework.xcscheme_
^#
shared
#^
_
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
k
e
y
>
orderHint
<
/k
e
y
>
<
int
e
g
e
r
>
1
1
<
/int
e
g
e
r
>
<
int
e
g
e
r
>
1
0
<
/int
e
g
e
r
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
...
...
farm.xcworkspace/xcuserdata/mazy.xcuserdatad/UserInterfaceState.xcuserstate
View file @
2e3d6597
No preview for this file type
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