- Added google ad banner for webseries.

- Added google ad for karaoke
- Added google ad for karaoke record ui
- Added google ad for fm
- Made a delegate function to handle the ad received or failure
- Added ads to games webview bottom banner
This commit is contained in:
2024-09-16 19:58:03 +05:30
parent 8c81c7291b
commit bbddd1336f
17 changed files with 470 additions and 101 deletions

View File

@@ -112,6 +112,8 @@
527AC6FE2C173A5100434FB7 /* SongListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 527AC6FC2C173A5100434FB7 /* SongListCell.xib */; }; 527AC6FE2C173A5100434FB7 /* SongListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 527AC6FC2C173A5100434FB7 /* SongListCell.xib */; };
527AC7012C182DCE00434FB7 /* TimeStringToSeconds.swift in Sources */ = {isa = PBXBuildFile; fileRef = 527AC7002C182DCE00434FB7 /* TimeStringToSeconds.swift */; }; 527AC7012C182DCE00434FB7 /* TimeStringToSeconds.swift in Sources */ = {isa = PBXBuildFile; fileRef = 527AC7002C182DCE00434FB7 /* TimeStringToSeconds.swift */; };
5282DB292C92D73B00465BA1 /* GoogleInteractiveMediaAds in Frameworks */ = {isa = PBXBuildFile; productRef = 5282DB282C92D73B00465BA1 /* GoogleInteractiveMediaAds */; }; 5282DB292C92D73B00465BA1 /* GoogleInteractiveMediaAds in Frameworks */ = {isa = PBXBuildFile; productRef = 5282DB282C92D73B00465BA1 /* GoogleInteractiveMediaAds */; };
5282DB2C2C9816C600465BA1 /* WOKA.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 5282DB2A2C9816C600465BA1 /* WOKA.xcdatamodeld */; };
5282DB2F2C981EAD00465BA1 /* AdReusable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5282DB2E2C981EAD00465BA1 /* AdReusable.swift */; };
528BEF602C2C372900FFDAB8 /* ContinueWatchingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528BEF5F2C2C372900FFDAB8 /* ContinueWatchingVC.swift */; }; 528BEF602C2C372900FFDAB8 /* ContinueWatchingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528BEF5F2C2C372900FFDAB8 /* ContinueWatchingVC.swift */; };
528E5F1B2C24531200E33E4E /* SeasonListingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528E5F1A2C24531200E33E4E /* SeasonListingDM.swift */; }; 528E5F1B2C24531200E33E4E /* SeasonListingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528E5F1A2C24531200E33E4E /* SeasonListingDM.swift */; };
528E5F222C24660F00E33E4E /* SeasonCategoryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528E5F202C24660F00E33E4E /* SeasonCategoryCell.swift */; }; 528E5F222C24660F00E33E4E /* SeasonCategoryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528E5F202C24660F00E33E4E /* SeasonCategoryCell.swift */; };
@@ -282,7 +284,6 @@
9C27E1722BDB86B600EC1DA9 /* OnBoardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C27E1702BDB86B600EC1DA9 /* OnBoardCell.swift */; }; 9C27E1722BDB86B600EC1DA9 /* OnBoardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C27E1702BDB86B600EC1DA9 /* OnBoardCell.swift */; };
9C27E1732BDB86B600EC1DA9 /* OnBoardCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C27E1712BDB86B600EC1DA9 /* OnBoardCell.xib */; }; 9C27E1732BDB86B600EC1DA9 /* OnBoardCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C27E1712BDB86B600EC1DA9 /* OnBoardCell.xib */; };
9C3E14472C517E8F00D06C10 /* TopViewEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C3E14462C517E8F00D06C10 /* TopViewEnum.swift */; }; 9C3E14472C517E8F00D06C10 /* TopViewEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C3E14462C517E8F00D06C10 /* TopViewEnum.swift */; };
9C416B242C94249400C03A10 /* WOKA.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 9C416B222C94249400C03A10 /* WOKA.xcdatamodeld */; };
9C535DB52C005A6D00DA6DCD /* KeyWindowFix.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C535DB42C005A6C00DA6DCD /* KeyWindowFix.swift */; }; 9C535DB52C005A6D00DA6DCD /* KeyWindowFix.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C535DB42C005A6C00DA6DCD /* KeyWindowFix.swift */; };
9C535DB82C0089B400DA6DCD /* ViewButtonAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C535DB72C0089B400DA6DCD /* ViewButtonAnimation.swift */; }; 9C535DB82C0089B400DA6DCD /* ViewButtonAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C535DB72C0089B400DA6DCD /* ViewButtonAnimation.swift */; };
9C535DC02C00B36000DA6DCD /* HomeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C535DBF2C00B36000DA6DCD /* HomeVC.swift */; }; 9C535DC02C00B36000DA6DCD /* HomeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C535DBF2C00B36000DA6DCD /* HomeVC.swift */; };
@@ -517,6 +518,8 @@
527AC6FB2C173A5100434FB7 /* SongListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SongListCell.swift; sourceTree = "<group>"; }; 527AC6FB2C173A5100434FB7 /* SongListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SongListCell.swift; sourceTree = "<group>"; };
527AC6FC2C173A5100434FB7 /* SongListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SongListCell.xib; sourceTree = "<group>"; }; 527AC6FC2C173A5100434FB7 /* SongListCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SongListCell.xib; sourceTree = "<group>"; };
527AC7002C182DCE00434FB7 /* TimeStringToSeconds.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeStringToSeconds.swift; sourceTree = "<group>"; }; 527AC7002C182DCE00434FB7 /* TimeStringToSeconds.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeStringToSeconds.swift; sourceTree = "<group>"; };
5282DB2B2C9816C600465BA1 /* WOKA.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = WOKA.xcdatamodel; sourceTree = "<group>"; };
5282DB2E2C981EAD00465BA1 /* AdReusable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdReusable.swift; sourceTree = "<group>"; };
528BEF5F2C2C372900FFDAB8 /* ContinueWatchingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContinueWatchingVC.swift; sourceTree = "<group>"; }; 528BEF5F2C2C372900FFDAB8 /* ContinueWatchingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContinueWatchingVC.swift; sourceTree = "<group>"; };
528E5F1A2C24531200E33E4E /* SeasonListingDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeasonListingDM.swift; sourceTree = "<group>"; }; 528E5F1A2C24531200E33E4E /* SeasonListingDM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeasonListingDM.swift; sourceTree = "<group>"; };
528E5F202C24660F00E33E4E /* SeasonCategoryCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeasonCategoryCell.swift; sourceTree = "<group>"; }; 528E5F202C24660F00E33E4E /* SeasonCategoryCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeasonCategoryCell.swift; sourceTree = "<group>"; };
@@ -690,7 +693,6 @@
9C27E1702BDB86B600EC1DA9 /* OnBoardCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnBoardCell.swift; sourceTree = "<group>"; }; 9C27E1702BDB86B600EC1DA9 /* OnBoardCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnBoardCell.swift; sourceTree = "<group>"; };
9C27E1712BDB86B600EC1DA9 /* OnBoardCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OnBoardCell.xib; sourceTree = "<group>"; }; 9C27E1712BDB86B600EC1DA9 /* OnBoardCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OnBoardCell.xib; sourceTree = "<group>"; };
9C3E14462C517E8F00D06C10 /* TopViewEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopViewEnum.swift; sourceTree = "<group>"; }; 9C3E14462C517E8F00D06C10 /* TopViewEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopViewEnum.swift; sourceTree = "<group>"; };
9C416B232C94249400C03A10 /* WOKA.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = WOKA.xcdatamodel; sourceTree = "<group>"; };
9C535DB42C005A6C00DA6DCD /* KeyWindowFix.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyWindowFix.swift; sourceTree = "<group>"; }; 9C535DB42C005A6C00DA6DCD /* KeyWindowFix.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyWindowFix.swift; sourceTree = "<group>"; };
9C535DB72C0089B400DA6DCD /* ViewButtonAnimation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewButtonAnimation.swift; sourceTree = "<group>"; }; 9C535DB72C0089B400DA6DCD /* ViewButtonAnimation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewButtonAnimation.swift; sourceTree = "<group>"; };
9C535DBF2C00B36000DA6DCD /* HomeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeVC.swift; sourceTree = "<group>"; }; 9C535DBF2C00B36000DA6DCD /* HomeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeVC.swift; sourceTree = "<group>"; };
@@ -970,7 +972,7 @@
9C535DC82C00C34000DA6DCD /* Theme */, 9C535DC82C00C34000DA6DCD /* Theme */,
52DAC6462C21761700E2F85B /* WebSeries */, 52DAC6462C21761700E2F85B /* WebSeries */,
9C834ED92C1C20EC00B29A9C /* WOKA.entitlements */, 9C834ED92C1C20EC00B29A9C /* WOKA.entitlements */,
9C416B222C94249400C03A10 /* WOKA.xcdatamodeld */, 5282DB2A2C9816C600465BA1 /* WOKA.xcdatamodeld */,
52ACC1292C610EC900791528 /* PersistentStorage.swift */, 52ACC1292C610EC900791528 /* PersistentStorage.swift */,
); );
path = WOKA; path = WOKA;
@@ -1302,6 +1304,14 @@
path = Timer; path = Timer;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
5282DB2D2C981E9300465BA1 /* AdResuable */ = {
isa = PBXGroup;
children = (
5282DB2E2C981EAD00465BA1 /* AdReusable.swift */,
);
path = AdResuable;
sourceTree = "<group>";
};
528F26E02C6B7B30003E4D99 /* OneSignalNotificationServiceExtension */ = { 528F26E02C6B7B30003E4D99 /* OneSignalNotificationServiceExtension */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@@ -1493,6 +1503,7 @@
52C8B0512BDA4B51003B51D0 /* Helpers */ = { 52C8B0512BDA4B51003B51D0 /* Helpers */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
5282DB2D2C981E9300465BA1 /* AdResuable */,
5201D4272C7F22DD008E3211 /* Network */, 5201D4272C7F22DD008E3211 /* Network */,
9CDAEB0F2C53F12800890C47 /* Shadows */, 9CDAEB0F2C53F12800890C47 /* Shadows */,
9C834EDA2C1C26C000B29A9C /* HTML */, 9C834EDA2C1C26C000B29A9C /* HTML */,
@@ -2372,7 +2383,7 @@
52B8D4DC2C04A25E00ED65F3 /* Delegate.swift in Sources */, 52B8D4DC2C04A25E00ED65F3 /* Delegate.swift in Sources */,
52CA28FC2BE11A0400708B49 /* UserIntrestVM.swift in Sources */, 52CA28FC2BE11A0400708B49 /* UserIntrestVM.swift in Sources */,
52B8D4DB2C04A25E00ED65F3 /* TransitionContext.swift in Sources */, 52B8D4DB2C04A25E00ED65F3 /* TransitionContext.swift in Sources */,
9C416B242C94249400C03A10 /* WOKA.xcdatamodeld in Sources */, 5282DB2C2C9816C600465BA1 /* WOKA.xcdatamodeld in Sources */,
9C27E1602BDB6ECA00EC1DA9 /* UserDefaultsStruct.swift in Sources */, 9C27E1602BDB6ECA00EC1DA9 /* UserDefaultsStruct.swift in Sources */,
52A3F6AD2BECC0340000BB0B /* TypeAlias.swift in Sources */, 52A3F6AD2BECC0340000BB0B /* TypeAlias.swift in Sources */,
52D6A24C2C21B43300145908 /* WebSeriesCell.swift in Sources */, 52D6A24C2C21B43300145908 /* WebSeriesCell.swift in Sources */,
@@ -2413,6 +2424,7 @@
52A6DCA02C4E3AA600F63C51 /* ShopListingCell.swift in Sources */, 52A6DCA02C4E3AA600F63C51 /* ShopListingCell.swift in Sources */,
525954192BE8CC3400191286 /* ConstantString.swift in Sources */, 525954192BE8CC3400191286 /* ConstantString.swift in Sources */,
52D774EB2BDFC0BF001D87DE /* OTPVC.swift in Sources */, 52D774EB2BDFC0BF001D87DE /* OTPVC.swift in Sources */,
5282DB2F2C981EAD00465BA1 /* AdReusable.swift in Sources */,
9C8446872C40FC6E003E3E53 /* AVPlayerTesting.swift in Sources */, 9C8446872C40FC6E003E3E53 /* AVPlayerTesting.swift in Sources */,
52AF71F42C36C40B00BC5972 /* GamesWebViewVC.swift in Sources */, 52AF71F42C36C40B00BC5972 /* GamesWebViewVC.swift in Sources */,
9C007F202C255DF200F798C2 /* EpisodeListingDM.swift in Sources */, 9C007F202C255DF200F798C2 /* EpisodeListingDM.swift in Sources */,
@@ -2861,7 +2873,7 @@
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard;
INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UIStatusBarHidden = NO; INFOPLIST_KEY_UIStatusBarHidden = NO;
INFOPLIST_KEY_UIStatusBarStyle = ""; INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Light; INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 14.0; IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@@ -2904,7 +2916,7 @@
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard; INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard;
INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UIStatusBarHidden = NO; INFOPLIST_KEY_UIStatusBarHidden = NO;
INFOPLIST_KEY_UIStatusBarStyle = ""; INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait; INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UIUserInterfaceStyle = Light; INFOPLIST_KEY_UIUserInterfaceStyle = Light;
IPHONEOS_DEPLOYMENT_TARGET = 14.0; IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@@ -3225,14 +3237,14 @@
/* End XCSwiftPackageProductDependency section */ /* End XCSwiftPackageProductDependency section */
/* Begin XCVersionGroup section */ /* Begin XCVersionGroup section */
9C416B222C94249400C03A10 /* WOKA.xcdatamodeld */ = { 5282DB2A2C9816C600465BA1 /* WOKA.xcdatamodeld */ = {
isa = XCVersionGroup; isa = XCVersionGroup;
children = ( children = (
9C416B232C94249400C03A10 /* WOKA.xcdatamodel */, 5282DB2B2C9816C600465BA1 /* WOKA.xcdatamodel */,
); );
currentVersion = 9C416B232C94249400C03A10 /* WOKA.xcdatamodel */; currentVersion = 5282DB2B2C9816C600465BA1 /* WOKA.xcdatamodel */;
name = WOKA.xcdatamodeld; name = WOKA.xcdatamodeld;
path = /Users/bilal/Desktop/woka_native_ios_swift/WOKA/WOKA.xcdatamodeld; path = /Users/macbookpro/Desktop/WOKA/WOKA/WOKA.xcdatamodeld;
sourceTree = "<group>"; sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel; versionGroupType = wrapper.xcdatamodel;
}; };

View File

@@ -138,23 +138,23 @@
<rect key="frame" x="0.0" y="59" width="414" height="803"/> <rect key="frame" x="0.0" y="59" width="414" height="803"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="4FL-Qu-GXb"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="4FL-Qu-GXb">
<rect key="frame" x="0.0" y="0.0" width="414" height="364.33333333333331"/> <rect key="frame" x="0.0" y="0.0" width="414" height="363"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Order Summary" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fbh-Ve-yLY" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Order Summary" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fbh-Ve-yLY" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="5" y="5" width="404" height="24"/> <rect key="frame" x="5" y="4.9999999999999982" width="404" height="23.333333333333329"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="qGY-nv-azT"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="qGY-nv-azT">
<rect key="frame" x="5" y="39" width="404" height="100"/> <rect key="frame" x="5" y="38.333333333333329" width="404" height="99.999999999999986"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="100" id="cQ3-vj-QS5"/> <constraint firstAttribute="height" constant="100" id="cQ3-vj-QS5"/>
</constraints> </constraints>
</tableView> </tableView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ZuF-hT-QwS"> <stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ZuF-hT-QwS">
<rect key="frame" x="5" y="149" width="404" height="50"/> <rect key="frame" x="5" y="148.33333333333334" width="404" height="50"/>
<subviews> <subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Enter coupon code" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="0cZ-tT-3PH" customClass="TextFieldShadow" customModule="WOKA" customModuleProvider="target"> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Enter coupon code" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="0cZ-tT-3PH" customClass="TextFieldShadow" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="5" y="0.0" width="294" height="50"/> <rect key="frame" x="5" y="0.0" width="294" height="50"/>
@@ -209,14 +209,14 @@
<edgeInsets key="layoutMargins" top="0.0" left="5" bottom="0.0" right="5"/> <edgeInsets key="layoutMargins" top="0.0" left="5" bottom="0.0" right="5"/>
</stackView> </stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0M5-Sk-NNP"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0M5-Sk-NNP">
<rect key="frame" x="5" y="209" width="404" height="0.66666666666665719"/> <rect key="frame" x="5" y="208.33333333333331" width="404" height="0.66666666666665719"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="0.69999999999999996" id="euT-bu-DWE"/> <constraint firstAttribute="height" constant="0.69999999999999996" id="euT-bu-DWE"/>
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hjo-i3-vzd"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Hjo-i3-vzd">
<rect key="frame" x="5" y="219.66666666666669" width="404" height="34.333333333333343"/> <rect key="frame" x="5" y="219" width="404" height="34.333333333333343"/>
<color key="tintColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="tintColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="All Offers &amp; Coupons" image="chevron.forward.circle.fill" catalog="system"/> <state key="normal" title="All Offers &amp; Coupons" image="chevron.forward.circle.fill" catalog="system"/>
@@ -226,39 +226,39 @@
</connections> </connections>
</button> </button>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" No Coupon Found!" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yYe-w7-xHF" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" No Coupon Found!" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yYe-w7-xHF" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="5" y="259" width="404" height="0.0"/> <rect key="frame" x="5" y="258.33333333333331" width="404" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="16"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="16"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<tableView hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="kB1-D9-Jpc"> <tableView hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="kB1-D9-Jpc">
<rect key="frame" x="5" y="259" width="404" height="0.0"/> <rect key="frame" x="5" y="258.33333333333331" width="404" height="0.0"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" id="Uhk-ez-kna"/> <constraint firstAttribute="height" id="Uhk-ez-kna"/>
</constraints> </constraints>
</tableView> </tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PfV-Yj-8cg"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PfV-Yj-8cg">
<rect key="frame" x="5" y="264" width="404" height="0.66666666666668561"/> <rect key="frame" x="5" y="263.33333333333331" width="404" height="0.66666666666668561"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="0.69999999999999996" id="4xH-CV-oza"/> <constraint firstAttribute="height" constant="0.69999999999999996" id="4xH-CV-oza"/>
</constraints> </constraints>
</view> </view>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="IIC-eN-1kV"> <stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="IIC-eN-1kV">
<rect key="frame" x="5" y="269.66666666666669" width="404" height="40.666666666666686"/> <rect key="frame" x="5" y="269" width="404" height="40.666666666666686"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="0fF-q8-366"> <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="0fF-q8-366">
<rect key="frame" x="0.0" y="0.0" width="404" height="0.0"/> <rect key="frame" x="0.0" y="0.0" width="404" height="0.0"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Subtotal: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="X02-Xy-T6S" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Subtotal: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="X02-Xy-T6S" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="82" height="0.0"/> <rect key="frame" x="0.0" y="0.0" width="78" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VJO-dL-zw7" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VJO-dL-zw7" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="363" y="0.0" width="41" height="0.0"/> <rect key="frame" x="362.33333333333331" y="0.0" width="41.666666666666686" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@@ -269,13 +269,13 @@
<rect key="frame" x="0.0" y="20" width="404" height="0.0"/> <rect key="frame" x="0.0" y="20" width="404" height="0.0"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Discount: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SjJ-9G-tNV" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Discount: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SjJ-9G-tNV" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="84" height="0.0"/> <rect key="frame" x="0.0" y="0.0" width="81.666666666666671" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Aru-WM-a5c" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Aru-WM-a5c" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="363" y="0.0" width="41" height="0.0"/> <rect key="frame" x="362.33333333333331" y="0.0" width="41.666666666666686" height="0.0"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@@ -292,19 +292,19 @@
</subviews> </subviews>
</stackView> </stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="13" translatesAutoresizingMaskIntoConstraints="NO" id="qF1-U6-f3P"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="13" translatesAutoresizingMaskIntoConstraints="NO" id="qF1-U6-f3P">
<rect key="frame" x="5" y="274.66666666666669" width="404" height="84.666666666666686"/> <rect key="frame" x="5" y="274" width="404" height="84"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="YSF-eO-Ree"> <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="YSF-eO-Ree">
<rect key="frame" x="0.0" y="0.0" width="404" height="21.666666666666668"/> <rect key="frame" x="0.0" y="0.0" width="404" height="21"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Total Amount: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mDO-yI-336" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Total Amount: " textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mDO-yI-336" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="122" height="21.666666666666668"/> <rect key="frame" x="0.0" y="0.0" width="116.33333333333333" height="21"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lH2-35-Ttu" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rs. 0" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lH2-35-Ttu" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="363" y="0.0" width="41" height="21.666666666666668"/> <rect key="frame" x="362.33333333333331" y="0.0" width="41.666666666666686" height="21"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/> <fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="18"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
@@ -312,7 +312,7 @@
</subviews> </subviews>
</stackView> </stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rp4-qX-3OH" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rp4-qX-3OH" customClass="LocalisedElementsButton" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="34.666666666666629" width="404" height="50"/> <rect key="frame" x="0.0" y="34" width="404" height="50"/>
<color key="backgroundColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="50" id="UFU-ci-N8q"> <constraint firstAttribute="height" constant="50" id="UFU-ci-N8q">
@@ -388,7 +388,7 @@
</scenes> </scenes>
<designables> <designables>
<designable name="0cZ-tT-3PH"> <designable name="0cZ-tT-3PH">
<size key="intrinsicContentSize" width="134.33333333333334" height="21"/> <size key="intrinsicContentSize" width="186.66666666666666" height="20.333333333333332"/>
</designable> </designable>
</designables> </designables>
<resources> <resources>
@@ -398,7 +398,7 @@
<color red="0.10599999874830246" green="0.050999999046325684" blue="0.60399997234344482" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.10599999874830246" green="0.050999999046325684" blue="0.60399997234344482" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<systemColor name="systemGreenColor"> <systemColor name="systemGreenColor">
<color red="0.20392156859999999" green="0.78039215689999997" blue="0.34901960780000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.20392156862745098" green="0.7803921568627451" blue="0.34901960784313724" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor> </systemColor>
</resources> </resources>
</document> </document>

View File

@@ -7,6 +7,7 @@
import UIKit import UIKit
import WebKit import WebKit
import GoogleMobileAds
class GamesWebViewVC: UIViewController, WKNavigationDelegate,UIGestureRecognizerDelegate { class GamesWebViewVC: UIViewController, WKNavigationDelegate,UIGestureRecognizerDelegate {
@@ -18,12 +19,14 @@ class GamesWebViewVC: UIViewController, WKNavigationDelegate,UIGestureRecognizer
@IBOutlet weak var clickView: UIView! @IBOutlet weak var clickView: UIView!
@IBOutlet weak var webView: WKWebView! @IBOutlet weak var webView: WKWebView!
@IBOutlet weak var adView: UIView!
var startTimeStamp = Date() var startTimeStamp = Date()
typealias btnTappedBlock = () -> Void typealias btnTappedBlock = () -> Void
var btnTapped : btnTappedBlock? var btnTapped : btnTappedBlock?
var bottomBannerView = GADBannerView()
override var prefersStatusBarHidden: Bool { override var prefersStatusBarHidden: Bool {
return true return true
} }
@@ -39,9 +42,11 @@ class GamesWebViewVC: UIViewController, WKNavigationDelegate,UIGestureRecognizer
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
DispatchQueue.main.async { [weak self] in DispatchQueue.main.async { [weak self] in
guard let self else{return} guard let self else{return}
AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBannerView, in: adView, adUnitID: K.GoogleAdIDs.themeTwo, viewController: self)
if let orientation, orientation == .landscape{ if let orientation, orientation == .landscape{
appDelegate.deviceOrientation = .landscapeRight appDelegate.deviceOrientation = .landscapeRight
let value = UIInterfaceOrientation.landscapeRight.rawValue let value = UIInterfaceOrientation.landscapeRight.rawValue
@@ -162,3 +167,37 @@ class GamesWebViewVC: UIViewController, WKNavigationDelegate,UIGestureRecognizer
} }
} }
} }
// MARK: - Google Ad Banner Delegate
extension GamesWebViewVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
print("bannerViewDidReceiveAd")
bannerView.alpha = 0
bannerView.backgroundColor = #colorLiteral(red: 0.01960784314, green: 0, blue: 0.2196078431, alpha: 1)
UIView.animate(withDuration: 1, animations: {
bannerView.alpha = 1
})
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}
func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
print("bannerViewDidRecordImpression")
}
func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
print("bannerViewWillPresentScreen")
}
func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewWillDIsmissScreen")
}
func bannerViewDidDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewDidDismissScreen")
}
}

