- Worked on my list and notification bottom Banner

- Tc - 69 fixed
- Tc - 70 fixed
- TC 71 fixed
- Added local ads to fm and more section
- Added local ads to mylist
- Fixed a bug for sync
* Fixed the crashing by temporary updating the wokastaging with raw data
This commit is contained in:
2024-10-01 19:57:04 +05:30
parent fedcf71ada
commit 7efcbb2d24
24 changed files with 749 additions and 418 deletions

View File

@@ -2895,7 +2895,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = WOKA/WOKA.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 3;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4S9A74ZB6H;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -2939,7 +2939,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = WOKA/WOKA.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = 4S9A74ZB6H;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;

View File

@@ -37,6 +37,7 @@ class AudioBookHomeVM{
startShimmer()
setupCell()
getShowListing()
checkAds()
}
@@ -135,7 +136,6 @@ class AudioBookHomeVM{
self.vc.continueWatchingStack.isHidden = true
case 1:
Utilities.dismissProgressHUD()
checkAds()
guard let data = data.data?.result else{return}
if data.count == 0{
@@ -264,7 +264,8 @@ class AudioBookHomeVM{
guard let isFav else{return}
if isFav == true {
// if is fav then remove it
LikeFavCommonFunc.shareInstance.removeFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.removeFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [weak self] isDone in
guard let self else{return}
if isDone{
if let showListIndex = audioListData.firstIndex(where: { $0.id == postID }){
audioListData[showListIndex].markAsFavourite = false
@@ -298,8 +299,9 @@ class AudioBookHomeVM{
}
}
}else{
LikeFavCommonFunc.shareInstance.addFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.addFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [weak self] isDone in
if isDone{
guard let self else{return}
if let showListIndex = audioListData.firstIndex(where: { $0.id == postID }){
audioListData[showListIndex].markAsFavourite = true
vc.audioListingTableView.reloadRows(at: [IndexPath(row: showListIndex, section: 0)],with: .none)
@@ -337,7 +339,8 @@ class AudioBookHomeVM{
guard let isLiked else{return}
if isLiked{
// Unlike
LikeFavCommonFunc.shareInstance.unlikePost(postID: postID, postType: postType, vc: self.vc) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.unlikePost(postID: postID, postType: postType, vc: self.vc) { [weak self] isDone in
guard let self else{return}
if isDone{
if let showListIndex = audioListData.firstIndex(where: { $0.id == postID }){
audioListData[showListIndex].isLiked = false
@@ -367,7 +370,8 @@ class AudioBookHomeVM{
}
}else{
//Like
LikeFavCommonFunc.shareInstance.likePost(postID: postID, postType: postType, vc: self.vc){ [unowned self] isDone in
LikeFavCommonFunc.shareInstance.likePost(postID: postID, postType: postType, vc: self.vc){ [weak self] isDone in
guard let self else{return}
if isDone{
if let showListIndex = audioListData.firstIndex(where: { $0.id == postID }){
audioListData[showListIndex].isLiked = true

View File

@@ -27,6 +27,8 @@ extension K{
static let myListNotifications = "ca-app-pub-5699008063638916/8922510426"
static let blogs = "ca-app-pub-5699008063638916/8441860789"
//
//
//

View File

@@ -286,7 +286,9 @@ final class PersistentStorage
return
} else{
// send data again to server
sendDataToServer()
if result.count != 0{
sendDataToServer(isLogout: isLogout)
}
print("Data sent Again.")
}
@@ -424,7 +426,9 @@ extension PersistentStorage{
return
}else{
// send ads data again to server
if result.count != 0{
sendAdsData()
}
print("Ads Data sent Again.")
}

View File

@@ -213,7 +213,8 @@ class GamesListVM{
case .favourite:
guard let isFav = data.markAsFavourite ,let postID = data.id,let postType = data.contentMoreDetails?.first?.postType else{return}
if isFav == true {
LikeFavCommonFunc.shareInstance.removeFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.removeFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [weak self] isDone in
guard let self else{return}
if isDone{
gameData[index].markAsFavourite = false
vc.gamesListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none)
@@ -228,7 +229,8 @@ class GamesListVM{
}
}
}else{
LikeFavCommonFunc.shareInstance.addFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.addFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [weak self] isDone in
guard let self else{return}
if isDone{
gameData[index].markAsFavourite = true
vc.gamesListingTableView.reloadRows(at: [IndexPath(row: index, section: 0)],with: .none)
@@ -246,7 +248,8 @@ class GamesListVM{
case .liked:
guard let isLiked = data.isLiked ,let postID = data.id,let postType = data.contentMoreDetails?.first?.postType else{return}
if isLiked{
LikeFavCommonFunc.shareInstance.unlikePost(postID: postID, postType: postType, vc: self.vc) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.unlikePost(postID: postID, postType: postType, vc: self.vc) { [weak self] isDone in
guard let self else{return}
if isDone{
gameData[index].isLiked = false
gameData[index].likesCount! -= 1
@@ -264,7 +267,8 @@ class GamesListVM{
}
}
}else{
LikeFavCommonFunc.shareInstance.likePost(postID: postID, postType: postType, vc: self.vc){ [unowned self] isDone in
LikeFavCommonFunc.shareInstance.likePost(postID: postID, postType: postType, vc: self.vc){ [weak self] isDone in
guard let self else{return}
if isDone{
gameData[index].isLiked = true
gameData[index].likesCount! += 1

View File

@@ -41,6 +41,7 @@ class MyListVC: UIViewController{
@IBOutlet weak var shimmerStack: UIStackView!
@IBOutlet var shimmerView: [ShimmerEffectView]!
@IBOutlet weak var adView: UIView!
@IBOutlet weak var adHeight: NSLayoutConstraint!
var vm = MyListVM()
@@ -61,7 +62,8 @@ class MyListVC: UIViewController{
}
@objc func refresh(_ sender: AnyObject) {
Timer.scheduledTimer(withTimeInterval: 1, repeats: false) { [unowned self] _ in
Timer.scheduledTimer(withTimeInterval: 1, repeats: false) { [weak self] _ in
guard let self else{return}
vm.getFavouriteListing()
}
}
@@ -807,10 +809,9 @@ extension MyListVC : UICollectionViewDelegateFlowLayout{
// MARK: - Google Ad Banner Delegate
extension MyListVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
adView.isHidden = false
bannerView.alpha = 0
bannerView.backgroundColor = #colorLiteral(red: 0.01960784314, green: 0, blue: 0.2196078431, alpha: 1)
UIView.animate(withDuration: 0.2, animations: {
bannerView.alpha = 1
})
@@ -818,6 +819,11 @@ extension MyListVC : GADBannerViewDelegate{
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
UIView.animate(withDuration: 0.2, animations: { [weak self] in
guard let self else{return}
bannerView.alpha = 0
adHeight.constant = 0
})
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}

View File

@@ -1071,11 +1071,8 @@
</label>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="R9v-rE-NRk">
<rect key="frame" x="0.0" y="119" width="430" height="725"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SyC-Qw-kzE">
<rect key="frame" x="0.0" y="0.0" width="430" height="725"/>
<rect key="frame" x="0.0" y="121" width="430" height="723"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="45l-57-MA3">
<rect key="frame" x="0.0" y="0.0" width="430" height="1385"/>
@@ -1368,15 +1365,13 @@
<viewLayoutGuide key="contentLayoutGuide" id="ac6-o2-deF"/>
<viewLayoutGuide key="frameLayoutGuide" id="ijh-ix-uLc"/>
</scrollView>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Rrg-6L-VMo">
<rect key="frame" x="0.0" y="0.0" width="430" height="100"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Rrg-6L-VMo">
<rect key="frame" x="0.0" y="844" width="430" height="0.0"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="2WA-Xw-Yxf"/>
<constraint firstAttribute="height" id="2WA-Xw-Yxf"/>
</constraints>
</view>
</subviews>
</stackView>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="25" translatesAutoresizingMaskIntoConstraints="NO" id="Dau-7f-0vb" userLabel="GuestLoginStack">
<rect key="frame" x="20" y="346.66666666666669" width="390" height="214.66666666666669"/>
<subviews>
@@ -1474,15 +1469,12 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="n3b-MP-wOW">
<rect key="frame" x="0.0" y="126" width="430" height="660"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="n3b-MP-wOW">
<rect key="frame" x="0.0" y="126" width="430" height="708"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zVG-vD-Pa9" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="15" y="10" width="400" height="200"/>
<rect key="frame" x="15" y="10" width="400" height="216"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="200" id="BOv-Or-mtr"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="10"/>
@@ -1490,11 +1482,8 @@
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5PD-9x-fXz" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="15" y="230" width="400" height="200"/>
<rect key="frame" x="15" y="246" width="400" height="216"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="200" id="1Hd-rU-zAi"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="10"/>
@@ -1502,11 +1491,8 @@
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LMU-lo-nNz" customClass="ShimmerEffectView" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="15" y="450" width="400" height="200"/>
<rect key="frame" x="15" y="482" width="400" height="216"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="200" id="xlu-qi-KIb"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<integer key="value" value="10"/>
@@ -1523,10 +1509,9 @@
<constraints>
<constraint firstItem="Dau-7f-0vb" firstAttribute="centerY" secondItem="fPD-rO-ZgU" secondAttribute="centerY" id="0rW-IM-pWT"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="a7Y-B6-f0Q" secondAttribute="trailing" constant="15" id="1TC-Nf-fdz"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="R9v-rE-NRk" secondAttribute="trailing" id="4X2-zG-Zll"/>
<constraint firstItem="jbL-QO-JJl" firstAttribute="leading" secondItem="5ML-g4-686" secondAttribute="trailing" constant="15" id="5bI-AA-E64"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="leading" secondItem="R9v-rE-NRk" secondAttribute="leading" id="8SS-M5-jO9"/>
<constraint firstItem="R9v-rE-NRk" firstAttribute="top" secondItem="cxl-Av-gEU" secondAttribute="bottom" constant="3" id="Bcb-dt-tuA"/>
<constraint firstItem="Rrg-6L-VMo" firstAttribute="top" secondItem="n3b-MP-wOW" secondAttribute="bottom" constant="10" id="ACM-Nd-PMA"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="Rrg-6L-VMo" secondAttribute="trailing" id="CkS-3X-HNC"/>
<constraint firstItem="n3b-MP-wOW" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="E1C-E8-97R"/>
<constraint firstItem="n3b-MP-wOW" firstAttribute="trailing" secondItem="fPD-rO-ZgU" secondAttribute="trailing" id="I4g-uI-OU6"/>
<constraint firstItem="fTK-nk-bN9" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="KDZ-vt-s13"/>
@@ -1534,24 +1519,29 @@
<constraint firstItem="cxl-Av-gEU" firstAttribute="bottom" secondItem="a7Y-B6-f0Q" secondAttribute="bottom" constant="7" id="Lur-Ax-w8w"/>
<constraint firstItem="Dau-7f-0vb" firstAttribute="leading" secondItem="23B-pX-ODs" secondAttribute="leading" constant="20" id="M71-ET-eJZ"/>
<constraint firstItem="5ML-g4-686" firstAttribute="leading" secondItem="23B-pX-ODs" secondAttribute="leading" constant="5" id="Na5-Wr-DSa"/>
<constraint firstItem="n3b-MP-wOW" firstAttribute="bottom" relation="lessThanOrEqual" secondItem="fPD-rO-ZgU" secondAttribute="bottom" id="UgR-R8-f7G"/>
<constraint firstItem="SyC-Qw-kzE" firstAttribute="top" secondItem="cxl-Av-gEU" secondAttribute="bottom" constant="5" id="Pp9-XV-Tip"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="bottom" secondItem="Rrg-6L-VMo" secondAttribute="bottom" constant="5" id="VRV-bg-TtW"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="SyC-Qw-kzE" secondAttribute="trailing" id="Wl8-mF-eC2"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="fTK-nk-bN9" secondAttribute="trailing" id="XRW-xO-sGx"/>
<constraint firstItem="cxl-Av-gEU" firstAttribute="top" secondItem="23B-pX-ODs" secondAttribute="top" id="Y0G-Ua-UcP"/>
<constraint firstItem="QHo-nZ-miK" firstAttribute="centerX" secondItem="fPD-rO-ZgU" secondAttribute="centerX" id="ZkK-bD-6Ys"/>
<constraint firstItem="5ML-g4-686" firstAttribute="centerY" secondItem="a7Y-B6-f0Q" secondAttribute="centerY" id="aC4-mQ-heC"/>
<constraint firstAttribute="trailing" secondItem="Dau-7f-0vb" secondAttribute="trailing" constant="20" id="ejF-GB-Yna"/>
<constraint firstItem="Rrg-6L-VMo" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="gLf-nH-NyK"/>
<constraint firstItem="jbL-QO-JJl" firstAttribute="centerY" secondItem="5ML-g4-686" secondAttribute="centerY" constant="-1" id="h8B-5o-mja"/>
<constraint firstItem="cxl-Av-gEU" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="iba-8r-UBq"/>
<constraint firstItem="R9v-rE-NRk" firstAttribute="bottom" secondItem="fPD-rO-ZgU" secondAttribute="bottom" constant="-5" id="kah-7Y-Q6c"/>
<constraint firstItem="QHo-nZ-miK" firstAttribute="centerY" secondItem="fPD-rO-ZgU" secondAttribute="centerY" id="npC-Cx-MHl"/>
<constraint firstItem="SyC-Qw-kzE" firstAttribute="leading" secondItem="fPD-rO-ZgU" secondAttribute="leading" id="sWG-F2-NbZ"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="trailing" secondItem="cxl-Av-gEU" secondAttribute="trailing" id="usz-Hi-BR2"/>
<constraint firstItem="fPD-rO-ZgU" firstAttribute="bottom" secondItem="fTK-nk-bN9" secondAttribute="bottom" constant="-20" id="vmC-a4-Yy3"/>
<constraint firstItem="Rrg-6L-VMo" firstAttribute="top" secondItem="SyC-Qw-kzE" secondAttribute="bottom" id="ws3-JU-UqR"/>
<constraint firstItem="n3b-MP-wOW" firstAttribute="top" secondItem="cxl-Av-gEU" secondAttribute="bottom" constant="10" id="xGm-9v-fwc"/>
</constraints>
</view>
<tabBarItem key="tabBarItem" title="MY LIST" image="HeartIcon" id="dhn-IV-GcD"/>
<navigationItem key="navigationItem" id="dCO-Wi-XFC"/>
<connections>
<outlet property="adHeight" destination="2WA-Xw-Yxf" id="rvv-7V-ouL"/>
<outlet property="adView" destination="Rrg-6L-VMo" id="v99-o1-P5B"/>
<outlet property="audioBooksBtn" destination="f9x-Vl-IXu" id="POf-cl-Ccb"/>
<outlet property="audioBooksCV" destination="ABR-no-OBf" id="axa-Ry-rEx"/>
@@ -1667,10 +1657,10 @@
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<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 name="systemMintColor">
<color red="0.0" green="0.78039215689999997" blue="0.74509803919999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.0" green="0.7803921568627451" blue="0.74509803921568629" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>

View File

@@ -38,6 +38,59 @@ class MyListVM{
return
}
/*
First check if webSeries ad is present via slug, then check for Local Ads, if not then check google ads.
*/
if let adsData = AuthFunc.shareInstance.adsData, let myListAd = adsData.result?.filter({$0.slug == AdsEnum.myList.rawValue}).first{
// check if ads data contains LocalAD for webseries
if let advertisement = myListAd.advertisement,let bannerImage = advertisement.bannerImage{
// vc.imageAdView.imageURL(bannerImage, color: .white)
// vc.imageAdView.alpha = 0
let height = UIScreen.main.bounds.width * 0.192
vc.adHeight.constant = height
let imageView = UIImageView()
// Set the image you want to display
imageView.imageURL(bannerImage, color: .white)
// Enable auto-layout
imageView.translatesAutoresizingMaskIntoConstraints = false
// Add the UIImageView to the view
vc.adView.addSubview(imageView)
// Set UIImageView to match the size of the parent UIView
NSLayoutConstraint.activate([
imageView.leadingAnchor.constraint(equalTo: vc.adView.leadingAnchor),
imageView.trailingAnchor.constraint(equalTo: vc.adView.trailingAnchor),
imageView.topAnchor.constraint(equalTo: vc.adView.topAnchor),
imageView.bottomAnchor.constraint(equalTo: vc.adView.bottomAnchor)
])
imageView.contentMode = .scaleAspectFit
UIView.animate(withDuration: 0.2, animations: { [weak self] in
guard let self else{return}
vc.adView.alpha = 1
})
vc.adView.addTapGesture {
if let adID = myListAd.id{
PersistentStorage.shared.addAdsCount(adID: adID ,clicks: 1)
}
if let adLink = myListAd.advertisement?.adLink ,let url = URL(string: adLink), UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
}
}
}else if myListAd.googleAd != nil{
//setup google banner ads.
vc.adHeight.constant = 90
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3, execute: {
AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBanner, in: self.vc.adView, adUnitID: K.GoogleAdIDs.myListNotifications, viewController: self.vc, height: 6,width: 0)
})
}
}
setupCell()
startShimmer(load: true)
getFavouriteListing()
@@ -59,18 +112,7 @@ class MyListVM{
shimmer.startShimmer()
}else{
shimmer.stopShimmer()
/*
If ads found then only load it or else directly append the data and reload
*/
if let adsData = AuthFunc.shareInstance.adsData{
// check if ads data contains ad for webseries
if let myListAd = adsData.result?.filter({$0.slug == AdsEnum.myList.rawValue}).first, myListAd.googleAd != nil{
//setup google banner ads.
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3, execute: {
AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBanner, in: self.vc.adView, adUnitID: K.GoogleAdIDs.myListNotifications, viewController: self.vc, height: 6,width: 0)
})
}
}
}
}
}

View File

@@ -243,7 +243,8 @@ class KaraokeListingVM{
case .favourite:
guard let isFav else{return}
if isFav == true {
LikeFavCommonFunc.shareInstance.removeFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.removeFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [weak self] isDone in
guard let self else{return}
if isDone{
if let showListIndex = karaokeListData.firstIndex(where: { $0.id == postID }){
karaokeListData[showListIndex].markAsFavourite = false
@@ -278,7 +279,8 @@ class KaraokeListingVM{
}
}
}else{
LikeFavCommonFunc.shareInstance.addFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.addFavourite(postID: postID, postType: postType, categoryID: 0, vc: self.vc) { [weak self] isDone in
guard let self else{return}
if isDone{
if let showListIndex = karaokeListData.firstIndex(where: { $0.id == postID }){
karaokeListData[showListIndex].markAsFavourite = true
@@ -318,7 +320,8 @@ class KaraokeListingVM{
case .liked:
guard let isLiked else{return}
if isLiked{
LikeFavCommonFunc.shareInstance.unlikePost(postID: postID, postType: postType, vc: self.vc) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.unlikePost(postID: postID, postType: postType, vc: self.vc) { [weak self] isDone in
guard let self else{return}
if isDone{
if let showListIndex = karaokeListData.firstIndex(where: { $0.id == postID }){
karaokeListData[showListIndex].isLiked = false
@@ -348,7 +351,8 @@ class KaraokeListingVM{
}
}
}else{
LikeFavCommonFunc.shareInstance.likePost(postID: postID, postType: postType, vc: self.vc){ [unowned self] isDone in
LikeFavCommonFunc.shareInstance.likePost(postID: postID, postType: postType, vc: self.vc){ [weak self] isDone in
guard let self else{return}
if isDone{
if let showListIndex = karaokeListData.firstIndex(where: { $0.id == postID }){
karaokeListData[showListIndex].isLiked = true

View File

@@ -32,6 +32,7 @@ enum AdsEnum : String{
case webSeriesVideoAd = "web-series-video-ad"
case more = "more"
case myList = "my-list"
case shopListing = "shop-listing"
}
class AuthFunc{

View File

@@ -122,17 +122,17 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="OrderBottom" translatesAutoresizingMaskIntoConstraints="NO" id="DtQ-TG-hwD">
<rect key="frame" x="0.0" y="-269.66666666666669" width="393" height="294.66666666666669"/>
<rect key="frame" x="0.0" y="523.33333333333326" width="393" height="294.66666666666674"/>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="JOc-da-KgM">
<rect key="frame" x="0.0" y="59" width="393" height="0.0"/>
<rect key="frame" x="0.0" y="59" width="393" height="793"/>
<subviews>
<tableView 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="NEV-vt-kk0">
<rect key="frame" x="0.0" y="0.0" width="393" height="0.0"/>
<rect key="frame" x="0.0" y="0.0" width="393" height="793"/>
<color key="backgroundColor" red="0.82745098039999998" green="0.93725490199999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
</tableView>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eJP-tZ-U4b">
<rect key="frame" x="0.0" y="0.0" width="393" height="7"/>
<rect key="frame" x="0.0" y="0.0" width="393" height="100"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="IH1-wm-lv7"/>
@@ -299,19 +299,19 @@
<color key="backgroundColor" red="0.82745098039999998" green="0.93725490199999995" blue="0.97254901959999995" alpha="1" colorSpace="calibratedRGB"/>
</view>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="PDw-D2-MIm">
<rect key="frame" x="113.66666666666669" y="318" width="166" height="241.33333333333337"/>
<rect key="frame" x="113.66666666666669" y="318" width="166" height="241"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="SupportGirlImage" translatesAutoresizingMaskIntoConstraints="NO" id="fqC-iZ-FnK">
<rect key="frame" x="0.0" y="0.0" width="166" height="166.33333333333334"/>
<rect key="frame" x="0.0" y="0.0" width="166" height="166"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No Data Found!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WMd-v5-3Bf" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="0.0" y="176.33333333333331" width="166" height="24"/>
<rect key="frame" x="0.0" y="176" width="166" height="24"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" name="TextDarkBlue"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="upB-Eu-Ooo">
<rect key="frame" x="0.0" y="210.33333333333331" width="166" height="31"/>
<rect key="frame" x="0.0" y="210" width="166" height="31"/>
<color key="tintColor" name="TextDarkBlue"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Retry?">
@@ -327,7 +327,7 @@
<rect key="frame" x="0.0" y="557.33333333333348" width="393" height="294.66666666666663"/>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="3" translatesAutoresizingMaskIntoConstraints="NO" id="o04-js-Fsc">
<rect key="frame" x="0.0" y="59" width="393" height="100"/>
<rect key="frame" x="0.0" y="59" width="393" height="759"/>
<subviews>
<scrollView hidden="YES" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wxy-J9-S7w">
<rect key="frame" x="0.0" y="0.0" width="393" height="0.0"/>
@@ -468,7 +468,7 @@
<viewLayoutGuide key="frameLayoutGuide" id="fDN-IE-ujI"/>
</scrollView>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5An-pm-UM9">
<rect key="frame" x="0.0" y="0.0" width="393" height="100"/>
<rect key="frame" x="0.0" y="0.0" width="393" height="759"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews>
@@ -486,7 +486,7 @@
<constraint firstItem="5An-pm-UM9" firstAttribute="height" secondItem="NNP-0A-zEH" secondAttribute="height" multiplier="0.117371" id="7Td-mI-4fw"/>
<constraint firstItem="Sf0-tQ-I1Z" firstAttribute="leading" secondItem="lMc-y6-eRf" secondAttribute="leading" id="CvR-51-mma"/>
<constraint firstAttribute="bottom" secondItem="11o-Wz-oVy" secondAttribute="bottom" id="IUM-Qf-wbF"/>
<constraint firstItem="lMc-y6-eRf" firstAttribute="bottom" secondItem="o04-js-Fsc" secondAttribute="bottom" id="Ioe-Vu-iTK"/>
<constraint firstAttribute="bottom" secondItem="o04-js-Fsc" secondAttribute="bottom" id="Ioe-Vu-iTK"/>
<constraint firstItem="11o-Wz-oVy" firstAttribute="trailing" secondItem="lMc-y6-eRf" secondAttribute="trailing" id="TWL-yC-bnk"/>
<constraint firstItem="PDw-D2-MIm" firstAttribute="centerX" secondItem="lMc-y6-eRf" secondAttribute="centerX" id="gM9-yg-ZFf"/>
<constraint firstItem="o04-js-Fsc" firstAttribute="trailing" secondItem="lMc-y6-eRf" secondAttribute="trailing" id="kFn-fd-4dc"/>

View File

@@ -117,10 +117,10 @@ class SideMenuVC: UIViewController {
/*
Make sure all data is synced to the server for click data & ad impressions
*/
vm.checkData()
PersistentStorage.shared.sendAdsData(isLogout: true)
PersistentStorage.shared.sendDataToServer(isLogout: true)
Utilities.startProgressHUD(msg: "Syncing...")
vm.checkData()
// self.timer.
case .no:

View File

@@ -73,7 +73,8 @@ class TabBarVC: UITabBarController {
vcPush.contentLabel = "By clicking the button below, your account will be deactivated. Your data will be erased after one month."
vcPush.yesBtnText = "Deactivate"
vcPush.noBtnText = "Cancel"
vcPush.onDoneBlock = { [unowned self] mode in
vcPush.onDoneBlock = { [weak self] mode in
guard let self else{return}
switch mode{
case .yes:
//If user clicked nav him to login screen. Call the api.
@@ -229,7 +230,8 @@ class TabBarVC: UITabBarController {
self.customTabBarView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
self.customTabBarView.layer.masksToBounds = false
self.customTabBarView.layer.shadowColor = UIColor.red.withAlphaComponent(0.8).cgColor
// self.customTabBarView.layer.shadowColor = UIColor.red.withAlphaComponent(0.8).cgColor
self.customTabBarView.layer.shadowColor = UIColor.gray.withAlphaComponent(0.7).cgColor
self.customTabBarView.layer.shadowOffset = CGSize(width: -4, height: -6)
self.customTabBarView.layer.shadowOpacity = 0.5
self.customTabBarView.layer.shadowRadius = 20

View File

@@ -571,17 +571,23 @@
<constraint firstAttribute="height" constant="45" id="zp2-aZ-QTM"/>
</constraints>
</view>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="McL-5g-B8j">
<rect key="frame" x="0.0" y="45" width="414" height="220"/>
<constraints>
<constraint firstAttribute="height" constant="220" id="qbi-tz-gsi"/>
</constraints>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="U0W-18-4oe">
<rect key="frame" x="0.0" y="45" width="414" height="222.5"/>
<rect key="frame" x="0.0" y="45" width="414" height="224"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Coming Soon on WOKA" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D2p-c5-usH" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="10" y="10" width="394" height="22.5"/>
<rect key="frame" x="10" y="10" width="394" height="24"/>
<fontDescription key="fontDescription" name="Exo2-Bold" family="Exo 2" pointSize="20"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UKc-92-GPa">
<rect key="frame" x="10" y="42.5" width="394" height="180"/>
<rect key="frame" x="10" y="44" width="394" height="180"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="MasilaComingSoon" translatesAutoresizingMaskIntoConstraints="NO" id="Kj9-jH-Y88">
<rect key="frame" x="7" y="7" width="380" height="140"/>
@@ -643,7 +649,7 @@
<edgeInsets key="layoutMargins" top="10" left="10" bottom="0.0" right="10"/>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Qcq-yj-AzB">
<rect key="frame" x="0.0" y="267.5" width="414" height="209"/>
<rect key="frame" x="0.0" y="269" width="414" height="209"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="BLOGS" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lW0-W4-2hl" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="10" y="10" width="394" height="24"/>
@@ -669,7 +675,7 @@
<edgeInsets key="layoutMargins" top="10" left="10" bottom="0.0" right="10"/>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="pJu-fq-XmG">
<rect key="frame" x="0.0" y="476.5" width="414" height="322.5"/>
<rect key="frame" x="0.0" y="478" width="414" height="321"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="WOKA Songs" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FSJ-QT-rAW" customClass="LocalisedElementsLabel" customModule="WOKA" customModuleProvider="target">
<rect key="frame" x="10" y="10" width="394" height="24"/>
@@ -678,7 +684,7 @@
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" 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="31Z-fz-1ec">
<rect key="frame" x="10" y="44" width="394" height="278.5"/>
<rect key="frame" x="10" y="44" width="394" height="277"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableView>
</subviews>
@@ -687,7 +693,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="7bh-PD-sIH">
<rect key="frame" x="164.5" y="439.5" width="85" height="20"/>
<rect key="frame" x="164.5" y="441" width="85" height="20"/>
<subviews>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="medium" translatesAutoresizingMaskIntoConstraints="NO" id="S8Q-xR-4aq">
<rect key="frame" x="0.0" y="0.0" width="85" height="20"/>
@@ -718,7 +724,7 @@
</constraints>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="xv5-81-JIV">
<rect key="frame" x="164.5" y="708" width="85" height="20"/>
<rect key="frame" x="164.5" y="708.5" width="85" height="20"/>
<subviews>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="medium" translatesAutoresizingMaskIntoConstraints="NO" id="dLn-zw-LM2">
<rect key="frame" x="0.0" y="0.0" width="85" height="20"/>
@@ -771,6 +777,8 @@
<outlet property="blogRetryBtn" destination="aPf-ys-h6r" id="fRu-AA-2ti"/>
<outlet property="blogRetryStack" destination="7bh-PD-sIH" id="F4y-Fk-af0"/>
<outlet property="blogsCollectionView" destination="xup-gW-Kjh" id="BO7-LF-aAg"/>
<outlet property="customAdHeight" destination="qbi-tz-gsi" id="3Xd-4K-Pan"/>
<outlet property="customAdImage" destination="McL-5g-B8j" id="aqi-cZ-ReN"/>
<outlet property="homeBtn" destination="4TT-Wr-ovV" id="mPm-rr-jvC"/>
<outlet property="songActivityIndicator" destination="dLn-zw-LM2" id="qZm-9Z-va8"/>
<outlet property="songRetry" destination="zAr-x7-tdY" id="0TO-oQ-fEw"/>
@@ -791,11 +799,23 @@
<view key="view" contentMode="scaleToFill" id="U8N-8z-auR">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="Db8-ro-w0q">
<rect key="frame" x="0.0" y="63" width="414" height="833"/>
<subviews>
<tableView 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="4Jz-rO-ToO">
<rect key="frame" x="0.0" y="63" width="414" height="799"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="833"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</tableView>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jiP-Bp-oG5">
<rect key="frame" x="0.0" y="0.0" width="414" height="100"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="mG7-Co-R8y"/>
</constraints>
</view>
</subviews>
</stackView>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="5iZ-Hr-WYt">
<rect key="frame" x="104" y="332" width="206" height="246"/>
<subviews>
@@ -833,14 +853,16 @@
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="5iZ-Hr-WYt" firstAttribute="centerX" secondItem="HwS-aW-IIl" secondAttribute="centerX" id="8XX-Fi-e5E"/>
<constraint firstItem="4Jz-rO-ToO" firstAttribute="leading" secondItem="HwS-aW-IIl" secondAttribute="leading" id="Pwc-fY-ijS"/>
<constraint firstItem="Db8-ro-w0q" firstAttribute="leading" secondItem="HwS-aW-IIl" secondAttribute="leading" id="Kab-Cl-2qT"/>
<constraint firstItem="Db8-ro-w0q" firstAttribute="top" secondItem="HwS-aW-IIl" secondAttribute="top" constant="15" id="OkJ-d1-Qot"/>
<constraint firstItem="Db8-ro-w0q" firstAttribute="bottom" secondItem="U8N-8z-auR" secondAttribute="bottom" id="Pgv-Rq-nA4"/>
<constraint firstItem="5iZ-Hr-WYt" firstAttribute="centerY" secondItem="HwS-aW-IIl" secondAttribute="centerY" id="XyJ-qZ-IcC"/>
<constraint firstItem="HwS-aW-IIl" firstAttribute="trailing" secondItem="4Jz-rO-ToO" secondAttribute="trailing" id="pPA-fS-veG"/>
<constraint firstItem="HwS-aW-IIl" firstAttribute="bottom" secondItem="4Jz-rO-ToO" secondAttribute="bottom" id="x2e-Ns-hm9"/>
<constraint firstItem="4Jz-rO-ToO" firstAttribute="top" secondItem="HwS-aW-IIl" secondAttribute="top" constant="15" id="zIS-dJ-FOj"/>
<constraint firstItem="Db8-ro-w0q" firstAttribute="trailing" secondItem="HwS-aW-IIl" secondAttribute="trailing" id="z0P-j5-e9x"/>
</constraints>
</view>
<connections>
<outlet property="adView" destination="jiP-Bp-oG5" id="MhV-eX-Ne8"/>
<outlet property="adViewHeight" destination="mG7-Co-R8y" id="Wbv-eB-OMz"/>
<outlet property="noDataStack" destination="5iZ-Hr-WYt" id="TzW-oN-ZPU"/>
<outlet property="tableView" destination="4Jz-rO-ToO" id="AgO-yU-AtX"/>
</connections>
@@ -1193,8 +1215,8 @@
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="ZSR-bh-wqJ">
<rect key="frame" x="0.0" y="58" width="414" height="804"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="CPI-Sd-MIf">
<rect key="frame" x="0.0" y="0.0" width="414" height="676"/>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="CPI-Sd-MIf">
<rect key="frame" x="0.0" y="0.0" width="414" height="804"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="X8i-uF-7dA">
<size key="itemSize" width="128" height="128"/>
@@ -1204,10 +1226,12 @@
</collectionViewFlowLayout>
<cells/>
</collectionView>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="aFI-x1-1GD">
<rect key="frame" x="0.0" y="676" width="414" height="128"/>
<color key="backgroundColor" red="0.035294117649999998" green="0.0" blue="0.36470588240000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="aQC-Wm-HT0">
<rect key="frame" x="0.0" y="0.0" width="414" height="90"/>
<constraints>
<constraint firstAttribute="height" constant="90" id="ir7-aq-vhI"/>
</constraints>
</imageView>
</subviews>
</stackView>
<stackView hidden="YES" opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="Nqj-wh-mOZ">
@@ -1263,6 +1287,8 @@
</view>
<connections>
<outlet property="blogCV" destination="CPI-Sd-MIf" id="uEI-y6-hiB"/>
<outlet property="imageAdHeight" destination="ir7-aq-vhI" id="Pkp-03-0Y3"/>
<outlet property="imageAdView" destination="aQC-Wm-HT0" id="hC5-nT-yk0"/>
<outlet property="noDataStack" destination="Nqj-wh-mOZ" id="tx5-Mj-77M"/>
</connections>
</viewController>

View File

@@ -6,13 +6,17 @@
//
import UIKit
import GoogleMobileAds
class BlogsVC: UIViewController {
@IBOutlet weak var blogCV: UICollectionView!
@IBOutlet weak var noDataStack: UIStackView!
@IBOutlet weak var imageAdView: UIImageView!
@IBOutlet weak var imageAdHeight: NSLayoutConstraint!
var blogData = [BlogDM.Blog]()
var bottomBannerView = GADBannerView()
override func viewDidLoad() {
super.viewDidLoad()
@@ -25,6 +29,43 @@ class BlogsVC: UIViewController {
self.view.applyGradient(colors: [color2, color1], startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 0.8, y: 0))
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
navigationController?.navigationBar.shadowImage = UIImage()
/*
First check if webSeries ad is present via slug, then check for Local Ads, if not then check google ads.
*/
if let adsData = AuthFunc.shareInstance.adsData, let blogAd = adsData.result?.filter({$0.slug == AdsEnum.shopListing.rawValue}).first{
// check if ads data contains LocalAD for webseries
if let advertisement = blogAd.advertisement,let bannerImage = advertisement.bannerImage{
imageAdView.imageURL(bannerImage, color: .white)
imageAdView.alpha = 0
let height = UIScreen.main.bounds.width * 0.192
imageAdHeight.constant = height
UIView.animate(withDuration: 0.2, animations: { [weak self] in
guard let self else{return}
imageAdView.alpha = 1
imageAdView.isHidden = false
})
imageAdView.addTapGesture {
if let adID = blogAd.id{
PersistentStorage.shared.addAdsCount(adID: adID ,clicks: 1)
}
if let adLink = blogAd.advertisement?.adLink ,let url = URL(string: adLink), UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
}
}
}else if blogAd.googleAd != nil{
/*
Show google ads with dispatch queue.
*/
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: { [weak self] in
guard let self else{return}
AdReusable.sharedInstance.setupBannerAd(bannerView: bottomBannerView, in: imageAdView, adUnitID: K.GoogleAdIDs.blogs, viewController: self)
})
}
}
}
override func viewWillAppear(_ animated: Bool) {
@@ -139,3 +180,39 @@ extension BlogsVC : UICollectionViewDelegateFlowLayout{
return CGSize(width: widthPerItem, height: widthPerItem)
}
}
// MARK: - Google Ad Banner Delegate
extension BlogsVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
bannerView.alpha = 0
bannerView.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
UIView.animate(withDuration: 0.3, animations: { [weak self] in
guard let self else{return}
bannerView.alpha = 1
imageAdView.isHidden = false
})
print("bannerViewDidReceiveAd")
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
imageAdView.isHidden = true
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

@@ -24,6 +24,8 @@ class MoreVC: UIViewController {
@IBOutlet weak var songRetry: LocalisedElementsButton!
@IBOutlet weak var trailerTask: UIStackView!
@IBOutlet weak var trailerView: UIView!
@IBOutlet weak var customAdImage: UIImageView!
@IBOutlet weak var customAdHeight: NSLayoutConstraint!
var vm = MoreVM()
var timeObserverToken: Any?
@@ -243,7 +245,8 @@ extension MoreVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
bannerView.alpha = 0
bannerView.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
UIView.animate(withDuration: 0.3, animations: { [unowned self] in
UIView.animate(withDuration: 0.3, animations: { [weak self] in
guard let self else{return}
trailerView.alpha = 0
bannerView.alpha = 1
})

View File

@@ -6,13 +6,14 @@
//
import UIKit
import GoogleMobileAds
class UserNotificationVC: UIViewController {
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var noDataStack: UIStackView!
@IBOutlet weak var adView: UIView!
@IBOutlet weak var adViewHeight: NSLayoutConstraint!
var vm = UserNotificationVM()
@@ -20,13 +21,10 @@ class UserNotificationVC: UIViewController {
super.viewDidLoad()
vm.vc = self
vm.initView()
navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
navigationController?.navigationBar.shadowImage = UIImage()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: animated)
@@ -99,3 +97,43 @@ extension UserNotificationVC : TableViewSRC{
}
}
}
// MARK: - Google Ad Banner Delegate
extension UserNotificationVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
adView.isHidden = false
bannerView.alpha = 0
UIView.animate(withDuration: 0.2, animations: {
bannerView.alpha = 1
})
print("bannerViewDidReceiveAd")
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
UIView.animate(withDuration: 0.2, animations: { [weak self] in
guard let self else{return}
bannerView.alpha = 0
self.adView.isHidden = false
})
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

@@ -53,8 +53,42 @@ class MoreVM{
}
}
if let adsData = AuthFunc.shareInstance.adsData, let moreAd = adsData.result?.filter({$0.slug == AdsEnum.more.rawValue}).first, moreAd.googleAd != nil{
/*
First check if webSeries ad is present via slug, then check for Local Ads, if not then check google ads.
*/
if let adsData = AuthFunc.shareInstance.adsData, let moreAd = adsData.result?.filter({$0.slug == AdsEnum.more.rawValue}).first{
// check if ads data contains LocalAD for webseries
if let advertisement = moreAd.advertisement,let bannerImage = advertisement.bannerImage{
vc.customAdImage.imageURL(bannerImage, color: .white)
vc.customAdImage.alpha = 0
let height = UIScreen.main.bounds.width * 0.55
vc.customAdHeight.constant = height
vc.trailerTask.isHidden = true
vc.customAdImage.isHidden = false
UIView.animate(withDuration: 0.2, animations: { [weak self] in
guard let self else{return}
vc.customAdImage.alpha = 1
})
vc.customAdImage.addTapGesture {
if let adID = moreAd.id{
PersistentStorage.shared.addAdsCount(adID: adID ,clicks: 1)
}
if let adLink = moreAd.advertisement?.adLink ,let url = URL(string: adLink), UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
}
}
}else if moreAd.googleAd != nil{
/*
Show google ads with dispatch queue.
*/
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: { [weak self] in
guard let self else{return}
AdReusable.sharedInstance.setupBannerAd(bannerView: headerBannerView, in: vc.trailerTask, adUnitID: K.GoogleAdIDs.splashBanner2, viewController: self.vc, height: 5, width: 15)
})
}
}
}
@@ -292,7 +326,9 @@ extension MoreVM{
let commandCenter = MPRemoteCommandCenter.shared()
// Enable play command
commandCenter.playCommand.addTarget { [unowned self] event in
commandCenter.playCommand.addTarget { [weak self] event in
guard let self else{return .commandFailed}
if player?.rate == 0.0 {
player?.play()
return .success
@@ -301,7 +337,9 @@ extension MoreVM{
}
// Enable pause command
commandCenter.pauseCommand.addTarget { [unowned self] event in
commandCenter.pauseCommand.addTarget { [weak self] event in
guard let self else{return .commandFailed}
if player?.rate == 1.0 {
// player?.pause()
if let currentIndexPlayingSong{

View File

@@ -51,7 +51,7 @@ class ThemeOneVM{
func initView(){
GoogleInterstistialADSetup.shareInstance.setupGoogleIntersitialAD()
// requestIDFA()
requestIDFA()
AuthFunc.shareInstance.initTimePeriods()
startInitialTimer()
// moveCloudView()

View File

@@ -7,6 +7,7 @@
import UIKit
import Alamofire
import GoogleMobileAds
class UserNotificationVM{
@@ -14,6 +15,7 @@ class UserNotificationVM{
var userNotification = [UserNotificationDM]()
let refreshControl = UIRefreshControl()
let feedbackGenerator = UIImpactFeedbackGenerator(style: .light)
var bottomBanner = GADBannerView()
func initView(){
let color1 = #colorLiteral(red: 0.05490196078, green: 0.01176470588, blue: 0.3882352941, alpha: 1)
@@ -29,6 +31,60 @@ class UserNotificationVM{
refreshControl.tintColor = .white
refreshControl.addTarget(self, action: #selector(self.refresh(_:)), for: .valueChanged)
vc.tableView.addSubview(refreshControl)
/*
First check if webSeries ad is present via slug, then check for Local Ads, if not then check google ads.
*/
if let adsData = AuthFunc.shareInstance.adsData, let notificatonAd = adsData.result?.filter({$0.slug == AdsEnum.myList.rawValue}).first{
// check if ads data contains LocalAD for webseries
if let advertisement = notificatonAd.advertisement,let bannerImage = advertisement.bannerImage{
let height = UIScreen.main.bounds.width * 0.192
vc.adViewHeight.constant = height
vc.adView.alpha = 0
let imageView = UIImageView()
// Set the image you want to display
imageView.imageURL(bannerImage, color: .white)
// Enable auto-layout
imageView.translatesAutoresizingMaskIntoConstraints = false
// Add the UIImageView to the view
vc.adView.addSubview(imageView)
// Set UIImageView to match the size of the parent UIView
NSLayoutConstraint.activate([
imageView.leadingAnchor.constraint(equalTo: vc.adView.leadingAnchor),
imageView.trailingAnchor.constraint(equalTo: vc.adView.trailingAnchor),
imageView.topAnchor.constraint(equalTo: vc.adView.topAnchor),
imageView.bottomAnchor.constraint(equalTo: vc.adView.bottomAnchor)
])
imageView.contentMode = .scaleAspectFit
UIView.animate(withDuration: 0.2, animations: { [weak self] in
guard let self else{return}
vc.adView.alpha = 1
vc.adView.isHidden = false
})
vc.adView.addTapGesture {
if let adID = notificatonAd.id{
PersistentStorage.shared.addAdsCount(adID: adID ,clicks: 1)
}
if let adLink = notificatonAd.advertisement?.adLink ,let url = URL(string: adLink), UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
}
}
}else if notificatonAd.googleAd != nil{
/*
Show google ads with dispatch queue.
*/
//setup google banner ads.
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3, execute: {
AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBanner, in: self.vc.adView, adUnitID: K.GoogleAdIDs.myListNotifications, viewController: self.vc, height: 6,width: 0)
})
}
}
}
func setupCell(){

View File

@@ -19,7 +19,8 @@ class WokaFMVC: UIViewController {
@IBOutlet weak var volMinusBtnn: UIButton!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
@IBOutlet weak var blackView: UIView!
@IBOutlet weak var adView: UIView!
@IBOutlet weak var imageAdView: UIImageView!
@IBOutlet weak var imageAdHeight: NSLayoutConstraint!
var vm = WokaFMVM()
@@ -65,8 +66,6 @@ class WokaFMVC: UIViewController {
}
}
@objc func appWillEnterForeground(){
vm.stopMPNowPlayin()
}
@@ -242,15 +241,19 @@ extension UIButton {
extension WokaFMVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
print("bannerViewDidReceiveAd")
adView.isHidden = false
imageAdView.isHidden = false
bannerView.alpha = 0
bannerView.backgroundColor = #colorLiteral(red: 0.01960784314, green: 0, blue: 0.2196078431, alpha: 1)
UIView.animate(withDuration: 0.2, animations: {
bannerView.alpha = 1
})
}
func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
UIView.animate(withDuration: 0.2, animations: { [weak self] in
guard let self else{return}
bannerView.alpha = 0
imageAdView.isHidden = true
})
print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
}

View File

@@ -102,7 +102,8 @@ class WokaFMVM{
let commandCenter = MPRemoteCommandCenter.shared()
// Enable play command
commandCenter.playCommand.addTarget { [unowned self] event in
commandCenter.playCommand.addTarget { [weak self] event in
guard let self else{return .commandFailed}
if player.rate == 0.0 {
player.play()
return .success
@@ -111,7 +112,8 @@ class WokaFMVM{
}
// Enable pause command
commandCenter.pauseCommand.addTarget { [unowned self] event in
commandCenter.pauseCommand.addTarget { [weak self] event in
guard let self else{return .commandFailed}
if player.rate == 1.0 {
player.pause()
return .success
@@ -154,16 +156,41 @@ class WokaFMVM{
func setGoogleAd(){
if let adsData = AuthFunc.shareInstance.adsData, let fmAd = adsData.result?.filter({$0.slug == AdsEnum.fm.rawValue}).first, fmAd.googleAd != nil{
/*
First check if webSeries ad is present via slug, then check for Local Ads, if not then check google ads.
*/
if let adsData = AuthFunc.shareInstance.adsData, let fmAd = adsData.result?.filter({$0.slug == AdsEnum.fm.rawValue}).first{
// check if ads data contains LocalAD for webseries
if let advertisement = fmAd.advertisement,let bannerImage = advertisement.bannerImage{
vc.imageAdView.imageURL(bannerImage, color: .white)
vc.imageAdView.alpha = 0
let height = UIScreen.main.bounds.width * 0.192
vc.imageAdHeight.constant = height
UIView.animate(withDuration: 0.2, animations: { [weak self] in
guard let self else{return}
vc.imageAdView.alpha = 1
vc.imageAdView.isHidden = false
})
vc.imageAdView.addTapGesture {
if let adID = fmAd.id{
PersistentStorage.shared.addAdsCount(adID: adID ,clicks: 1)
}
if let adLink = fmAd.advertisement?.adLink ,let url = URL(string: adLink), UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
}
}
}else{
/*
Show google ads with dispatch queue.
*/
DispatchQueue.main.asyncAfter(deadline: .now() + 0.8, execute: { [weak self] in
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3, execute: { [weak self] in
guard let self else{return}
AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBannerView, in: vc.adView, adUnitID: K.GoogleAdIDs.wokaFM, viewController: self.vc)
AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBannerView, in: vc.imageAdView, adUnitID: K.GoogleAdIDs.wokaFM, viewController: self.vc)
})
}
}
}
// MARK: - Setup AV & Player

View File

@@ -153,13 +153,12 @@
<constraint firstAttribute="trailing" secondItem="RH0-xQ-zUi" secondAttribute="trailing" id="xbH-kE-W5r"/>
</constraints>
</view>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="IEh-tF-XpP">
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="7j5-ca-d4P">
<rect key="frame" x="0.0" y="0.0" width="393" height="100"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="e7j-5I-ing"/>
<constraint firstAttribute="height" constant="100" id="OYG-5T-sWE"/>
</constraints>
</view>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
@@ -188,8 +187,9 @@
</view>
<connections>
<outlet property="activityIndicator" destination="cnz-PV-85Z" id="iyM-Kv-Wiu"/>
<outlet property="adView" destination="IEh-tF-XpP" id="Txy-PR-TyV"/>
<outlet property="blackView" destination="ezz-dQ-HXQ" id="Cf0-Kd-uci"/>
<outlet property="imageAdHeight" destination="OYG-5T-sWE" id="cej-o8-zHJ"/>
<outlet property="imageAdView" destination="7j5-ca-d4P" id="YKs-MO-Ry3"/>
<outlet property="mainView" destination="5fM-ca-UBK" id="Lpo-rO-4gm"/>
<outlet property="playBtn" destination="JBl-cN-PnX" id="FWa-0w-oaU"/>
<outlet property="roundView" destination="V0i-Kx-TXO" id="lX7-RL-7t0"/>

View File

@@ -201,7 +201,8 @@ extension WebSeriesVC : TableViewSRC{
if let categoryIds = data.favouriteCategoryIDS?.rawValue {
let components = categoryIds.components(separatedBy: ",")
if isFav == true && (components.first == categoryID.toString() || components.last == categoryID.toString()){
LikeFavCommonFunc.shareInstance.removeFavourite(postID: postID, postType: postType, categoryID: categoryID, vc: self) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.removeFavourite(postID: postID, postType: postType, categoryID: categoryID, vc: self) { [weak self] isDone in
guard let self else{return}
if isDone{
vm.showData[index].markAsFavourite = false
vm.showData[index].favouriteCategoryIDS = ValueWrapper.stringValue("")
@@ -229,7 +230,8 @@ extension WebSeriesVC : TableViewSRC{
}
}
}else{
LikeFavCommonFunc.shareInstance.addFavourite(postID: postID, postType: postType, categoryID: categoryID, vc: self) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.addFavourite(postID: postID, postType: postType, categoryID: categoryID, vc: self) { [weak self] isDone in
guard let self else{return}
if isDone{
vm.showData[index].markAsFavourite = true
vm.showData[index].favouriteCategoryIDS = ValueWrapper.stringValue(categoryID.toString())
@@ -263,7 +265,8 @@ extension WebSeriesVC : TableViewSRC{
case .liked:
guard let isLiked = data.isLiked ,let postID = data.id,let postType = data.contentMoreDetails?.first?.postType else{return}
if isLiked{
LikeFavCommonFunc.shareInstance.unlikePost(postID: postID, postType: postType, vc: self) { [unowned self] isDone in
LikeFavCommonFunc.shareInstance.unlikePost(postID: postID, postType: postType, vc: self) { [weak self] isDone in
guard let self else{return}
if isDone{
vm.showData[index].isLiked = false
vm.showData[index].likesCount! -= 1
@@ -283,7 +286,8 @@ extension WebSeriesVC : TableViewSRC{
}
}
}else{
LikeFavCommonFunc.shareInstance.likePost(postID: postID, postType: postType, vc: self){ [unowned self] isDone in
LikeFavCommonFunc.shareInstance.likePost(postID: postID, postType: postType, vc: self){ [weak self] isDone in
guard let self else{return}
if isDone{
vm.showData[index].isLiked = true
vm.showData[index].likesCount! += 1