diff --git a/MusicBox/Main/AppDelegate.swift b/MusicBox/Main/AppDelegate.swift index 34e34ec..60f9499 100755 --- a/MusicBox/Main/AppDelegate.swift +++ b/MusicBox/Main/AppDelegate.swift @@ -53,6 +53,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { Database.database().isPersistenceEnabled = false GADMobileAds.sharedInstance().start(completionHandler: nil) + // 광고 최대 연령 조정 + GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating = .teen + // 앱을 출시하기 전에 이러한 테스트 기기를 설정하는 코드를 반드시 삭제하세요. // GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = ["2077ef9a63d2b398840261c8221a0c9b"] diff --git a/MusicBox/ViewController/common/FXSound.swift b/MusicBox/ViewController/Common/FXSound.swift similarity index 100% rename from MusicBox/ViewController/common/FXSound.swift rename to MusicBox/ViewController/Common/FXSound.swift diff --git a/MusicBox/ViewController/common/LoadMusicboxFileList.swift b/MusicBox/ViewController/Common/LoadMusicboxFileList.swift similarity index 100% rename from MusicBox/ViewController/common/LoadMusicboxFileList.swift rename to MusicBox/ViewController/Common/LoadMusicboxFileList.swift diff --git a/MusicBox/ViewController/FileCollectionViewController.swift b/MusicBox/ViewController/FileCollectionViewController.swift index 67984f3..66c6c66 100755 --- a/MusicBox/ViewController/FileCollectionViewController.swift +++ b/MusicBox/ViewController/FileCollectionViewController.swift @@ -38,7 +38,7 @@ class FileCollectionViewController: UICollectionViewController { override func viewDidLoad() { super.viewDidLoad() - prepareAndShowFullScreenAd() + // prepareAndShowFullScreenAd() askPhotoAuth() setMenuDropDown() diff --git a/MusicBox/ViewController/MusicPaperViewController.swift b/MusicBox/ViewController/MusicPaperViewController.swift index 5a09f44..b462180 100755 --- a/MusicBox/ViewController/MusicPaperViewController.swift +++ b/MusicBox/ViewController/MusicPaperViewController.swift @@ -992,6 +992,35 @@ extension MusicPaperViewController: GADFullScreenContentDelegate { } let request = GADRequest() + request.keywords = [ + "음악", + "악기", + "Music", + "instrument", + "score", + "sheet", + "piano", + "roll", + "노래", + "song", + "classical", + "클래식", + "유아", + "청소년", + "학습", + "공부", + "musical", + "연주", + "performance", + "칼림바", + "kalimba", + "커뮤니티", + "온라인", + "트럼펫", + "학원", + "academy" + ] + GADInterstitialAd.load(withAdUnitID: AdInfo.shared.paperFullScreen, request: request, completionHandler: { [self] ad, error in diff --git a/MusicBox/ViewController/online_community/ArchiveNavigationController.swift b/MusicBox/ViewController/OnlineCommunity/ArchiveNavigationController.swift similarity index 100% rename from MusicBox/ViewController/online_community/ArchiveNavigationController.swift rename to MusicBox/ViewController/OnlineCommunity/ArchiveNavigationController.swift diff --git a/MusicBox/ViewController/online_community/AuthNavigationController.swift b/MusicBox/ViewController/OnlineCommunity/AuthNavigationController.swift similarity index 100% rename from MusicBox/ViewController/online_community/AuthNavigationController.swift rename to MusicBox/ViewController/OnlineCommunity/AuthNavigationController.swift diff --git a/MusicBox/ViewController/online_community/MemberProfileViewController.swift b/MusicBox/ViewController/OnlineCommunity/MemberProfileViewController.swift similarity index 100% rename from MusicBox/ViewController/online_community/MemberProfileViewController.swift rename to MusicBox/ViewController/OnlineCommunity/MemberProfileViewController.swift diff --git a/MusicBox/ViewController/online_community/NotConnectedViewController.swift b/MusicBox/ViewController/OnlineCommunity/NotConnectedViewController.swift similarity index 100% rename from MusicBox/ViewController/online_community/NotConnectedViewController.swift rename to MusicBox/ViewController/OnlineCommunity/NotConnectedViewController.swift diff --git a/MusicBox/ViewController/online_community/PostPageViewController.swift b/MusicBox/ViewController/OnlineCommunity/PostPageViewController.swift similarity index 100% rename from MusicBox/ViewController/online_community/PostPageViewController.swift rename to MusicBox/ViewController/OnlineCommunity/PostPageViewController.swift diff --git a/MusicBox/ViewController/online_community/PostViewController.swift b/MusicBox/ViewController/OnlineCommunity/PostViewController.swift similarity index 89% rename from MusicBox/ViewController/online_community/PostViewController.swift rename to MusicBox/ViewController/OnlineCommunity/PostViewController.swift index 1de5d38..6c1ae91 100755 --- a/MusicBox/ViewController/online_community/PostViewController.swift +++ b/MusicBox/ViewController/OnlineCommunity/PostViewController.swift @@ -13,6 +13,7 @@ import GoogleMobileAds import Lottie class PostViewController: UIViewController { + private var interstitial: GADInterstitialAd? lazy var lottieView: LottieAnimationView = { let animationView = LottieAnimationView(name: "129574-ginger-bread-socks-christmas") @@ -149,6 +150,8 @@ class PostViewController: UIViewController { } SwiftSpinner.hide() + + prepareFullScreenAd() } override func viewWillAppear(_ animated: Bool) { @@ -176,6 +179,12 @@ class PostViewController: UIViewController { bannerView?.fitInView(self) } + override func willMove(toParent parent: UIViewController?) { + if AdManager.isReallyShowAd, let interstitial { + interstitial.present(fromRootViewController: self) + } + } + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "UpdatePostSegue" { let updateVC = segue.destination as? UpdatePostViewController @@ -379,3 +388,55 @@ extension PostViewController: GADBannerViewDelegate { } } } + +extension PostViewController: GADFullScreenContentDelegate { + /// 전면 광고 준비 + func prepareFullScreenAd() { + guard AdManager.isReallyShowAd else { + return + } + + let request = GADRequest() + request.keywords = [ + "음악", + "악기", + "Music", + "instrument", + "score", + "sheet", + "piano", + "roll", + "노래", + "song", + "classical", + "클래식", + "유아", + "청소년", + "학습", + "공부", + "musical", + "연주", + "performance", + "칼림바", + "kalimba", + "커뮤니티", + "온라인", + "트럼펫", + "학원", + "academy" + ] + + GADInterstitialAd.load(withAdUnitID: AdInfo.shared.paperFullScreen, + request: request, + completionHandler: { [self] ad, error in + if let error = error { + print("Failed to load interstitial ad with error: \(error.localizedDescription)") + return + } + + interstitial = ad + interstitial?.fullScreenContentDelegate = self + } + ) + } +} diff --git a/MusicBox/ViewController/online_community/SelectAFileViewController.swift b/MusicBox/ViewController/OnlineCommunity/SelectAFileViewController.swift similarity index 100% rename from MusicBox/ViewController/online_community/SelectAFileViewController.swift rename to MusicBox/ViewController/OnlineCommunity/SelectAFileViewController.swift diff --git a/MusicBox/ViewController/online_community/SignInViewController.swift b/MusicBox/ViewController/OnlineCommunity/SignInViewController.swift similarity index 100% rename from MusicBox/ViewController/online_community/SignInViewController.swift rename to MusicBox/ViewController/OnlineCommunity/SignInViewController.swift diff --git a/MusicBox/ViewController/online_community/SignUpTableViewController.swift b/MusicBox/ViewController/OnlineCommunity/SignUpTableViewController.swift similarity index 100% rename from MusicBox/ViewController/online_community/SignUpTableViewController.swift rename to MusicBox/ViewController/OnlineCommunity/SignUpTableViewController.swift diff --git a/MusicBox/ViewController/online_community/UpdatePostViewController.swift b/MusicBox/ViewController/OnlineCommunity/UpdatePostViewController.swift similarity index 100% rename from MusicBox/ViewController/online_community/UpdatePostViewController.swift rename to MusicBox/ViewController/OnlineCommunity/UpdatePostViewController.swift diff --git a/MusicBox/ViewController/online_community/UploadFormViewController.swift b/MusicBox/ViewController/OnlineCommunity/UploadFormViewController.swift similarity index 100% rename from MusicBox/ViewController/online_community/UploadFormViewController.swift rename to MusicBox/ViewController/OnlineCommunity/UploadFormViewController.swift diff --git a/MusicBox/ViewController/online_community/UserCommunityViewController.swift b/MusicBox/ViewController/OnlineCommunity/UserCommunityViewController.swift similarity index 100% rename from MusicBox/ViewController/online_community/UserCommunityViewController.swift rename to MusicBox/ViewController/OnlineCommunity/UserCommunityViewController.swift diff --git a/MusicBox/ViewController/online_community/YouNeedLoginViewController.swift b/MusicBox/ViewController/OnlineCommunity/YouNeedLoginViewController.swift similarity index 100% rename from MusicBox/ViewController/online_community/YouNeedLoginViewController.swift rename to MusicBox/ViewController/OnlineCommunity/YouNeedLoginViewController.swift diff --git a/MusicBox/ViewController/settings/AppExhibitionTableViewController.swift b/MusicBox/ViewController/Setting/AppExhibitionTableViewController.swift similarity index 100% rename from MusicBox/ViewController/settings/AppExhibitionTableViewController.swift rename to MusicBox/ViewController/Setting/AppExhibitionTableViewController.swift diff --git a/MusicBox/ViewController/settings/AudioMIDISettingTableViewController.swift b/MusicBox/ViewController/Setting/AudioMIDISettingTableViewController.swift similarity index 100% rename from MusicBox/ViewController/settings/AudioMIDISettingTableViewController.swift rename to MusicBox/ViewController/Setting/AudioMIDISettingTableViewController.swift diff --git a/MusicBox/ViewController/settings/SettingTableViewController.swift b/MusicBox/ViewController/Setting/SettingTableViewController.swift similarity index 100% rename from MusicBox/ViewController/settings/SettingTableViewController.swift rename to MusicBox/ViewController/Setting/SettingTableViewController.swift diff --git a/MusicBox/ViewController/settings/TextureCollectionViewController.swift b/MusicBox/ViewController/Setting/TextureCollectionViewController.swift similarity index 100% rename from MusicBox/ViewController/settings/TextureCollectionViewController.swift rename to MusicBox/ViewController/Setting/TextureCollectionViewController.swift diff --git a/MusicBox/ViewController/webkit/WebkitViewController.swift b/MusicBox/ViewController/WebKit/WebkitViewController.swift similarity index 100% rename from MusicBox/ViewController/webkit/WebkitViewController.swift rename to MusicBox/ViewController/WebKit/WebkitViewController.swift