View File

@@ -588,7 +588,7 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<subviews> <subviews>
<wkWebView contentMode="scaleToFill" allowsLinkPreview="NO" translatesAutoresizingMaskIntoConstraints="NO" id="k9t-dv-nhb"> <wkWebView contentMode="scaleToFill" allowsLinkPreview="NO" translatesAutoresizingMaskIntoConstraints="NO" id="k9t-dv-nhb">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <rect key="frame" x="0.0" y="0.0" width="414" height="744"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<wkWebViewConfiguration key="configuration" allowsAirPlayForMediaPlayback="NO" allowsPictureInPictureMediaPlayback="NO"> <wkWebViewConfiguration key="configuration" allowsAirPlayForMediaPlayback="NO" allowsPictureInPictureMediaPlayback="NO">
<dataDetectorTypes key="dataDetectorTypes" none="YES"/> <dataDetectorTypes key="dataDetectorTypes" none="YES"/>
@@ -596,13 +596,18 @@
<wkPreferences key="preferences" javaScriptCanOpenWindowsAutomatically="YES"/> <wkPreferences key="preferences" javaScriptCanOpenWindowsAutomatically="YES"/>
</wkWebViewConfiguration> </wkWebViewConfiguration>
</wkWebView> </wkWebView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Kme-E0-ysm">
<rect key="frame" x="0.0" y="746" width="414" height="150"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</subviews> </subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="trailing" secondItem="k9t-dv-nhb" secondAttribute="trailing" id="280-OD-igM"/> <constraint firstAttribute="trailing" secondItem="k9t-dv-nhb" secondAttribute="trailing" id="280-OD-igM"/>
<constraint firstAttribute="bottom" secondItem="k9t-dv-nhb" secondAttribute="bottom" id="LwL-cf-cGz"/>
<constraint firstItem="k9t-dv-nhb" firstAttribute="top" secondItem="UBq-Ug-nVj" secondAttribute="top" id="OLz-JE-Ule"/> <constraint firstItem="k9t-dv-nhb" firstAttribute="top" secondItem="UBq-Ug-nVj" secondAttribute="top" id="OLz-JE-Ule"/>
<constraint firstItem="k9t-dv-nhb" firstAttribute="leading" secondItem="UBq-Ug-nVj" secondAttribute="leading" id="XhR-Si-hmd"/> <constraint firstItem="k9t-dv-nhb" firstAttribute="leading" secondItem="UBq-Ug-nVj" secondAttribute="leading" id="XhR-Si-hmd"/>
<constraint firstAttribute="bottom" secondItem="Kme-E0-ysm" secondAttribute="bottom" id="jmT-2e-teQ"/>
<constraint firstItem="Kme-E0-ysm" firstAttribute="top" secondItem="k9t-dv-nhb" secondAttribute="bottom" constant="2" id="uKZ-yF-y2X"/>
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Qp-yb-i2l"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Qp-yb-i2l">
@@ -631,12 +636,16 @@
<constraint firstItem="UBq-Ug-nVj" firstAttribute="top" secondItem="8Dy-BS-4tC" secondAttribute="top" id="9CL-yd-6Hq"/> <constraint firstItem="UBq-Ug-nVj" firstAttribute="top" secondItem="8Dy-BS-4tC" secondAttribute="top" id="9CL-yd-6Hq"/>
<constraint firstItem="UBq-Ug-nVj" firstAttribute="leading" secondItem="UAe-my-8xP" secondAttribute="leading" id="9hb-Yg-ACx"/> <constraint firstItem="UBq-Ug-nVj" firstAttribute="leading" secondItem="UAe-my-8xP" secondAttribute="leading" id="9hb-Yg-ACx"/>
<constraint firstItem="7Qp-yb-i2l" firstAttribute="top" secondItem="UAe-my-8xP" secondAttribute="top" constant="10" id="Oxh-34-kbI"/> <constraint firstItem="7Qp-yb-i2l" firstAttribute="top" secondItem="UAe-my-8xP" secondAttribute="top" constant="10" id="Oxh-34-kbI"/>
<constraint firstItem="Kme-E0-ysm" firstAttribute="leading" secondItem="UAe-my-8xP" secondAttribute="leading" id="VYI-NP-6PJ"/>
<constraint firstAttribute="bottom" secondItem="UBq-Ug-nVj" secondAttribute="bottom" id="lOx-rP-1sz"/> <constraint firstAttribute="bottom" secondItem="UBq-Ug-nVj" secondAttribute="bottom" id="lOx-rP-1sz"/>
<constraint firstItem="7Qp-yb-i2l" firstAttribute="leading" secondItem="UAe-my-8xP" secondAttribute="leading" constant="7" id="otO-uz-8gX"/> <constraint firstItem="7Qp-yb-i2l" firstAttribute="leading" secondItem="UAe-my-8xP" secondAttribute="leading" constant="7" id="otO-uz-8gX"/>
<constraint firstItem="UAe-my-8xP" firstAttribute="trailing" secondItem="Kme-E0-ysm" secondAttribute="trailing" id="vVM-pz-oEN"/>
<constraint firstItem="Kme-E0-ysm" firstAttribute="height" secondItem="8Dy-BS-4tC" secondAttribute="height" multiplier="0.167411" id="w7p-w4-jTu"/>
<constraint firstItem="UBq-Ug-nVj" firstAttribute="trailing" secondItem="UAe-my-8xP" secondAttribute="trailing" id="xcS-Cj-AOE"/> <constraint firstItem="UBq-Ug-nVj" firstAttribute="trailing" secondItem="UAe-my-8xP" secondAttribute="trailing" id="xcS-Cj-AOE"/>
</constraints> </constraints>
</view> </view>
<connections> <connections>
<outlet property="adView" destination="Kme-E0-ysm" id="Tgg-so-4PW"/>
<outlet property="clickView" destination="UBq-Ug-nVj" id="AR4-7x-xFq"/> <outlet property="clickView" destination="UBq-Ug-nVj" id="AR4-7x-xFq"/>
<outlet property="webView" destination="k9t-dv-nhb" id="3fK-U0-3Dd"/> <outlet property="webView" destination="k9t-dv-nhb" id="3fK-U0-3Dd"/>
</connections> </connections>

View File

@@ -0,0 +1,61 @@
//
// AdReusable.swift
// WOKA
//
// Created by MacBook Pro on 16/09/24.
//
import UIKit
import GoogleMobileAds
class AdReusable {
// Singleton instance
static let sharedInstance = AdReusable()
// Private init to prevent creating additional instances
private init() {}
// Function to set up banner ads with an existing banner view
func setupBannerAd(bannerView: GADBannerView, in containerView: UIView, adUnitID: String, viewController: GADBannerViewDelegate & UIViewController, height: CGFloat? = 0.0, width: CGFloat? = 0.0) {
// Adjust the view width and height based on provided values
let viewWidth = containerView.frame.inset(by: containerView.safeAreaInsets).width - (width ?? 0)
let viewHeight = containerView.frame.height - (height ?? 0)
// Create the adaptive banner size
// let adaptiveSize = GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(viewWidth)
let adaptiveSize = GADPortraitInlineAdaptiveBannerAdSizeWithWidth(viewWidth)
bannerView.adSize = adaptiveSize
// Set the delegate to handle banner events
bannerView.delegate = viewController
// Adjust the banner's frame
bannerView.frame = CGRect(x: 0, y: 0, width: viewWidth, height: viewHeight)
// Center the banner within the containerView
bannerView.center = CGPoint(x: containerView.frame.width / 2, y: containerView.frame.height / 2)
// If height is provided, add rounded corners
if let heightValue = height, heightValue > 0 {
bannerView.layer.cornerRadius = 2
bannerView.clipsToBounds = true
}
// Add the banner view to the container
containerView.addSubview(bannerView)
// Set the ad unit ID and root view controller for the banner
bannerView.adUnitID = adUnitID
bannerView.rootViewController = viewController
// Load the ad request
bannerView.load(GADRequest())
// Ensure the layout is updated
bannerView.layoutIfNeeded()
}
}

View File

@@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>API_KEY_ID</key> <key>API_KEY_ID</key>
<string>$(API_KEY_ID)</string> <string>$(API_KEY_ID)</string>
<key>API_KEY_PASS</key> <key>API_KEY_PASS</key>

View File

@@ -9,6 +9,7 @@ import UIKit
import JWPlayerKit import JWPlayerKit
import AVFAudio import AVFAudio
import AVFoundation import AVFoundation
import GoogleMobileAds
class JWKaraokePlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate { class JWKaraokePlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate {
@@ -22,6 +23,8 @@ class JWKaraokePlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate
@IBOutlet weak var outerStack : UIStackView! @IBOutlet weak var outerStack : UIStackView!
@IBOutlet weak var retryKaraokeBtn: LocalisedElementsButton! @IBOutlet weak var retryKaraokeBtn: LocalisedElementsButton!
@IBOutlet weak var adView: UIView!
var config: JWPlayerConfiguration! var config: JWPlayerConfiguration!
var dismissTapped: (() -> Void)? var dismissTapped: (() -> Void)?
@@ -51,6 +54,7 @@ class JWKaraokePlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate
playerView.captionStyle = .none playerView.captionStyle = .none
self.view.bringSubviewToFront(outerStack) self.view.bringSubviewToFront(outerStack)
self.view.bringSubviewToFront(backButton) self.view.bringSubviewToFront(backButton)
self.view.bringSubviewToFront(adView)
// Add observers // Add observers
NotificationCenter.default.addObserver(self,selector: #selector(appDidEnterBackground),name: UIApplication.didEnterBackgroundNotification,object: nil) NotificationCenter.default.addObserver(self,selector: #selector(appDidEnterBackground),name: UIApplication.didEnterBackgroundNotification,object: nil)
@@ -347,6 +351,34 @@ extension JWKaraokePlayerVC {
} }
} }
// MARK: - Google Ad Banner Delegate
extension JWKaraokePlayerVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
print("bannerViewDidReceiveAd")
bannerView.backgroundColor = #colorLiteral(red: 0.01960784314, green: 0, blue: 0.2196078431, alpha: 1)
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}
func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
print("bannerViewDidRecordImpression")
}
func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
print("bannerViewWillPresentScreen")
}
func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewWillDIsmissScreen")
}
func bannerViewDidDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewDidDismissScreen")
}
}
//OLD Code //OLD Code
//private var audioEngine: AVAudioEngine! //private var audioEngine: AVAudioEngine!

View File

@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import GoogleMobileAds
class KaraokeListingVC: UIViewController { class KaraokeListingVC: UIViewController {
@@ -129,8 +130,14 @@ class KaraokeListingVC: UIViewController {
*/ */
vm.pageNo = 0 vm.pageNo = 0
noDataStack.isHidden = true noDataStack.isHidden = true
headerTitleLabel.isHidden = false
headerBtn.isHidden = false
vm.startShimmer() vm.startShimmer()
vm.getKaraokeListing() vm.getKaraokeListing()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: { [weak self] in
guard let self else{return}
vm.checkAds()
})
} }
} }
@@ -312,6 +319,55 @@ extension KaraokeListingVC : ReloadSeriesFavLike{
} }
} }
// MARK: - Google Ad Banner Delegate
extension KaraokeListingVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
switch bannerView{
case vm.headerBannerView:
headerView.stopShimmer()
case vm.headerBannerBottomView:
headerBtn.alpha = 0
headerBtn.isEnabled = false
selectedShowView.stopShimmer()
default:
break
}
print("bannerViewDidReceiveAd")
bannerView.backgroundColor = #colorLiteral(red: 0.01960784314, green: 0, blue: 0.2196078431, alpha: 1)
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
switch bannerView{
case vm.headerBannerView:
headerView.stopShimmer()
case vm.headerBannerBottomView:
headerTitleLabel.isHidden = true
headerBtn.isHidden = true
selectedShowView.stopShimmer()
default:
break
}
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}
func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
print("bannerViewDidRecordImpression")
}
func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
print("bannerViewWillPresentScreen")
}
func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewWillDIsmissScreen")
}
func bannerViewDidDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewDidDismissScreen")
}
}
// MARK: - Animating scrollView // MARK: - Animating scrollView
extension KaraokeListingVC: UIScrollViewDelegate { extension KaraokeListingVC: UIScrollViewDelegate {

View File

@@ -763,6 +763,13 @@
</stackView> </stackView>
</subviews> </subviews>
</stackView> </stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XDD-DO-5GP">
<rect key="frame" x="5" y="128" width="404" height="140"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="140" id="WCG-7C-BhF"/>
</constraints>
</view>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="fhs-yV-fEZ"/> <viewLayoutGuide key="safeArea" id="fhs-yV-fEZ"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -770,11 +777,15 @@
<constraint firstItem="yek-VM-Cus" firstAttribute="centerY" secondItem="fhs-yV-fEZ" secondAttribute="centerY" constant="200" id="0CQ-IK-CSM"/> <constraint firstItem="yek-VM-Cus" firstAttribute="centerY" secondItem="fhs-yV-fEZ" secondAttribute="centerY" constant="200" id="0CQ-IK-CSM"/>
<constraint firstItem="yek-VM-Cus" firstAttribute="leading" secondItem="fhs-yV-fEZ" secondAttribute="leading" constant="20" id="0qJ-R4-ZTb"/> <constraint firstItem="yek-VM-Cus" firstAttribute="leading" secondItem="fhs-yV-fEZ" secondAttribute="leading" constant="20" id="0qJ-R4-ZTb"/>
<constraint firstItem="Nuf-TE-5LZ" firstAttribute="top" secondItem="fhs-yV-fEZ" secondAttribute="top" constant="15" id="7jB-UT-Xqq"/> <constraint firstItem="Nuf-TE-5LZ" firstAttribute="top" secondItem="fhs-yV-fEZ" secondAttribute="top" constant="15" id="7jB-UT-Xqq"/>
<constraint firstItem="XDD-DO-5GP" firstAttribute="top" secondItem="Nuf-TE-5LZ" secondAttribute="bottom" constant="20" id="LGq-aG-tZc"/>
<constraint firstItem="fhs-yV-fEZ" firstAttribute="trailing" secondItem="yek-VM-Cus" secondAttribute="trailing" constant="20" id="Omt-Ig-58p"/> <constraint firstItem="fhs-yV-fEZ" firstAttribute="trailing" secondItem="yek-VM-Cus" secondAttribute="trailing" constant="20" id="Omt-Ig-58p"/>
<constraint firstItem="Nuf-TE-5LZ" firstAttribute="leading" secondItem="fhs-yV-fEZ" secondAttribute="leading" constant="10" id="Tcl-yf-D2V"/> <constraint firstItem="Nuf-TE-5LZ" firstAttribute="leading" secondItem="fhs-yV-fEZ" secondAttribute="leading" constant="10" id="Tcl-yf-D2V"/>
<constraint firstItem="XDD-DO-5GP" firstAttribute="leading" secondItem="fhs-yV-fEZ" secondAttribute="leading" constant="5" id="U0b-N4-Qqs"/>
<constraint firstItem="fhs-yV-fEZ" firstAttribute="trailing" secondItem="XDD-DO-5GP" secondAttribute="trailing" constant="5" id="rIF-aH-16u"/>
</constraints> </constraints>
</view> </view>
<connections> <connections>
<outlet property="adView" destination="XDD-DO-5GP" id="5LU-xH-njl"/>
<outlet property="backButton" destination="Nuf-TE-5LZ" id="syG-po-xEv"/> <outlet property="backButton" destination="Nuf-TE-5LZ" id="syG-po-xEv"/>
<outlet property="downloadRecordingBtn" destination="3Ui-AF-Hlc" id="9TA-QY-4xw"/> <outlet property="downloadRecordingBtn" destination="3Ui-AF-Hlc" id="9TA-QY-4xw"/>
<outlet property="karaokeLoading" destination="Vsm-wu-cKE" id="GBV-UM-lT7"/> <outlet property="karaokeLoading" destination="Vsm-wu-cKE" id="GBV-UM-lT7"/>

View File

@@ -8,6 +8,7 @@
import UIKit import UIKit
import AVFAudio import AVFAudio
import AVFoundation import AVFoundation
import GoogleMobileAds
class JWKaraokePlayerVM{ class JWKaraokePlayerVM{
@@ -27,8 +28,11 @@ class JWKaraokePlayerVM{
var endTime : TimeInterval? var endTime : TimeInterval?
var startTimeStamp = Date() var startTimeStamp = Date()
var headerBannerView = GADBannerView()
func initView(){ func initView(){
AdReusable.sharedInstance.setupBannerAd(bannerView: self.headerBannerView, in: vc.adView, adUnitID: K.GoogleAdIDs.themeTwo, viewController: self.vc)
startTimeStamp = Date() startTimeStamp = Date()
vc.downloadRecordingBtn.isEnabled = false vc.downloadRecordingBtn.isEnabled = false
hideShowKaraoke(isLoading: true) hideShowKaraoke(isLoading: true)
@@ -47,7 +51,7 @@ class JWKaraokePlayerVM{
func setupKaraoke(){ func setupKaraoke(){
guard let videoUrl else{return} guard let videoUrl else{return}
let avURL = URL(string: videoUrl)! let avURL = URL(string: "https://content.jwplatform.com/videos/699dmCGz-UwFX5S0R.mp4")!
let asset = AVAsset(url: avURL) let asset = AVAsset(url: avURL)
hideShowKaraoke(isLoading: true) hideShowKaraoke(isLoading: true)
let outputURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("\(videoTitle?.trimmingCharacters(in: .whitespaces) ?? "extractedAudio").m4a") let outputURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("\(videoTitle?.trimmingCharacters(in: .whitespaces) ?? "extractedAudio").m4a")

View File

@@ -7,6 +7,7 @@
import UIKit import UIKit
import Alamofire import Alamofire
import GoogleMobileAds
class KaraokeListingVM{ class KaraokeListingVM{
@@ -19,6 +20,9 @@ class KaraokeListingVM{
var pageNo = 0 var pageNo = 0
var maxHeaderHeight = 0.0 var maxHeaderHeight = 0.0
var headerBannerView = GADBannerView()
var headerBannerBottomView = GADBannerView()
func initView(){ func initView(){
setupCell() setupCell()
vc.scrollView.indicatorStyle = .white // or .white vc.scrollView.indicatorStyle = .white // or .white
@@ -33,6 +37,11 @@ class KaraokeListingVM{
//Set banner height //Set banner height
maxHeaderHeight = UIScreen.main.bounds.width * 0.55 maxHeaderHeight = UIScreen.main.bounds.width * 0.55
vc.headerHeight.constant = maxHeaderHeight vc.headerHeight.constant = maxHeaderHeight
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: { [weak self] in
guard let self else{return}
checkAds()
})
} }
func setupCell(){ func setupCell(){
@@ -67,6 +76,40 @@ class KaraokeListingVM{
} }
} }
func checkAds(){
/*
This is test ad.
*/
/*
MAke logic for ads
*/
if let adsData = AuthFunc.shareInstance.adsData, let webSeriesAd = adsData.result?.filter({$0.forPage == AdsEnum.karaoke.rawValue}).first{
// check if ads data contains ad for webseries
if let bannerImage = webSeriesAd.bannerImage, let buttonImage = webSeriesAd.buttonImage{
vc.headerImage.imageURL(bannerImage, color: .white)
vc.headerBtn.setTitle("", for: .normal)
vc.headerTitleLabel.text = ""
vc.headerViewLabelHeight.constant = 10
vc.headerBtn.backgroundColor = .clear
vc.headerBtn.sd_setBackgroundImage(with: URL(string:buttonImage), for: .normal)
vc.headerImage.addTapGesture {
if let adID = webSeriesAd.id{
PersistentStorage.shared.addAdsCount(adID: adID ,clicks: 1)
}
if let adLink = webSeriesAd.adLink ,let url = URL(string: adLink), UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
}
}
}
}else{
AdReusable.sharedInstance.setupBannerAd(bannerView: self.headerBannerView, in: vc.headerView, adUnitID: K.GoogleAdIDs.themeTwo, viewController: self.vc)
AdReusable.sharedInstance.setupBannerAd(bannerView: self.headerBannerBottomView, in: vc.selectedShowView, adUnitID: K.GoogleAdIDs.themeTwo, viewController: self.vc, height: 8, width: 15)
}
}
// MARK: - GetKaraoke Listing // MARK: - GetKaraoke Listing
func getContinueWatching(){ func getContinueWatching(){
@@ -145,27 +188,27 @@ class KaraokeListingVM{
/* /*
MAke logic for ads MAke logic for ads
*/ */
if let adsData = AuthFunc.shareInstance.adsData{ // if let adsData = AuthFunc.shareInstance.adsData{
// check if ads data contains ad for webseries // // check if ads data contains ad for webseries
if let karaokeAd = adsData.result?.filter({$0.forPage == AdsEnum.karaoke.rawValue}).first, let bannerImage = karaokeAd.bannerImage, let buttonImage = karaokeAd.buttonImage{ // if let karaokeAd = adsData.result?.filter({$0.forPage == AdsEnum.karaoke.rawValue}).first, let bannerImage = karaokeAd.bannerImage, let buttonImage = karaokeAd.buttonImage{
vc.headerImage.imageURL(bannerImage, color: .white) // vc.headerImage.imageURL(bannerImage, color: .white)
vc.headerBtn.setTitle("", for: .normal) // vc.headerBtn.setTitle("", for: .normal)
vc.headerTitleLabel.text = "" // vc.headerTitleLabel.text = ""
vc.headerViewLabelHeight.constant = 10 // vc.headerViewLabelHeight.constant = 10
vc.headerBtn.backgroundColor = .clear // vc.headerBtn.backgroundColor = .clear
vc.headerBtn.sd_setBackgroundImage(with: URL(string:buttonImage), for: .normal) // vc.headerBtn.sd_setBackgroundImage(with: URL(string:buttonImage), for: .normal)
}else{ // }else{
if !isBtnClick{ // if !isBtnClick{
self.headerData = self.karaokeListData.first // self.headerData = self.karaokeListData.first
setHeaderData() // setHeaderData()
} // }
} // }
}else{ // }else{
if !isBtnClick{ // if !isBtnClick{
self.headerData = self.karaokeListData.first // self.headerData = self.karaokeListData.first
setHeaderData() // setHeaderData()
} // }
} // }
self.stopShimmer() self.stopShimmer()

View File

@@ -8,6 +8,7 @@
import UIKit import UIKit
import AVFoundation import AVFoundation
import Alamofire import Alamofire
import GoogleMobileAds
class WokaFMVC: UIViewController { class WokaFMVC: UIViewController {
@@ -219,6 +220,38 @@ extension UIButton {
} }
} }
// MARK: - Google Ad Banner Delegate
extension WokaFMVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
print("bannerViewDidReceiveAd")
bannerView.alpha = 0
bannerView.backgroundColor = #colorLiteral(red: 0.01960784314, green: 0, blue: 0.2196078431, alpha: 1)
UIView.animate(withDuration: 1, animations: {
bannerView.alpha = 1
})
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}
func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
print("bannerViewDidRecordImpression")
}
func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
print("bannerViewWillPresentScreen")
}
func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewWillDIsmissScreen")
}
func bannerViewDidDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewDidDismissScreen")
}
}
////Update system volume ////Update system volume
//extension MPVolumeView { //extension MPVolumeView {

View File

@@ -17,7 +17,8 @@ class WokaFMVM{
var playerItem: AVPlayerItem! var playerItem: AVPlayerItem!
var startTimeStamp = Date() var startTimeStamp = Date()
var bottomBannerView = GADBannerView()
func initView(){ func initView(){
startTimeStamp = Date() startTimeStamp = Date()
vc.mainView.roundCorners(radius: 10, corners: [.topLeft, .topRight]) vc.mainView.roundCorners(radius: 10, corners: [.topLeft, .topRight])
@@ -43,26 +44,15 @@ class WokaFMVM{
self.vc.dismiss(animated: true) self.vc.dismiss(animated: true)
} }
var bannerView = GADBannerView()
let viewWidth = vc.adView.frame.inset(by: vc.adView.safeAreaInsets).width
// Here the current interface orientation is used. Use
// GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth or
// GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth if you prefer to load an ad of a
// particular orientation,
let adaptiveSize = GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(viewWidth)
bannerView = GADBannerView(adSize: adaptiveSize)
bannerView.center = vc.adView.center /*
Show google ads with dispatch queue.
bannerView.frame = CGRect(x: 0, y: 0, width: vc.adView.frame.width, height: vc.adView.frame.height) */
vc.adView.addSubview(bannerView) DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: { [weak self] in
bannerView.adUnitID = K.GoogleAdIDs.themeTwo guard let self else{return}
bannerView.rootViewController = self.vc AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBannerView, in: vc.adView, adUnitID: K.GoogleAdIDs.themeTwo, viewController: self.vc)
bannerView.load(GADRequest()) vc.adView.isHidden = false
bannerView.layoutIfNeeded() })
vc.adView.isHidden = false
} }
// MARK: - Setup AV & Player // MARK: - Setup AV & Player

View File

@@ -133,9 +133,9 @@
<constraint firstItem="QCY-ib-bFw" firstAttribute="top" secondItem="hI6-1V-MUR" secondAttribute="top" constant="4" id="xPq-57-EFe"/> <constraint firstItem="QCY-ib-bFw" firstAttribute="top" secondItem="hI6-1V-MUR" secondAttribute="top" constant="4" id="xPq-57-EFe"/>
</constraints> </constraints>
</view> </view>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IEh-tF-XpP"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IEh-tF-XpP">
<rect key="frame" x="0.0" y="280" width="393" height="100"/> <rect key="frame" x="0.0" y="280" width="393" height="100"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="100" id="qDR-Bj-46Y"/> <constraint firstAttribute="height" constant="100" id="qDR-Bj-46Y"/>
</constraints> </constraints>

View File

@@ -6,6 +6,7 @@
// //
import UIKit import UIKit
import GoogleMobileAds
protocol ReloadSeriesFavLike{ protocol ReloadSeriesFavLike{
func updateRows(index : Int, type : FavCellCLick, isFav : Bool? , isLike : Bool?, id : Int?) func updateRows(index : Int, type : FavCellCLick, isFav : Bool? , isLike : Bool?, id : Int?)
@@ -149,6 +150,9 @@ class WebSeriesVC: UIViewController {
PersistentStorage.shared.addOthersCount() PersistentStorage.shared.addOthersCount()
noDataView.isHidden = true noDataView.isHidden = true
// for the first load always send hindi as it is default category // for the first load always send hindi as it is default category
headerViewLabel.isHidden = false
headerBtn.isHidden = false
vm.startShimmer() vm.startShimmer()
vm.checkAds() vm.checkAds()
// showListingTableView.reloadData() // showListingTableView.reloadData()
@@ -419,6 +423,56 @@ extension WebSeriesVC : UICollectionViewDelegateFlowLayout{
} }
// MARK: - Google Ad Banner Delegate
extension WebSeriesVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
switch bannerView{
case vm.headerBannerView:
headerView.stopShimmer()
case vm.masilaBannerView:
headerBtn.alpha = 0
headerBtn.isEnabled = false
masilaTrailerView.stopShimmer()
default:
break
}
print("bannerViewDidReceiveAd")
bannerView.backgroundColor = #colorLiteral(red: 0.01960784314, green: 0, blue: 0.2196078431, alpha: 1)
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
switch bannerView{
case vm.headerBannerView:
headerView.stopShimmer()
case vm.masilaBannerView:
headerViewLabel.isHidden = true
headerBtn.isHidden = true
masilaTrailerView.stopShimmer()
default:
break
}
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}
func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
print("bannerViewDidRecordImpression")
}
func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
print("bannerViewWillPresentScreen")
}
func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewWillDIsmissScreen")
}
func bannerViewDidDismissScreen(_ bannerView: GADBannerView) {
print("bannerViewDidDismissScreen")
}
}
// MARK: - Animating scrollView // MARK: - Animating scrollView
extension WebSeriesVC: UIScrollViewDelegate { extension WebSeriesVC: UIScrollViewDelegate {

View File

@@ -29,6 +29,9 @@ class WebSeriesVM{
var maxHeaderHeight = 0.0 var maxHeaderHeight = 0.0
var headerBannerView = GADBannerView()
var masilaBannerView = GADBannerView()
func initView(){ func initView(){
// let heightMultiplier: CGFloat = 0.257511 // let heightMultiplier: CGFloat = 0.257511
@@ -115,25 +118,49 @@ class WebSeriesVM{
} }
} }
}else{ }else{
var bannerView = GADBannerView() DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: { [weak self] in
guard let self else{return}
let viewWidth = vc.headerView.frame.inset(by: vc.headerView.safeAreaInsets).width AdReusable.sharedInstance.setupBannerAd(bannerView: self.headerBannerView, in: vc.headerView, adUnitID: K.GoogleAdIDs.themeTwo, viewController: self.vc)
AdReusable.sharedInstance.setupBannerAd(bannerView: self.masilaBannerView, in: vc.masilaTrailerView, adUnitID: K.GoogleAdIDs.themeTwo, viewController: self.vc, height: 8, width: 15)
// Here the current interface orientation is used. Use })
// GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth or // let viewWidth = vc.headerView.frame.inset(by: vc.headerView.safeAreaInsets).width
// GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth if you prefer to load an ad of a //
// particular orientation, // // Here the current interface orientation is used. Use
let adaptiveSize = GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(viewWidth) // // GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth or
bannerView = GADBannerView(adSize: adaptiveSize) // // GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth if you prefer to load an ad of a
// // particular orientation,
bannerView.center = vc.headerView.center // let adaptiveSize = GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(viewWidth)
// headerBannerView = GADBannerView(adSize: adaptiveSize)
bannerView.frame = CGRect(x: 0, y: 0, width: vc.headerView.frame.width, height: vc.headerView.frame.height) // headerBannerView.delegate = self.vc
vc.headerView.addSubview(bannerView) // headerBannerView.center = vc.headerView.center
bannerView.adUnitID = K.GoogleAdIDs.themeTwo //
bannerView.rootViewController = self.vc // headerBannerView.frame = CGRect(x: 0, y: 0, width: vc.headerView.frame.width, height: vc.headerView.frame.height)
bannerView.load(GADRequest()) // vc.headerView.addSubview(headerBannerView)
bannerView.layoutIfNeeded() // headerBannerView.adUnitID = "K.GoogleAdIDs.themeTwo"
// headerBannerView.rootViewController = self.vc
// headerBannerView.load(GADRequest())
// headerBannerView.layoutIfNeeded()
//
// var bannerView2 = GADBannerView()
//
// let viewWidth2 = vc.masilaTrailerView.frame.inset(by: vc.masilaTrailerView.safeAreaInsets).width
//
// // Here the current interface orientation is used. Use
// // GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth or
// // GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth if you prefer to load an ad of a
// // particular orientation,
// let adaptiveSize2 = GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(viewWidth2)
// bannerView2 = GADBannerView(adSize: adaptiveSize2)
//
// bannerView2.center = vc.masilaTrailerView.center
//
// bannerView2.frame = CGRect(x: 0, y: 0, width: vc.masilaTrailerView.frame.width, height: vc.masilaTrailerView.frame.height)
// vc.masilaTrailerView.addSubview(bannerView2)
// bannerView2.adUnitID = K.GoogleAdIDs.themeTwo
// bannerView2.rootViewController = self.vc
// bannerView2.load(GADRequest())
// bannerView2.layoutIfNeeded()
} }
} }

View File

@@ -476,7 +476,7 @@
<rect key="frame" x="377.66666666666669" y="0.0" width="32.333333333333314" height="49"/> <rect key="frame" x="377.66666666666669" y="0.0" width="32.333333333333314" height="49"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="hand.thumbsup.fill" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="eng-oC-d9H"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="hand.thumbsup.fill" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="eng-oC-d9H">
<rect key="frame" x="0.0" y="0.66666666666666785" width="20" height="47.666666666666657"/> <rect key="frame" x="0.0" y="0.66666666666666785" width="20" height="47.666666666666671"/>
<color key="tintColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="tintColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</imageView> </imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Egv-Cu-aPK"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Egv-Cu-aPK">