TopOn
This commit is contained in:
parent
5ff1070967
commit
a1c2bffd98
8
Podfile
8
Podfile
@ -30,8 +30,12 @@ target 'wallpaper_project' do
|
||||
pod 'Firebase/AnalyticsWithoutAdIdSupport'
|
||||
pod 'FirebaseRemoteConfig'
|
||||
|
||||
pod 'MintegralAdSDK/BidNativeAd'
|
||||
pod 'MintegralAdSDK/BidNewInterstitialAd'
|
||||
# pod 'MintegralAdSDK/BidNativeAd'
|
||||
# pod 'MintegralAdSDK/BidNewInterstitialAd'
|
||||
|
||||
pod 'TPNiOS','6.3.57'
|
||||
pod 'TPNMintegralSDKAdapter','6.3.57'
|
||||
|
||||
|
||||
# pod "Facebook-iOS-SDK"
|
||||
pod 'FBSDKCoreKit'
|
||||
|
||||
@ -17,16 +17,7 @@
|
||||
752FFF8E2C48F4E400FDA982 /* WA_RankCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 752FFF8D2C48F4E400FDA982 /* WA_RankCollectionViewCell.xib */; };
|
||||
752FFF8F2C48F4E400FDA982 /* WA_RankCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752FFF8C2C48F4E400FDA982 /* WA_RankCollectionViewCell.swift */; };
|
||||
752FFF922C48FEBE00FDA982 /* rank.json in Resources */ = {isa = PBXBuildFile; fileRef = 752FFF912C48FEBE00FDA982 /* rank.json */; };
|
||||
752FFFBA2C49118700FDA982 /* WA_playerVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 752FFFB92C49118700FDA982 /* WA_playerVC.xib */; };
|
||||
752FFFBB2C49118700FDA982 /* WA_playerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752FFFB82C49118700FDA982 /* WA_playerVC.swift */; };
|
||||
755EC36C2C4A378400919ACB /* WA_player4kVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 755EC36A2C4A378400919ACB /* WA_player4kVC.swift */; };
|
||||
755EC36D2C4A378400919ACB /* WA_player4kVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 755EC36B2C4A378400919ACB /* WA_player4kVC.xib */; };
|
||||
755EC3702C4A469A00919ACB /* WA_playerRankVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 755EC36E2C4A469A00919ACB /* WA_playerRankVC.swift */; };
|
||||
755EC3712C4A469A00919ACB /* WA_playerRankVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 755EC36F2C4A469A00919ACB /* WA_playerRankVC.xib */; };
|
||||
755EC3742C4A4F3600919ACB /* WA_CommunityPlayerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 755EC3722C4A4F3600919ACB /* WA_CommunityPlayerVC.swift */; };
|
||||
755EC3752C4A4F3600919ACB /* WA_CommunityPlayerVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 755EC3732C4A4F3600919ACB /* WA_CommunityPlayerVC.xib */; };
|
||||
755EC3782C4A517500919ACB /* WA_AddPlayerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 755EC3762C4A517500919ACB /* WA_AddPlayerVC.swift */; };
|
||||
755EC3792C4A517500919ACB /* WA_AddPlayerVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 755EC3772C4A517500919ACB /* WA_AddPlayerVC.xib */; };
|
||||
7565BDC42C5D10B9004602CA /* initializationTopOn.m in Sources */ = {isa = PBXBuildFile; fileRef = 7565BDC32C5D10B9004602CA /* initializationTopOn.m */; };
|
||||
757DA8B82C1BE33E0046CAB6 /* stringADID.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757DA8B72C1BE33D0046CAB6 /* stringADID.swift */; };
|
||||
759BB0602BABE3EC001C0031 /* loanding.json in Resources */ = {isa = PBXBuildFile; fileRef = 759BB05F2BABE3EC001C0031 /* loanding.json */; };
|
||||
759BB0622BAD35D7001C0031 /* loadProgress.json in Resources */ = {isa = PBXBuildFile; fileRef = 759BB0612BAD35D6001C0031 /* loadProgress.json */; };
|
||||
@ -81,6 +72,25 @@
|
||||
75A8F14B2BB57C2D004B0F5C /* WA_MonRankngCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75A8F1492BB57C2D004B0F5C /* WA_MonRankngCell.xib */; };
|
||||
75A8F14E2BB66017004B0F5C /* WA_SCVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75A8F14C2BB66016004B0F5C /* WA_SCVC.swift */; };
|
||||
75A8F14F2BB66017004B0F5C /* WA_SCVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75A8F14D2BB66016004B0F5C /* WA_SCVC.xib */; };
|
||||
75AF74652C6067B700C1DB9C /* LUXTopOnVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75AF74632C6067B700C1DB9C /* LUXTopOnVC.swift */; };
|
||||
75AF74682C60682200C1DB9C /* LUXToponManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75AF74672C60682200C1DB9C /* LUXToponManager.swift */; };
|
||||
75AF746A2C60685600C1DB9C /* LUXTopOnConfigure.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75AF74692C60685600C1DB9C /* LUXTopOnConfigure.swift */; };
|
||||
75AF746C2C606C2A00C1DB9C /* LUXNetWorkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75AF746B2C606C2A00C1DB9C /* LUXNetWorkManager.swift */; };
|
||||
75AF746F2C609F1C00C1DB9C /* OneVc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75AF746E2C609F1C00C1DB9C /* OneVc.swift */; };
|
||||
75AF74712C609F2400C1DB9C /* twovc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75AF74702C609F2400C1DB9C /* twovc.swift */; };
|
||||
75AF74732C609F3000C1DB9C /* threeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75AF74722C609F3000C1DB9C /* threeVC.swift */; };
|
||||
75AF74782C60A8E200C1DB9C /* LUXTopbtnVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75AF74762C60A8E200C1DB9C /* LUXTopbtnVC.swift */; };
|
||||
75AF74792C60A8E200C1DB9C /* LUXTopbtnVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75AF74772C60A8E200C1DB9C /* LUXTopbtnVC.xib */; };
|
||||
75B1CD3F2C6E0DD50092ED40 /* WA_AddPlayerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B1CD342C6E0DD40092ED40 /* WA_AddPlayerVC.swift */; };
|
||||
75B1CD402C6E0DD50092ED40 /* WA_AddPlayerVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B1CD352C6E0DD40092ED40 /* WA_AddPlayerVC.xib */; };
|
||||
75B1CD412C6E0DD50092ED40 /* WA_CommunityPlayerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B1CD362C6E0DD40092ED40 /* WA_CommunityPlayerVC.swift */; };
|
||||
75B1CD422C6E0DD50092ED40 /* WA_CommunityPlayerVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B1CD372C6E0DD40092ED40 /* WA_CommunityPlayerVC.xib */; };
|
||||
75B1CD432C6E0DD50092ED40 /* WA_player4kVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B1CD382C6E0DD40092ED40 /* WA_player4kVC.swift */; };
|
||||
75B1CD442C6E0DD50092ED40 /* WA_player4kVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B1CD392C6E0DD40092ED40 /* WA_player4kVC.xib */; };
|
||||
75B1CD452C6E0DD50092ED40 /* WA_playerRankVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B1CD3A2C6E0DD40092ED40 /* WA_playerRankVC.swift */; };
|
||||
75B1CD462C6E0DD50092ED40 /* WA_playerRankVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B1CD3B2C6E0DD40092ED40 /* WA_playerRankVC.xib */; };
|
||||
75B1CD472C6E0DD50092ED40 /* WA_playerVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B1CD3C2C6E0DD40092ED40 /* WA_playerVC.swift */; };
|
||||
75B1CD482C6E0DD50092ED40 /* WA_playerVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = 75B1CD3D2C6E0DD40092ED40 /* WA_playerVC.xib */; };
|
||||
75D453892C0EE875003B6B24 /* idfaManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75D453882C0EE875003B6B24 /* idfaManager.swift */; };
|
||||
75D4538C2C0EE949003B6B24 /* ipManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75D4538B2C0EE949003B6B24 /* ipManager.swift */; };
|
||||
75D4538F2C0EFE3A003B6B24 /* NetworkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75D4538E2C0EFE3A003B6B24 /* NetworkManager.swift */; };
|
||||
@ -163,16 +173,8 @@
|
||||
752FFF8C2C48F4E400FDA982 /* WA_RankCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WA_RankCollectionViewCell.swift; sourceTree = "<group>"; };
|
||||
752FFF8D2C48F4E400FDA982 /* WA_RankCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WA_RankCollectionViewCell.xib; sourceTree = "<group>"; };
|
||||
752FFF912C48FEBE00FDA982 /* rank.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = rank.json; sourceTree = "<group>"; };
|
||||
752FFFB82C49118700FDA982 /* WA_playerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WA_playerVC.swift; sourceTree = "<group>"; };
|
||||
752FFFB92C49118700FDA982 /* WA_playerVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WA_playerVC.xib; sourceTree = "<group>"; };
|
||||
755EC36A2C4A378400919ACB /* WA_player4kVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WA_player4kVC.swift; sourceTree = "<group>"; };
|
||||
755EC36B2C4A378400919ACB /* WA_player4kVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WA_player4kVC.xib; sourceTree = "<group>"; };
|
||||
755EC36E2C4A469A00919ACB /* WA_playerRankVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WA_playerRankVC.swift; sourceTree = "<group>"; };
|
||||
755EC36F2C4A469A00919ACB /* WA_playerRankVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WA_playerRankVC.xib; sourceTree = "<group>"; };
|
||||
755EC3722C4A4F3600919ACB /* WA_CommunityPlayerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WA_CommunityPlayerVC.swift; sourceTree = "<group>"; };
|
||||
755EC3732C4A4F3600919ACB /* WA_CommunityPlayerVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WA_CommunityPlayerVC.xib; sourceTree = "<group>"; };
|
||||
755EC3762C4A517500919ACB /* WA_AddPlayerVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WA_AddPlayerVC.swift; sourceTree = "<group>"; };
|
||||
755EC3772C4A517500919ACB /* WA_AddPlayerVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WA_AddPlayerVC.xib; sourceTree = "<group>"; };
|
||||
7565BDC22C5D10B9004602CA /* initializationTopOn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = initializationTopOn.h; sourceTree = "<group>"; };
|
||||
7565BDC32C5D10B9004602CA /* initializationTopOn.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = initializationTopOn.m; sourceTree = "<group>"; };
|
||||
757DA8B72C1BE33D0046CAB6 /* stringADID.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = stringADID.swift; sourceTree = "<group>"; };
|
||||
759BB05F2BABE3EC001C0031 /* loanding.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = loanding.json; sourceTree = "<group>"; };
|
||||
759BB0612BAD35D6001C0031 /* loadProgress.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = loadProgress.json; sourceTree = "<group>"; };
|
||||
@ -227,6 +229,25 @@
|
||||
75A8F1492BB57C2D004B0F5C /* WA_MonRankngCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WA_MonRankngCell.xib; sourceTree = "<group>"; };
|
||||
75A8F14C2BB66016004B0F5C /* WA_SCVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WA_SCVC.swift; sourceTree = "<group>"; };
|
||||
75A8F14D2BB66016004B0F5C /* WA_SCVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WA_SCVC.xib; sourceTree = "<group>"; };
|
||||
75AF74632C6067B700C1DB9C /* LUXTopOnVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LUXTopOnVC.swift; sourceTree = "<group>"; };
|
||||
75AF74672C60682200C1DB9C /* LUXToponManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LUXToponManager.swift; sourceTree = "<group>"; };
|
||||
75AF74692C60685600C1DB9C /* LUXTopOnConfigure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LUXTopOnConfigure.swift; sourceTree = "<group>"; };
|
||||
75AF746B2C606C2A00C1DB9C /* LUXNetWorkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LUXNetWorkManager.swift; sourceTree = "<group>"; };
|
||||
75AF746E2C609F1C00C1DB9C /* OneVc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OneVc.swift; sourceTree = "<group>"; };
|
||||
75AF74702C609F2400C1DB9C /* twovc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = twovc.swift; sourceTree = "<group>"; };
|
||||
75AF74722C609F3000C1DB9C /* threeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = threeVC.swift; sourceTree = "<group>"; };
|
||||
75AF74762C60A8E200C1DB9C /* LUXTopbtnVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LUXTopbtnVC.swift; sourceTree = "<group>"; };
|
||||
75AF74772C60A8E200C1DB9C /* LUXTopbtnVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LUXTopbtnVC.xib; sourceTree = "<group>"; };
|
||||
75B1CD342C6E0DD40092ED40 /* WA_AddPlayerVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WA_AddPlayerVC.swift; sourceTree = "<group>"; };
|
||||
75B1CD352C6E0DD40092ED40 /* WA_AddPlayerVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WA_AddPlayerVC.xib; sourceTree = "<group>"; };
|
||||
75B1CD362C6E0DD40092ED40 /* WA_CommunityPlayerVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WA_CommunityPlayerVC.swift; sourceTree = "<group>"; };
|
||||
75B1CD372C6E0DD40092ED40 /* WA_CommunityPlayerVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WA_CommunityPlayerVC.xib; sourceTree = "<group>"; };
|
||||
75B1CD382C6E0DD40092ED40 /* WA_player4kVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WA_player4kVC.swift; sourceTree = "<group>"; };
|
||||
75B1CD392C6E0DD40092ED40 /* WA_player4kVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WA_player4kVC.xib; sourceTree = "<group>"; };
|
||||
75B1CD3A2C6E0DD40092ED40 /* WA_playerRankVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WA_playerRankVC.swift; sourceTree = "<group>"; };
|
||||
75B1CD3B2C6E0DD40092ED40 /* WA_playerRankVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WA_playerRankVC.xib; sourceTree = "<group>"; };
|
||||
75B1CD3C2C6E0DD40092ED40 /* WA_playerVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WA_playerVC.swift; sourceTree = "<group>"; };
|
||||
75B1CD3D2C6E0DD40092ED40 /* WA_playerVC.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WA_playerVC.xib; sourceTree = "<group>"; };
|
||||
75D453882C0EE875003B6B24 /* idfaManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = idfaManager.swift; sourceTree = "<group>"; };
|
||||
75D4538B2C0EE949003B6B24 /* ipManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ipManager.swift; sourceTree = "<group>"; };
|
||||
75D4538E2C0EFE3A003B6B24 /* NetworkManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkManager.swift; sourceTree = "<group>"; };
|
||||
@ -358,29 +379,18 @@
|
||||
path = V;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
752FFFB62C49116500FDA982 /* PlayerVC */ = {
|
||||
7565BDBF2C5CE54C004602CA /* TopOn */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
752FFFB72C49116C00FDA982 /* C */,
|
||||
75AF746D2C609F0F00C1DB9C /* vc */,
|
||||
7565BDC22C5D10B9004602CA /* initializationTopOn.h */,
|
||||
7565BDC32C5D10B9004602CA /* initializationTopOn.m */,
|
||||
75AF74632C6067B700C1DB9C /* LUXTopOnVC.swift */,
|
||||
75AF74672C60682200C1DB9C /* LUXToponManager.swift */,
|
||||
75AF74692C60685600C1DB9C /* LUXTopOnConfigure.swift */,
|
||||
75AF746B2C606C2A00C1DB9C /* LUXNetWorkManager.swift */,
|
||||
);
|
||||
path = PlayerVC;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
752FFFB72C49116C00FDA982 /* C */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
752FFFB82C49118700FDA982 /* WA_playerVC.swift */,
|
||||
752FFFB92C49118700FDA982 /* WA_playerVC.xib */,
|
||||
755EC36A2C4A378400919ACB /* WA_player4kVC.swift */,
|
||||
755EC36B2C4A378400919ACB /* WA_player4kVC.xib */,
|
||||
755EC36E2C4A469A00919ACB /* WA_playerRankVC.swift */,
|
||||
755EC36F2C4A469A00919ACB /* WA_playerRankVC.xib */,
|
||||
755EC3722C4A4F3600919ACB /* WA_CommunityPlayerVC.swift */,
|
||||
755EC3732C4A4F3600919ACB /* WA_CommunityPlayerVC.xib */,
|
||||
755EC3762C4A517500919ACB /* WA_AddPlayerVC.swift */,
|
||||
755EC3772C4A517500919ACB /* WA_AddPlayerVC.xib */,
|
||||
);
|
||||
path = C;
|
||||
path = TopOn;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
75A8F0E12BB3F28E004B0F5C /* Community */ = {
|
||||
@ -481,6 +491,35 @@
|
||||
path = V;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
75AF746D2C609F0F00C1DB9C /* vc */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
75AF746E2C609F1C00C1DB9C /* OneVc.swift */,
|
||||
75AF74702C609F2400C1DB9C /* twovc.swift */,
|
||||
75AF74722C609F3000C1DB9C /* threeVC.swift */,
|
||||
75AF74762C60A8E200C1DB9C /* LUXTopbtnVC.swift */,
|
||||
75AF74772C60A8E200C1DB9C /* LUXTopbtnVC.xib */,
|
||||
);
|
||||
path = vc;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
75B1CD3E2C6E0DD40092ED40 /* PlayerVC */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
75B1CD342C6E0DD40092ED40 /* WA_AddPlayerVC.swift */,
|
||||
75B1CD352C6E0DD40092ED40 /* WA_AddPlayerVC.xib */,
|
||||
75B1CD362C6E0DD40092ED40 /* WA_CommunityPlayerVC.swift */,
|
||||
75B1CD372C6E0DD40092ED40 /* WA_CommunityPlayerVC.xib */,
|
||||
75B1CD382C6E0DD40092ED40 /* WA_player4kVC.swift */,
|
||||
75B1CD392C6E0DD40092ED40 /* WA_player4kVC.xib */,
|
||||
75B1CD3A2C6E0DD40092ED40 /* WA_playerRankVC.swift */,
|
||||
75B1CD3B2C6E0DD40092ED40 /* WA_playerRankVC.xib */,
|
||||
75B1CD3C2C6E0DD40092ED40 /* WA_playerVC.swift */,
|
||||
75B1CD3D2C6E0DD40092ED40 /* WA_playerVC.xib */,
|
||||
);
|
||||
path = PlayerVC;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
75D453862C0EE856003B6B24 /* IDFA */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -530,7 +569,8 @@
|
||||
75E2881F2B9EB0700049AB56 /* wallpaper_project */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
752FFFB62C49116500FDA982 /* PlayerVC */,
|
||||
75B1CD3E2C6E0DD40092ED40 /* PlayerVC */,
|
||||
7565BDBF2C5CE54C004602CA /* TopOn */,
|
||||
752FFF832C48EC3400FDA982 /* Rank */,
|
||||
75A8F0E12BB3F28E004B0F5C /* Community */,
|
||||
75E288A32BA0542F0049AB56 /* json */,
|
||||
@ -831,6 +871,7 @@
|
||||
75A8F0EC2BB3FA69004B0F5C /* WA_HistoryVC.xib in Resources */,
|
||||
75E2882D2B9EB0730049AB56 /* LaunchScreen.storyboard in Resources */,
|
||||
759BB0602BABE3EC001C0031 /* loanding.json in Resources */,
|
||||
75B1CD442C6E0DD50092ED40 /* WA_player4kVC.xib in Resources */,
|
||||
75FEE60C2BA4212B00E83097 /* WA_tipCell.xib in Resources */,
|
||||
75E2882A2B9EB0730049AB56 /* Assets.xcassets in Resources */,
|
||||
75A8F14F2BB66017004B0F5C /* WA_SCVC.xib in Resources */,
|
||||
@ -840,19 +881,21 @@
|
||||
75E2888D2B9EFC050049AB56 /* WA_DetailsVC.xib in Resources */,
|
||||
75E288792B9ED2A70049AB56 /* WA_4KVC.xib in Resources */,
|
||||
75A8F1392BB54664004B0F5C /* WA_NewHometypeCell.xib in Resources */,
|
||||
755EC3712C4A469A00919ACB /* WA_playerRankVC.xib in Resources */,
|
||||
75A8F1022BB40F6F004B0F5C /* WA_RakingCell.xib in Resources */,
|
||||
75B1CD462C6E0DD50092ED40 /* WA_playerRankVC.xib in Resources */,
|
||||
75A8F1352BB54519004B0F5C /* WA_BannerPagerCell.xib in Resources */,
|
||||
75B1CD422C6E0DD50092ED40 /* WA_CommunityPlayerVC.xib in Resources */,
|
||||
75AF74792C60A8E200C1DB9C /* LUXTopbtnVC.xib in Resources */,
|
||||
75A8F11B2BB51092004B0F5C /* WA_RKDetailsVC.xib in Resources */,
|
||||
75E2887E2B9EDDC60049AB56 /* WA_WallpaperCollectionCell.xib in Resources */,
|
||||
75A8F13D2BB547A9004B0F5C /* WA_NHTypeCollectCell.xib in Resources */,
|
||||
75E288662B9EB2CF0049AB56 /* WA_HomeVC.xib in Resources */,
|
||||
752FFF7A2C48B7EB00FDA982 /* GoogleService-Info.plist in Resources */,
|
||||
755EC36D2C4A378400919ACB /* WA_player4kVC.xib in Resources */,
|
||||
75E288872B9EEA820049AB56 /* 4k.json in Resources */,
|
||||
75A8F0F02BB3FADF004B0F5C /* WA_HistoryCell.xib in Resources */,
|
||||
75E2889D2BA034140049AB56 /* WA_LiveVideoVC.xib in Resources */,
|
||||
752FFF8E2C48F4E400FDA982 /* WA_RankCollectionViewCell.xib in Resources */,
|
||||
75B1CD402C6E0DD50092ED40 /* WA_AddPlayerVC.xib in Resources */,
|
||||
75A8F1232BB510D1004B0F5C /* WA_RKTopCell.xib in Resources */,
|
||||
75A8F1312BB54459004B0F5C /* WA_NewHomeBannerCell.xib in Resources */,
|
||||
75E288952B9FED680049AB56 /* WA_PreView.xib in Resources */,
|
||||
@ -863,7 +906,6 @@
|
||||
75A8F0E62BB3F2A6004B0F5C /* WA_RankingVC.xib in Resources */,
|
||||
75E288752B9ED2970049AB56 /* WA_LIVEVC.xib in Resources */,
|
||||
75A8F1222BB510D1004B0F5C /* WA_RKPLCell.xib in Resources */,
|
||||
752FFFBA2C49118700FDA982 /* WA_playerVC.xib in Resources */,
|
||||
752FFF872C48EC5000FDA982 /* WA_RankVC.xib in Resources */,
|
||||
75A8F1262BB54083004B0F5C /* my_wallpaper.json in Resources */,
|
||||
75A8F0FD2BB3FE0D004B0F5C /* WA_histortRankig.xib in Resources */,
|
||||
@ -874,10 +916,9 @@
|
||||
75200B6E2BA7D34F00BA65FD /* WA_limitsVCViewController.xib in Resources */,
|
||||
75A8F1432BB576C2004B0F5C /* WA_TodayCell.xib in Resources */,
|
||||
75E288822B9EE56C0049AB56 /* 3d.json in Resources */,
|
||||
755EC3752C4A4F3600919ACB /* WA_CommunityPlayerVC.xib in Resources */,
|
||||
75FEE6082BA420C400E83097 /* WA_TipVC.xib in Resources */,
|
||||
755EC3792C4A517500919ACB /* WA_AddPlayerVC.xib in Resources */,
|
||||
75A8F12A2BB54220004B0F5C /* WA_NewHomeVC.xib in Resources */,
|
||||
75B1CD482C6E0DD50092ED40 /* WA_playerVC.xib in Resources */,
|
||||
75A8F0F92BB3FDFE004B0F5C /* WA_history4K.xib in Resources */,
|
||||
75A14D942BA1A9760091D9AD /* WA_PrivacyVC.xib in Resources */,
|
||||
75A8F0F52BB3FDE9004B0F5C /* WA_historyLive.xib in Resources */,
|
||||
@ -967,37 +1008,43 @@
|
||||
75A8F14E2BB66017004B0F5C /* WA_SCVC.swift in Sources */,
|
||||
752FFF882C48EC5000FDA982 /* WA_RankVC.swift in Sources */,
|
||||
75A8F1242BB510D1004B0F5C /* WA_RKPLCell.swift in Sources */,
|
||||
75AF74732C609F3000C1DB9C /* threeVC.swift in Sources */,
|
||||
75A8F0F42BB3FDE9004B0F5C /* WA_historyLive.swift in Sources */,
|
||||
75AF74652C6067B700C1DB9C /* LUXTopOnVC.swift in Sources */,
|
||||
75B1CD452C6E0DD50092ED40 /* WA_playerRankVC.swift in Sources */,
|
||||
75D453892C0EE875003B6B24 /* idfaManager.swift in Sources */,
|
||||
752FFF8F2C48F4E400FDA982 /* WA_RankCollectionViewCell.swift in Sources */,
|
||||
75E2887D2B9EDDC60049AB56 /* WA_WallpaperCollectionCell.swift in Sources */,
|
||||
75E2889F2BA043960049AB56 /* videoURL.swift in Sources */,
|
||||
75A8F1212BB510D1004B0F5C /* WA_RKTopCell.swift in Sources */,
|
||||
7565BDC42C5D10B9004602CA /* initializationTopOn.m in Sources */,
|
||||
75FEE5FF2BA3E0ED00E83097 /* QuickTimeMov.swift in Sources */,
|
||||
75FEE6042BA3E14A00E83097 /* PrefixHeader.swift in Sources */,
|
||||
75A8F0FC2BB3FE0D004B0F5C /* WA_histortRankig.swift in Sources */,
|
||||
75E2885C2B9EB22E0049AB56 /* WA_RootNAV.swift in Sources */,
|
||||
752FFF8A2C48F35F00FDA982 /* custlayout.swift in Sources */,
|
||||
75B1CD412C6E0DD50092ED40 /* WA_CommunityPlayerVC.swift in Sources */,
|
||||
75A8F1172BB42B43004B0F5C /* WA_MineVC.swift in Sources */,
|
||||
75E2886D2B9EB48A0049AB56 /* colorManager.swift in Sources */,
|
||||
75FEE6012BA3E0ED00E83097 /* Toast.swift in Sources */,
|
||||
755EC3782C4A517500919ACB /* WA_AddPlayerVC.swift in Sources */,
|
||||
75D4538F2C0EFE3A003B6B24 /* NetworkManager.swift in Sources */,
|
||||
75A8F0E52BB3F2A6004B0F5C /* WA_RankingVC.swift in Sources */,
|
||||
75E2885A2B9EB22E0049AB56 /* WA_TabButton.swift in Sources */,
|
||||
75D4538C2C0EE949003B6B24 /* ipManager.swift in Sources */,
|
||||
75A8F11C2BB51092004B0F5C /* WA_RKDetailsVC.swift in Sources */,
|
||||
75E2885B2B9EB22E0049AB56 /* WA_TabbarCommon.swift in Sources */,
|
||||
75AF746A2C60685600C1DB9C /* LUXTopOnConfigure.swift in Sources */,
|
||||
75A8F14A2BB57C2D004B0F5C /* WA_MonRankngCell.swift in Sources */,
|
||||
75A8F0E82BB3F76E004B0F5C /* historyManager.swift in Sources */,
|
||||
75AF74682C60682200C1DB9C /* LUXToponManager.swift in Sources */,
|
||||
75A8F13F2BB56338004B0F5C /* WallpaperModel.swift in Sources */,
|
||||
75A8F1462BB57742004B0F5C /* WA_ToDayCollectCell.swift in Sources */,
|
||||
75E2889C2BA034140049AB56 /* WA_LiveVideoVC.swift in Sources */,
|
||||
752FFFBB2C49118700FDA982 /* WA_playerVC.swift in Sources */,
|
||||
75E288692B9EB2DF0049AB56 /* WA_SettingSVC.swift in Sources */,
|
||||
75FEE5F92BA3037000E83097 /* testVideoVC.swift in Sources */,
|
||||
75A8F10A2BB4286A004B0F5C /* WA_RakModel.swift in Sources */,
|
||||
75A8F1052BB41211004B0F5C /* WA_AddVC.swift in Sources */,
|
||||
75B1CD3F2C6E0DD50092ED40 /* WA_AddPlayerVC.swift in Sources */,
|
||||
75A8F0EF2BB3FADF004B0F5C /* WA_HistoryCell.swift in Sources */,
|
||||
75FEE6072BA420C400E83097 /* WA_TipVC.swift in Sources */,
|
||||
75A8F0EB2BB3FA69004B0F5C /* WA_HistoryVC.swift in Sources */,
|
||||
@ -1007,24 +1054,27 @@
|
||||
75E2885D2B9EB22E0049AB56 /* WA_RootTab.swift in Sources */,
|
||||
757DA8B82C1BE33E0046CAB6 /* stringADID.swift in Sources */,
|
||||
75E288252B9EB0700049AB56 /* ViewController.swift in Sources */,
|
||||
755EC36C2C4A378400919ACB /* WA_player4kVC.swift in Sources */,
|
||||
755EC3742C4A4F3600919ACB /* WA_CommunityPlayerVC.swift in Sources */,
|
||||
75AF746C2C606C2A00C1DB9C /* LUXNetWorkManager.swift in Sources */,
|
||||
75E288852B9EE5A50049AB56 /* WA_3DModel.swift in Sources */,
|
||||
75AF74712C609F2400C1DB9C /* twovc.swift in Sources */,
|
||||
75200B6D2BA7D34F00BA65FD /* WA_limitsVCViewController.swift in Sources */,
|
||||
75E288212B9EB0700049AB56 /* AppDelegate.swift in Sources */,
|
||||
75A8F1302BB54459004B0F5C /* WA_NewHomeBannerCell.swift in Sources */,
|
||||
75E288782B9ED2A70049AB56 /* WA_4KVC.swift in Sources */,
|
||||
75FEE60B2BA4212B00E83097 /* WA_tipCell.swift in Sources */,
|
||||
75B1CD472C6E0DD50092ED40 /* WA_playerVC.swift in Sources */,
|
||||
75FEE6022BA3E0ED00E83097 /* JPEG.swift in Sources */,
|
||||
75A8F13C2BB547A9004B0F5C /* WA_NHTypeCollectCell.swift in Sources */,
|
||||
755EC3702C4A469A00919ACB /* WA_playerRankVC.swift in Sources */,
|
||||
75B1CD432C6E0DD50092ED40 /* WA_player4kVC.swift in Sources */,
|
||||
75A8F0F82BB3FDFE004B0F5C /* WA_history4K.swift in Sources */,
|
||||
75E288742B9ED2970049AB56 /* WA_LIVEVC.swift in Sources */,
|
||||
75E288802B9EE36A0049AB56 /* CustomCollectionViewFlowLayout.swift in Sources */,
|
||||
75FDC0BA2BCE5461005B3D13 /* AccountManager.swift in Sources */,
|
||||
75AF74782C60A8E200C1DB9C /* LUXTopbtnVC.swift in Sources */,
|
||||
75FEE6002BA3E0ED00E83097 /* DTOtherMacro.swift in Sources */,
|
||||
75A8F1292BB54220004B0F5C /* WA_NewHomeVC.swift in Sources */,
|
||||
75E288592B9EB22E0049AB56 /* WA_RootVC.swift in Sources */,
|
||||
75AF746F2C609F1C00C1DB9C /* OneVc.swift in Sources */,
|
||||
75A8F1152BB42B43004B0F5C /* WA_LoginVC.swift in Sources */,
|
||||
75E288932B9FED590049AB56 /* WA_PreView.swift in Sources */,
|
||||
75E2888C2B9EFC040049AB56 /* WA_DetailsVC.swift in Sources */,
|
||||
@ -1216,7 +1266,7 @@
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 6HWQW9JC74;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
EXCLUDED_ARCHS = "";
|
||||
@ -1237,7 +1287,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 3.7;
|
||||
MARKETING_VERSION = 3.8;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.wallpapaer.hd.live.app;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
@ -1263,7 +1313,7 @@
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 2;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 6HWQW9JC74;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
EXCLUDED_ARCHS = "";
|
||||
@ -1284,7 +1334,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 3.7;
|
||||
MARKETING_VERSION = 3.8;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.wallpapaer.hd.live.app;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
||||
@ -11,6 +11,7 @@ import FirebaseAnalytics
|
||||
import Alamofire
|
||||
import FBSDKCoreKit
|
||||
import MTGSDK
|
||||
import AnyThinkSDK
|
||||
|
||||
@main
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
@ -22,6 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
static var shared: AppDelegate {
|
||||
return UIApplication.shared.delegate as! AppDelegate
|
||||
}
|
||||
|
||||
var isFirstLaunchq: Bool = true
|
||||
var window: UIWindow?
|
||||
var interstitialAd: MAInterstitialAd!
|
||||
@ -43,12 +45,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
window?.rootViewController = splashViewController
|
||||
self.window?.makeKeyAndVisible()
|
||||
|
||||
|
||||
setdispatch()
|
||||
|
||||
let mtgsdk = MTGSDK()
|
||||
mtgsdk.setAppID("302071", apiKey: "8e642b70b909c249688ccbc7d7d7a164")
|
||||
|
||||
initializationTopOn.toponeSDK()
|
||||
|
||||
let userDefaults = UserDefaults.standard
|
||||
if userDefaults.bool(forKey: hasLaunchedBeforeKey){
|
||||
let tt = UserDefaults.standard
|
||||
@ -58,30 +58,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
UserDefaults.standard.set(true, forKey: hasLaunchedBeforeKey)
|
||||
UserDefaults.standard.set(false, forKey: "iswindows")
|
||||
}
|
||||
|
||||
// let initConfig = ALSdkInitializationConfiguration(sdkKey: "O9SUDhhvnysqkmTqrvetcbJ1wp1OHnxXF9xdpu2TmR4Ppq3w35mn3d2iy2g4OHvGWPl0EJ6D7H5FpGK5izye1A") { builder in
|
||||
// builder.mediationProvider = ALMediationProviderMAX
|
||||
// }
|
||||
//
|
||||
// ALSdk.shared().initialize(with: initConfig) { sdkConfig in
|
||||
// // Start loading ads
|
||||
// splashViewController.createInterstitialAd()
|
||||
//
|
||||
//// let vc = WA_DetailsVC()
|
||||
//// vc.createInterstitialAd()
|
||||
////
|
||||
//// let rakvc = WA_RankingVC()
|
||||
//// rakvc.createInterstitialAd()
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
Analytics.logEvent("goin_app", parameters: nil)
|
||||
|
||||
// let userDefaults = UserDefaults.standard
|
||||
|
||||
|
||||
|
||||
// 强制设置浅色模式
|
||||
if #available(iOS 13.0, *) {
|
||||
window?.overrideUserInterfaceStyle = .light
|
||||
@ -90,6 +69,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
func application(_ app: UIApplication,open url: URL,options:[UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
|
||||
ApplicationDelegate.shared.application(
|
||||
app,
|
||||
@ -100,44 +80,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||
// 应用进入后台时调用
|
||||
// wasInBackground = true
|
||||
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||
// 应用即将从后台进入前台时调用
|
||||
// if wasInBackground {
|
||||
// // 这里执行你希望在应用从后台进入前台时执行的代码
|
||||
// self.createInterstitialAd()
|
||||
// print("Application will enter foreground")
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
// if wasInBackground {
|
||||
// adCheckStartTime = Date()
|
||||
// adCheckTimer = Timer.scheduledTimer(timeInterval: 0.01, target: self, selector: #selector(checkAdStatus), userInfo: nil, repeats: true)
|
||||
// }
|
||||
// // 应用已经变为活跃状态时调用
|
||||
// print("Application did become active")
|
||||
// wasInBackground = false
|
||||
|
||||
}
|
||||
|
||||
// @objc func checkAdStatus(){
|
||||
// let elapsedTime = Date().timeIntervalSince(adCheckStartTime!)
|
||||
// if interstitialAd.isReady {
|
||||
// interstitialAd.show()
|
||||
// Analytics.logEvent("Backstage_load_success", parameters: nil)
|
||||
// self.setPostSHOW()
|
||||
// adCheckTimer?.invalidate()
|
||||
// } else if elapsedTime >= 2 {
|
||||
// adCheckTimer?.invalidate()
|
||||
// // WA_TabbarCommon.TabBarController()
|
||||
// Analytics.logEvent("Backstage_load_fail", parameters: nil)
|
||||
// } else {
|
||||
// print("广告未准备好,继续检查...")
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
func setdispatch(){
|
||||
// 使用信号量控制并发任务
|
||||
@ -266,178 +220,3 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
}
|
||||
|
||||
|
||||
//extension AppDelegate: MAAdDelegate
|
||||
//{
|
||||
// func createInterstitialAd()
|
||||
// {
|
||||
// interstitialAd = MAInterstitialAd(adUnitIdentifier: "8e1bc1f22c8d6c9d")
|
||||
// interstitialAd.delegate = self
|
||||
//
|
||||
// // Load the first ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//
|
||||
// // MARK: MAAdDelegate Protocol
|
||||
//
|
||||
// func didLoad(_ ad: MAAd)
|
||||
// {
|
||||
// // Interstitial ad is ready to be shown. 'interstitialAd.isReady' will now return 'true'
|
||||
//
|
||||
// // Reset retry attempt
|
||||
// retryAttempt = 0
|
||||
// StartManager.shared.succeed = true
|
||||
// StartManager.shared.loadTime = 0
|
||||
// StartManager.shared.adPlatform = "MAX"
|
||||
// StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
// StartManager.shared.adId = "8e1bc1f22c8d6c9d"
|
||||
// StartManager.shared.platformResponseTime = ad.requestLatency
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
// StartManager.shared.dsp = ad.dspName
|
||||
// StartManager.shared.network = ad.networkName
|
||||
// let logMessage = """
|
||||
// deviceId: \(StartManager.shared.devicID ?? "")
|
||||
// localIp: \(StartManager.shared.localIP ?? "")
|
||||
// "deviceId": \(StartManager.shared.devicID ?? ""),
|
||||
// "localIp": \(StartManager.shared.localIP ?? ""),
|
||||
// "remoteIp": \(StartManager.shared.publicIP ?? ""),
|
||||
// "linkId": "",
|
||||
// "packageName": "com.wallpapaer.hd.live.app",
|
||||
// "gaid": \(StartManager.shared.idfaid ?? ""),
|
||||
// "dataId": "",
|
||||
// "shelfNumber": "后台进入前台",
|
||||
// "succeed": \(StartManager.shared.succeed),
|
||||
// "loadTime": \(StartManager.shared.loadTime ?? 0),
|
||||
// "adPlatform": \(StartManager.shared.adPlatform ?? ""),
|
||||
// "countryCode": \(StartManager.shared.countryCode ?? ""),
|
||||
// "adId": \(StartManager.shared.adId ?? ""),
|
||||
// "platformResponseTime": \(StartManager.shared.platformResponseTime ?? 0.0),
|
||||
// "getIpResponseTime": \(StartManager.shared.getIpResponseTime ?? 0.0),
|
||||
// "ecpm": \(StartManager.shared.ecpm ?? 0.0),
|
||||
// "dsp": \(StartManager.shared.dsp ?? ""),
|
||||
// "network": \(StartManager.shared.network ?? "")
|
||||
// """
|
||||
//
|
||||
// AppDelegate.shared.addLogMessage(logMessage)
|
||||
//
|
||||
// self.setPostload()
|
||||
// }
|
||||
//
|
||||
// func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to load
|
||||
// // We recommend retrying with exponentially higher delays up to a maximum delay (in this case 64 seconds)
|
||||
//
|
||||
// retryAttempt += 1
|
||||
// let delaySec = pow(2.0, min(6.0, retryAttempt))
|
||||
//
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + delaySec) {
|
||||
// self.interstitialAd.load()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// func didDisplay(_ ad: MAAd)
|
||||
// {
|
||||
// // Pause your app's background audio
|
||||
// }
|
||||
//
|
||||
// func didClick(_ ad: MAAd) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// func didHide(_ ad: MAAd)
|
||||
// {
|
||||
// // Resume your app's background audio
|
||||
// // Interstitial ad is hidden. Pre-load the next ad
|
||||
// interstitialAd.load()
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
// func didFail(toDisplay ad: MAAd, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to display. We recommend loading the next ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
|
||||
//
|
||||
// func setPostload(){
|
||||
// let url = "http://111.9.47.226:38080/top_selection/save_ad_load_log"
|
||||
// let parameters:[String : Any] = [
|
||||
// "deviceId": StartManager.shared.devicID ?? "",
|
||||
// "localIp": StartManager.shared.localIP ?? "",
|
||||
// "remoteIp": StartManager.shared.publicIP ?? "",
|
||||
// "linkId": "",
|
||||
// "packageName": "com.wallpapaer.hd.live.app",
|
||||
// "gaid": StartManager.shared.idfaid ?? "",
|
||||
// "dataId": "",
|
||||
// "shelfNumber":"后台进入前台",
|
||||
// "succeed": StartManager.shared.succeed,
|
||||
// "loadTime":StartManager.shared.loadTime ?? "",
|
||||
// "adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
// "countryCode": StartManager.shared.countryCode ?? "",
|
||||
// "adId": StartManager.shared.adId ?? "",
|
||||
// "platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
// "getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
// "ecpm": StartManager.shared.ecpm ?? "",
|
||||
// "dsp": StartManager.shared.dsp ?? "",
|
||||
// "network": StartManager.shared.network ?? "",
|
||||
// "showStatus": 0,
|
||||
// "washParam": true,
|
||||
// ]
|
||||
//
|
||||
//
|
||||
// let headers: HTTPHeaders = [
|
||||
// "Content-Type": "application/json"
|
||||
// ]
|
||||
//
|
||||
// NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
// switch result {
|
||||
// case .success(let data):
|
||||
// print("Response:--- \(data)")
|
||||
// case .failure(let error):
|
||||
// print("Error:--- \(error)")
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// func setPostSHOW(){
|
||||
// let url = "http://111.9.47.226:38080/top_selection/save_ad_show_log"
|
||||
// let parameters:[String : Any] = [
|
||||
// "deviceId": StartManager.shared.devicID ?? "",
|
||||
// "localIp": StartManager.shared.localIP ?? "",
|
||||
// "remoteIp": StartManager.shared.publicIP ?? "",
|
||||
// "linkId": "",
|
||||
// "packageName": "com.wallpapaer.hd.live.app",
|
||||
// "gaid": StartManager.shared.idfaid ?? "",
|
||||
// "dataId": "",
|
||||
// "shelfNumber":"后台进入前台",
|
||||
// "succeed": StartManager.shared.succeed,
|
||||
// "loadTime":StartManager.shared.loadTime ?? "",
|
||||
// "adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
// "countryCode": StartManager.shared.countryCode ?? "",
|
||||
// "adId": StartManager.shared.adId ?? "",
|
||||
// "platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
// "getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
// "ecpm": StartManager.shared.ecpm ?? "",
|
||||
// "dsp": StartManager.shared.dsp ?? "",
|
||||
// "network": StartManager.shared.network ?? "",
|
||||
// ]
|
||||
//
|
||||
// let headers: HTTPHeaders = [
|
||||
// "Content-Type": "application/json"
|
||||
// ]
|
||||
//
|
||||
// NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
// switch result {
|
||||
// case .success(let data):
|
||||
// print("Response:--- \(data)")
|
||||
// case .failure(let error):
|
||||
// print("Error:--- \(error)")
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
@ -12,6 +12,7 @@ import FirebaseRemoteConfig
|
||||
import MTGSDKNewInterstitial
|
||||
import MTGSDKBidding
|
||||
import MTGSDK
|
||||
import AnyThinkInterstitial
|
||||
|
||||
class WA_AddVC: WA_RootVC,UITextViewDelegate {
|
||||
@IBOutlet weak var contentImageV: UIImageView!
|
||||
@ -84,22 +85,16 @@ class WA_AddVC: WA_RootVC,UITextViewDelegate {
|
||||
super.viewWillAppear(animated)
|
||||
// self.createInterstitialAd()
|
||||
|
||||
let param = MTGBiddingRequestParameter(placementId: "1636950", unitId: "3501963", basePrice: nil)
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1636950", unitId: "3501963", delegate: self)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
}else{
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
}
|
||||
loadTopAD()
|
||||
}
|
||||
func loadTopAD(){
|
||||
let extra: [String: Any] = [
|
||||
kATAdLoadingExtraMediaExtraKey: "custom_values"
|
||||
]
|
||||
ATAdManager.shared().loadAD(withPlacementID: "n66bdc1da370ec", extra: extra, delegate: self)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
}
|
||||
|
||||
|
||||
@IBAction func backBtn(_ sender: Any) {
|
||||
self.dismiss(animated: true)
|
||||
@ -139,19 +134,12 @@ class WA_AddVC: WA_RootVC,UITextViewDelegate {
|
||||
self.dismiss(animated: true)
|
||||
}
|
||||
|
||||
if self.isadshow == true{
|
||||
// if self.interstitialAd.isReady {
|
||||
// self.interstitialAd.show()
|
||||
// Analytics.logEvent("release_load_success", parameters: nil)
|
||||
// }else{
|
||||
// print("-------广告没准备好")
|
||||
// Analytics.logEvent("release_load_fail", parameters: nil)
|
||||
// }
|
||||
let issureready = self.newInterstitialAdManager?.isAdReady()
|
||||
if self.isadshow == true{
|
||||
if ((issureready) != nil) {
|
||||
self.newInterstitialAdManager?.show(from: self)
|
||||
}
|
||||
|
||||
if self.isadshow == true{
|
||||
if ATAdManager.shared().interstitialReady(forPlacementID: "n66bdc1da370ec"){
|
||||
ATAdManager.shared().showInterstitial(withPlacementID: "n66bdc1da370ec", in: self, delegate: self)
|
||||
StartManager.shared.shelfNumber = "发布页面show"
|
||||
setPostSHOW()
|
||||
|
||||
}
|
||||
}
|
||||
@ -232,124 +220,64 @@ extension WA_AddVC: UIImagePickerControllerDelegate & UINavigationControllerDele
|
||||
picker.dismiss(animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
extension WA_AddVC:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
// func newInterstitialBidAdShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告展示成功")
|
||||
// }
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("资源加载成功,表示可播放状态")
|
||||
|
||||
|
||||
extension WA_AddVC:ATInterstitialDelegate{
|
||||
// 插页广告展示成功
|
||||
func interstitialDidShow(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----成功")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
/// 插页广告被点击
|
||||
func interstitialDidClick(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----点击")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
SVProgressHUD.showInfo(withStatus: "Successfully published, waiting for review")
|
||||
DispatchQueue.global().asyncAfter(deadline: .now() + 2) {
|
||||
SVProgressHUD.dismiss()
|
||||
// 插页广告已关闭
|
||||
func interstitialDidClose(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----关闭")
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
DispatchQueue.global().asyncAfter(deadline: .now() + 1.0) {
|
||||
SVProgressHUD.dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
func didFinishLoadingAD(withPlacementID placementID: String!) {
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// load失败
|
||||
func didFailToLoadAD(withPlacementID placementID: String!, error: (any Error)!) {
|
||||
print("----load失败")
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(String(describing: placementID))---error\(String(describing: error))")
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告被关闭")
|
||||
// self.navigationController?.popViewController(animated: true)
|
||||
SVProgressHUD.showInfo(withStatus: "Successfully published, waiting for review")
|
||||
DispatchQueue.global().asyncAfter(deadline: .now() + 2) {
|
||||
SVProgressHUD.dismiss()
|
||||
}
|
||||
}
|
||||
// 完成加载广告
|
||||
func didFinishLoadingADSource(withPlacementID placementID: String!,extra: [AnyHashable : Any]?) {
|
||||
|
||||
let networkID = extra?["network_firm_id"]
|
||||
|
||||
let ecpm = extra?["adsource_price"]
|
||||
|
||||
let country = extra?["country"]
|
||||
|
||||
|
||||
if let adsourcePriceString = extra?["adsource_price"] as? String,
|
||||
let adsourcePrice = Double(adsourcePriceString) {
|
||||
StartManager.shared.ecpm = Float(adsourcePrice) / 1000
|
||||
print("-----ecpm ID: \(StartManager.shared.ecpm)")
|
||||
} else {
|
||||
print("无法获取 adsource_price 或类型不匹配")
|
||||
}
|
||||
|
||||
StartManager.shared.countryCode = country as? String
|
||||
StartManager.shared.network = network(networkID as! Int)
|
||||
StartManager.shared.shelfNumber = "发布页面load"
|
||||
StartManager.shared.adId = "n66bdc1da370ec"
|
||||
setPostload()
|
||||
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
|
||||
}
|
||||
//extension WA_AddVC: MAAdDelegate
|
||||
//{
|
||||
// func createInterstitialAd()
|
||||
// {
|
||||
// interstitialAd = MAInterstitialAd(adUnitIdentifier: "83802ca889ba09e6")
|
||||
// interstitialAd.delegate = self
|
||||
//
|
||||
// // Load the first ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//
|
||||
// // MARK: MAAdDelegate Protocol
|
||||
//
|
||||
// func didLoad(_ ad: MAAd)
|
||||
// {
|
||||
// // Interstitial ad is ready to be shown. 'interstitialAd.isReady' will now return 'true'
|
||||
//
|
||||
// // Reset retry attempt
|
||||
// retryAttempt = 0
|
||||
// }
|
||||
//
|
||||
// func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to load
|
||||
// // We recommend retrying with exponentially higher delays up to a maximum delay (in this case 64 seconds)
|
||||
//
|
||||
// retryAttempt += 1
|
||||
// let delaySec = pow(2.0, min(6.0, retryAttempt))
|
||||
//
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + delaySec) {
|
||||
// self.interstitialAd.load()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// func didDisplay(_ ad: MAAd)
|
||||
// {
|
||||
// // Pause your app's background audio
|
||||
// }
|
||||
//
|
||||
// func didClick(_ ad: MAAd) {}
|
||||
//
|
||||
// func didHide(_ ad: MAAd)
|
||||
// {
|
||||
// // Resume your app's background audio
|
||||
// // Interstitial ad is hidden. Pre-load the next ad
|
||||
//
|
||||
// interstitialAd.load()
|
||||
// SVProgressHUD.showInfo(withStatus: "Successfully published, waiting for review")
|
||||
// DispatchQueue.global().asyncAfter(deadline: .now() + 2) {
|
||||
// SVProgressHUD.dismiss()
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// func didFail(toDisplay ad: MAAd, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to display. We recommend loading the next ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
@ -85,58 +85,9 @@ class WA_RKDetailsVC: WA_RootVC,UITextFieldDelegate {
|
||||
remoteConfig.setDefaults(fromPlist: "isopen")
|
||||
// Fetch 配置值
|
||||
|
||||
let param = MTGBiddingRequestParameter(placementId: "1650169", unitId: "3158993", basePrice: nil)
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1650169", unitId: "3158993", delegate: self)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
self.fetchRemoteConfig()
|
||||
}else{
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
///是否有广告
|
||||
func fetchRemoteConfig() {
|
||||
let localVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "0.0"
|
||||
remoteConfig.fetch{ (status, error) -> Void in
|
||||
if status == .success {
|
||||
print("Config fetched!")
|
||||
self.remoteConfig.activate { changed, error in
|
||||
if error == nil{
|
||||
let js = self.remoteConfig.configValue(forKey: "isopen").jsonValue as! [String:Any]
|
||||
let valueopen = js["isadopen"] as! Bool
|
||||
let valueversion = js["version"] as! String
|
||||
DispatchQueue.main.async {
|
||||
if valueversion == localVersion{
|
||||
self.isadshow = false
|
||||
}else{
|
||||
if valueopen {
|
||||
self.isadshow = true
|
||||
} else {
|
||||
self.isadshow = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
print("Config not fetched")
|
||||
if let error = error {
|
||||
print("Error: \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func setTableViewCell(){
|
||||
tableView.delegate = self
|
||||
@ -152,36 +103,7 @@ class WA_RKDetailsVC: WA_RootVC,UITextFieldDelegate {
|
||||
|
||||
|
||||
@IBAction func plBtn(_ sender: Any) {
|
||||
// if self.isadshow == true{
|
||||
// if interstitialAd.isReady {
|
||||
// interstitialAd.show()
|
||||
// Analytics.logEvent("touchrelease_load_success", parameters: nil)
|
||||
// }else{
|
||||
// if isLoggedIn(){
|
||||
// self.plBtn.isHidden = true
|
||||
// textField.isHidden = false
|
||||
// textField.becomeFirstResponder()
|
||||
//
|
||||
// }else{
|
||||
// let vc = WA_LoginVC()
|
||||
// vc.type = 1
|
||||
// self.navigationController?.pushViewController(vc, animated: true)
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// if isLoggedIn(){
|
||||
// self.plBtn.isHidden = true
|
||||
// textField.isHidden = false
|
||||
// textField.becomeFirstResponder()
|
||||
//
|
||||
// }else{
|
||||
// let vc = WA_LoginVC()
|
||||
// vc.type = 1
|
||||
// self.navigationController?.pushViewController(vc, animated: true)
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
let issureready = newInterstitialAdManager?.isAdReady()
|
||||
if self.isadshow == true{
|
||||
if ((issureready) != nil) {
|
||||
@ -409,146 +331,4 @@ extension WA_RKDetailsVC:UITableViewDataSource,UITableViewDelegate{
|
||||
}
|
||||
|
||||
}
|
||||
extension WA_RKDetailsVC:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
// func newInterstitialBidAdShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告展示成功")
|
||||
// }
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("资源加载成功,表示可播放状态")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
if isLoggedIn(){
|
||||
self.plBtn.isHidden = true
|
||||
textField.isHidden = false
|
||||
textField.becomeFirstResponder()
|
||||
|
||||
}else{
|
||||
let vc = WA_LoginVC()
|
||||
vc.type = 1
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告被关闭")
|
||||
if isLoggedIn(){
|
||||
self.plBtn.isHidden = true
|
||||
textField.isHidden = false
|
||||
textField.becomeFirstResponder()
|
||||
|
||||
}else{
|
||||
let vc = WA_LoginVC()
|
||||
vc.type = 1
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
//extension WA_RKDetailsVC: MAAdDelegate
|
||||
//{
|
||||
// func createInterstitialAd()
|
||||
// {
|
||||
// interstitialAd = MAInterstitialAd(adUnitIdentifier: "83802ca889ba09e6")
|
||||
// interstitialAd.delegate = self
|
||||
//
|
||||
// // Load the first ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//
|
||||
// // MARK: MAAdDelegate Protocol
|
||||
//
|
||||
// func didLoad(_ ad: MAAd)
|
||||
// {
|
||||
// // Interstitial ad is ready to be shown. 'interstitialAd.isReady' will now return 'true'
|
||||
//
|
||||
// // Reset retry attempt
|
||||
// retryAttempt = 0
|
||||
//
|
||||
//
|
||||
// }
|
||||
//
|
||||
// func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to load
|
||||
// // We recommend retrying with exponentially higher delays up to a maximum delay (in this case 64 seconds)
|
||||
//
|
||||
// retryAttempt += 1
|
||||
// let delaySec = pow(2.0, min(6.0, retryAttempt))
|
||||
//
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + delaySec) {
|
||||
// self.interstitialAd.load()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// func didDisplay(_ ad: MAAd)
|
||||
// {
|
||||
// // Pause your app's background audio
|
||||
// }
|
||||
//
|
||||
// func didClick(_ ad: MAAd) {}
|
||||
//
|
||||
// func didHide(_ ad: MAAd)
|
||||
// {
|
||||
// // Resume your app's background audio
|
||||
// // Interstitial ad is hidden. Pre-load the next ad
|
||||
// interstitialAd.load()
|
||||
//
|
||||
//
|
||||
// if isLoggedIn(){
|
||||
// self.plBtn.isHidden = true
|
||||
// textField.isHidden = false
|
||||
// textField.becomeFirstResponder()
|
||||
//
|
||||
// }else{
|
||||
// let vc = WA_LoginVC()
|
||||
// vc.type = 1
|
||||
// self.navigationController?.pushViewController(vc, animated: true)
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// func didFail(toDisplay ad: MAAd, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to display. We recommend loading the next ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//}
|
||||
|
||||
@ -13,6 +13,7 @@ import FirebaseRemoteConfig
|
||||
import MTGSDKNewInterstitial
|
||||
import MTGSDKBidding
|
||||
import MTGSDK
|
||||
import AnyThinkInterstitial
|
||||
|
||||
class WA_RankingVC: WA_RootVC {
|
||||
@IBOutlet weak var tableView: UITableView!
|
||||
@ -114,83 +115,36 @@ class WA_RankingVC: WA_RootVC {
|
||||
remoteConfig.setDefaults(fromPlist: "isopen")
|
||||
// Fetch 配置值
|
||||
// fetchRemoteConfig()
|
||||
let param = MTGBiddingRequestParameter(placementId: "1636950", unitId: "3501963", basePrice: nil)
|
||||
loadTopAD()
|
||||
}
|
||||
func loadTopAD(){
|
||||
let extra: [String: Any] = [
|
||||
kATAdLoadingExtraMediaExtraKey: "custom_values"
|
||||
]
|
||||
ATAdManager.shared().loadAD(withPlacementID: "n66bdc1da370ec", extra: extra, delegate: self)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1636950", unitId: "3501963", delegate: self)
|
||||
StartManager.shared.ecpm = Float(bidResponse.price)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
}else{
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@IBAction func addBtn(_ sender: Any) {
|
||||
self.isseleted = false
|
||||
|
||||
// if self.isadshow == true{
|
||||
// if interstitialAd.isReady {
|
||||
// interstitialAd.show()
|
||||
// Analytics.logEvent("touchrelease_load_success", parameters: nil)
|
||||
// setPostSHOW()
|
||||
// let logMessage = """
|
||||
// deviceId: \(StartManager.shared.devicID ?? "")
|
||||
// localIp: \(StartManager.shared.localIP ?? "")
|
||||
// "deviceId": \(StartManager.shared.devicID ?? ""),
|
||||
// "localIp": \(StartManager.shared.localIP ?? ""),
|
||||
// "remoteIp": \(StartManager.shared.publicIP ?? ""),
|
||||
// "linkId": "",
|
||||
// "packageName": "com.wallpapaer.hd.live.app",
|
||||
// "gaid": \(StartManager.shared.idfaid ?? ""),
|
||||
// "dataId": "",
|
||||
// "shelfNumber": "上传社区动态",
|
||||
// "succeed": \(StartManager.shared.succeed),
|
||||
// "loadTime": \(StartManager.shared.loadTime ?? 0),
|
||||
// "adPlatform": \(StartManager.shared.adPlatform ?? ""),
|
||||
// "countryCode": \(StartManager.shared.countryCode ?? ""),
|
||||
// "adId": \(StartManager.shared.adId ?? ""),
|
||||
// "platformResponseTime": \(StartManager.shared.platformResponseTime ?? 0.0),
|
||||
// "getIpResponseTime": \(StartManager.shared.getIpResponseTime ?? 0.0),
|
||||
// "ecpm": \(StartManager.shared.ecpm ?? 0.0),
|
||||
// "dsp": \(StartManager.shared.dsp ?? ""),
|
||||
// "network": \(StartManager.shared.network ?? "")
|
||||
// """
|
||||
// AppDelegate.shared.addLogMessage(logMessage)
|
||||
// }else{
|
||||
// if isLoggedIn(){
|
||||
// let vc = WA_AddVC()
|
||||
// vc.modalPresentationStyle = .fullScreen
|
||||
// self.present(vc, animated: true)
|
||||
//
|
||||
// }else{
|
||||
// let vc = WA_LoginVC()
|
||||
// self.navigationController?.pushViewController(vc, animated: true)
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// if isLoggedIn(){
|
||||
// let vc = WA_AddVC()
|
||||
// vc.modalPresentationStyle = .fullScreen
|
||||
// self.present(vc, animated: true)
|
||||
//
|
||||
// }else{
|
||||
// let vc = WA_LoginVC()
|
||||
// self.navigationController?.pushViewController(vc, animated: true)
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
let issureready = newInterstitialAdManager?.isAdReady()
|
||||
if self.isadshow == true{
|
||||
if ((issureready) != nil) {
|
||||
newInterstitialAdManager?.show(from: self)
|
||||
if ATAdManager.shared().interstitialReady(forPlacementID: "n66bdc1da370ec"){
|
||||
ATAdManager.shared().showInterstitial(withPlacementID: "n66bdc1da370ec", in: self, delegate: self)
|
||||
StartManager.shared.shelfNumber = "发布show"
|
||||
setPostSHOW()
|
||||
if isLoggedIn(){
|
||||
let vc = WA_AddVC()
|
||||
vc.modalPresentationStyle = .fullScreen
|
||||
self.present(vc, animated: true)
|
||||
|
||||
}else{
|
||||
let vc = WA_LoginVC()
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
}else{
|
||||
if isLoggedIn(){
|
||||
let vc = WA_AddVC()
|
||||
@ -214,93 +168,15 @@ class WA_RankingVC: WA_RootVC {
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Analytics.logEvent("goin_release", parameters: nil)
|
||||
|
||||
}
|
||||
|
||||
func setPostload(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_load_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"社区发布以及点击进入详情",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
"showStatus": 0,
|
||||
"washParam": true,
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func setPostSHOW(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_show_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"社区发布以及点击进入详情",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -387,27 +263,13 @@ extension WA_RankingVC:UITableViewDelegate,UITableViewDataSource{
|
||||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
self.isseleted = true
|
||||
self.indexrow = indexPath.row
|
||||
// if self.isadshow == true{
|
||||
// if interstitialAd.isReady {
|
||||
// interstitialAd.show()
|
||||
// Analytics.logEvent("touchrelease_load_success", parameters: nil)
|
||||
// setPostSHOW()
|
||||
//
|
||||
// }else{
|
||||
// let vc = WA_RKDetailsVC()
|
||||
// vc.model = MKArr[indexPath.row]
|
||||
// self.navigationController?.pushViewController(vc, animated: true)
|
||||
// }
|
||||
// }else{
|
||||
// let vc = WA_RKDetailsVC()
|
||||
// vc.model = MKArr[indexPath.row]
|
||||
// self.navigationController?.pushViewController(vc, animated: true)
|
||||
// }
|
||||
|
||||
let issureready = newInterstitialAdManager?.isAdReady()
|
||||
if self.isadshow == true{
|
||||
if ((issureready) != nil) {
|
||||
newInterstitialAdManager?.show(from: self)
|
||||
setPostSHOW()
|
||||
if ATAdManager.shared().interstitialReady(forPlacementID: "n66bdc1da370ec"){
|
||||
ATAdManager.shared().showInterstitial(withPlacementID: "n66bdc1da370ec", in: self, delegate: self)
|
||||
StartManager.shared.shelfNumber = "发布show"
|
||||
setPostSHOW()
|
||||
}else{
|
||||
let vc = WA_RKDetailsVC()
|
||||
vc.model = MKArr[indexPath.row]
|
||||
@ -422,47 +284,20 @@ extension WA_RankingVC:UITableViewDelegate,UITableViewDataSource{
|
||||
}
|
||||
|
||||
}
|
||||
extension WA_RankingVC:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
// func newInterstitialBidAdShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告展示成功")
|
||||
// }
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("资源加载成功,表示可播放状态")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
StartManager.shared.succeed = true
|
||||
// StartManager.shared.loadTime = self.adLoadTime
|
||||
StartManager.shared.adPlatform = "mbridge"
|
||||
StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
StartManager.shared.adId = "3501963"
|
||||
StartManager.shared.platformResponseTime = 0
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
StartManager.shared.dsp = ""
|
||||
StartManager.shared.network = ""
|
||||
|
||||
|
||||
setPostload()
|
||||
extension WA_RankingVC:ATInterstitialDelegate{
|
||||
// 插页广告展示成功
|
||||
func interstitialDidShow(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
/// 插页广告被点击
|
||||
func interstitialDidClick(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----点击")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
// 插页广告已关闭
|
||||
func interstitialDidClose(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----关闭")
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
if self.isseleted == false{
|
||||
if isLoggedIn(){
|
||||
let vc = WA_AddVC()
|
||||
@ -478,123 +313,45 @@ StartManager.shared.platformResponseTime = 0
|
||||
vc.model = MKArr[indexrow!]
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func didFinishLoadingAD(withPlacementID placementID: String!) {
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
}
|
||||
|
||||
// load失败
|
||||
func didFailToLoadAD(withPlacementID placementID: String!, error: (any Error)!) {
|
||||
print("----load失败")
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(String(describing: placementID))---error\(String(describing: error))")
|
||||
|
||||
}
|
||||
// 完成加载广告
|
||||
func didFinishLoadingADSource(withPlacementID placementID: String!,extra: [AnyHashable : Any]?) {
|
||||
|
||||
let networkID = extra?["network_firm_id"]
|
||||
|
||||
let ecpm = extra?["adsource_price"]
|
||||
|
||||
let country = extra?["country"]
|
||||
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
if let adsourcePriceString = extra?["adsource_price"] as? String,
|
||||
let adsourcePrice = Double(adsourcePriceString) {
|
||||
StartManager.shared.ecpm = Float(adsourcePrice) / 1000
|
||||
print("-----ecpm ID: \(StartManager.shared.ecpm)")
|
||||
} else {
|
||||
print("无法获取 adsource_price 或类型不匹配")
|
||||
}
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
StartManager.shared.countryCode = country as? String
|
||||
StartManager.shared.network = network(networkID as! Int)
|
||||
StartManager.shared.shelfNumber = "发布load"
|
||||
StartManager.shared.adId = "n66bdc1da370ec"
|
||||
setPostload()
|
||||
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告被关闭")
|
||||
// self.navigationController?.popViewController(animated: true)
|
||||
if self.isseleted == false{
|
||||
if isLoggedIn(){
|
||||
let vc = WA_AddVC()
|
||||
vc.modalPresentationStyle = .fullScreen
|
||||
self.present(vc, animated: true)
|
||||
|
||||
}else{
|
||||
let vc = WA_LoginVC()
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
}else{
|
||||
let vc = WA_RKDetailsVC()
|
||||
vc.model = MKArr[indexrow!]
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
//extension WA_RankingVC: MAAdDelegate
|
||||
//{
|
||||
// func createInterstitialAd()
|
||||
// {
|
||||
// interstitialAd = MAInterstitialAd(adUnitIdentifier: "83802ca889ba09e6")
|
||||
// interstitialAd.delegate = self
|
||||
//
|
||||
// // Load the first ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//
|
||||
// // MARK: MAAdDelegate Protocol
|
||||
//
|
||||
// func didLoad(_ ad: MAAd)
|
||||
// {
|
||||
// // Interstitial ad is ready to be shown. 'interstitialAd.isReady' will now return 'true'
|
||||
//
|
||||
// // Reset retry attempt
|
||||
// retryAttempt = 0
|
||||
// StartManager.shared.succeed = true
|
||||
//// StartManager.shared.loadTime = self.adLoadTime
|
||||
// StartManager.shared.adPlatform = "MAX"
|
||||
// StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
// StartManager.shared.adId = "83802ca889ba09e6"
|
||||
// StartManager.shared.platformResponseTime = ad.requestLatency
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
// StartManager.shared.dsp = ad.dspName
|
||||
// StartManager.shared.network = ad.networkName
|
||||
// setPostload()
|
||||
// }
|
||||
//
|
||||
// func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to load
|
||||
// // We recommend retrying with exponentially higher delays up to a maximum delay (in this case 64 seconds)
|
||||
//
|
||||
// retryAttempt += 1
|
||||
// let delaySec = pow(2.0, min(6.0, retryAttempt))
|
||||
//
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + delaySec) {
|
||||
// self.interstitialAd.load()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// func didDisplay(_ ad: MAAd)
|
||||
// {
|
||||
// // Pause your app's background audio
|
||||
// }
|
||||
//
|
||||
// func didClick(_ ad: MAAd) {}
|
||||
//
|
||||
// func didHide(_ ad: MAAd)
|
||||
// {
|
||||
// // Resume your app's background audio
|
||||
// // Interstitial ad is hidden. Pre-load the next ad
|
||||
// interstitialAd.load()
|
||||
//
|
||||
// if self.isseleted == false{
|
||||
// if isLoggedIn(){
|
||||
// let vc = WA_AddVC()
|
||||
// vc.modalPresentationStyle = .fullScreen
|
||||
// self.present(vc, animated: true)
|
||||
//
|
||||
// }else{
|
||||
// let vc = WA_LoginVC()
|
||||
// self.navigationController?.pushViewController(vc, animated: true)
|
||||
// }
|
||||
// }else{
|
||||
// let vc = WA_RKDetailsVC()
|
||||
// vc.model = MKArr[indexrow!]
|
||||
// self.navigationController?.pushViewController(vc, animated: true)
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// func didFail(toDisplay ad: MAAd, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to display. We recommend loading the next ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// WallPaperPCH.pch
|
||||
// wallpaper_project
|
||||
|
||||
#import "wallpaper_project"
|
||||
//#import "wallpaper_project"
|
||||
#ifndef WallPaperPCH_pch
|
||||
#define WallPaperPCH_pch
|
||||
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
#import <MJRefresh.h>
|
||||
#import <FLAnimatedImage.h>
|
||||
#import <Firebase/Firebase.h>
|
||||
//#import <AnyThinkSDK/AnyThinkSDK.h>
|
||||
#import "initializationTopOn.h"
|
||||
//#import <FacebookCore.h>
|
||||
|
||||
//#import <SCRecorder.h>
|
||||
|
||||
@ -133,6 +133,7 @@ class WA_NewHomeVC: WA_RootVC {
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
navigationController?.navigationBar.isHidden = true
|
||||
self.tabBarController?.tabBar.isHidden = false
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() ) {
|
||||
// 请求跟踪授权
|
||||
requestTrackingAuthorization { idfa in
|
||||
|
||||
@ -14,6 +14,7 @@ import FirebaseRemoteConfig
|
||||
import MTGSDKNewInterstitial
|
||||
import MTGSDKBidding
|
||||
import MTGSDK
|
||||
import AnyThinkInterstitial
|
||||
|
||||
class WA_4KVC: WA_RootVC {
|
||||
|
||||
@ -25,6 +26,8 @@ class WA_4KVC: WA_RootVC {
|
||||
let pageSize: Int = 10 // 每页加载的数量
|
||||
var interstitialAd: MAInterstitialAd!
|
||||
var retryAttempt = 0.0
|
||||
|
||||
|
||||
// 顶部刷新
|
||||
let header = MJRefreshNormalHeader()
|
||||
// 底部刷新
|
||||
@ -95,51 +98,14 @@ class WA_4KVC: WA_RootVC {
|
||||
}
|
||||
|
||||
@IBAction func backbtn(_ sender: Any) {
|
||||
// if self.isadshow == true{
|
||||
// DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.5) {
|
||||
//
|
||||
// if self.interstitialAd.isReady {
|
||||
// self.interstitialAd.show()
|
||||
// Analytics.logEvent("details_load_success", parameters: nil)
|
||||
// self.setPostSHOW()
|
||||
// let logMessage = """
|
||||
// deviceId: \(StartManager.shared.devicID ?? "")
|
||||
// localIp: \(StartManager.shared.localIP ?? "")
|
||||
// "deviceId": \(StartManager.shared.devicID ?? ""),
|
||||
// "localIp": \(StartManager.shared.localIP ?? ""),
|
||||
// "remoteIp": \(StartManager.shared.publicIP ?? ""),
|
||||
// "linkId": "",
|
||||
// "packageName": "com.wallpapaer.hd.live.app",
|
||||
// "gaid": \(StartManager.shared.idfaid ?? ""),
|
||||
// "dataId": "",
|
||||
// "shelfNumber": "壁纸返回",
|
||||
// "succeed": \(StartManager.shared.succeed),
|
||||
// "loadTime": \(StartManager.shared.loadTime ?? 0),
|
||||
// "adPlatform": \(StartManager.shared.adPlatform ?? ""),
|
||||
// "countryCode": \(StartManager.shared.countryCode ?? ""),
|
||||
// "adId": \(StartManager.shared.adId ?? ""),
|
||||
// "platformResponseTime": \(StartManager.shared.platformResponseTime ?? 0.0),
|
||||
// "getIpResponseTime": \(StartManager.shared.getIpResponseTime ?? 0.0),
|
||||
// "ecpm": \(StartManager.shared.ecpm ?? 0.0),
|
||||
// "dsp": \(StartManager.shared.dsp ?? ""),
|
||||
// "network": \(StartManager.shared.network ?? "")
|
||||
// """
|
||||
//
|
||||
//
|
||||
// AppDelegate.shared.addLogMessage(logMessage)
|
||||
// }else{
|
||||
// self.navigationController?.popViewController(animated: true)
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// self.navigationController?.popViewController(animated: true)
|
||||
// }
|
||||
|
||||
let issureready = newInterstitialAdManager?.isAdReady()
|
||||
|
||||
|
||||
if self.isadshow == true{
|
||||
if ((issureready) != nil) {
|
||||
newInterstitialAdManager?.show(from: self)
|
||||
self.setPostSHOW()
|
||||
if ATAdManager.shared().interstitialReady(forPlacementID: "n66bdc1da370ec"){
|
||||
ATAdManager.shared().showInterstitial(withPlacementID: "n66bdc1da370ec", in: self, delegate: self)
|
||||
StartManager.shared.shelfNumber = "静态页面壁纸返回show"
|
||||
setPostSHOW()
|
||||
}else{
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
@ -203,22 +169,18 @@ class WA_4KVC: WA_RootVC {
|
||||
remoteConfig.configSettings = settings
|
||||
// Fetch 配置值
|
||||
remoteConfig.setDefaults(fromPlist: "isopen")
|
||||
let param = MTGBiddingRequestParameter(placementId: "1650177", unitId: "3519003", basePrice: nil)
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1650177", unitId: "3519003", delegate: self)
|
||||
StartManager.shared.ecpm = Float(bidResponse.price)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
}else{
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
}
|
||||
|
||||
// fetchRemoteConfig()
|
||||
loadTopAD()
|
||||
}
|
||||
|
||||
func loadTopAD(){
|
||||
let extra: [String: Any] = [
|
||||
kATAdLoadingExtraMediaExtraKey: "custom_values"
|
||||
]
|
||||
ATAdManager.shared().loadAD(withPlacementID: "n66bdc1da370ec", extra: extra, delegate: self)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
}
|
||||
|
||||
///是否有广告
|
||||
@ -349,159 +311,74 @@ class WA_4KVC: WA_RootVC {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func setPostload(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_load_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回加载",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
"showStatus": 0,
|
||||
"washParam": true,
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
func setPostSHOW(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_show_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回展示",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
extension WA_4KVC:JXSegmentedListContainerViewListDelegate{
|
||||
func listView() -> UIView {
|
||||
return view
|
||||
}
|
||||
}
|
||||
extension WA_4KVC:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
// func newInterstitialBidAdShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告展示成功")
|
||||
// }
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("资源加载成功,表示可播放状态")
|
||||
extension WA_4KVC:ATInterstitialDelegate{
|
||||
// 插页广告展示成功
|
||||
func interstitialDidShow(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----成功")
|
||||
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
StartManager.shared.succeed = true
|
||||
// StartManager.shared.loadTime = self.adLoadTime
|
||||
StartManager.shared.adPlatform = "mbridge"
|
||||
StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
StartManager.shared.adId = "3519003"
|
||||
StartManager.shared.platformResponseTime = 0
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
StartManager.shared.dsp = ""
|
||||
StartManager.shared.network = ""
|
||||
|
||||
|
||||
setPostload()
|
||||
/// 插页广告被点击
|
||||
func interstitialDidClick(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----点击")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
// 插页广告已关闭
|
||||
func interstitialDidClose(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----关闭")
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
func didFinishLoadingAD(withPlacementID placementID: String!) {
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// load失败
|
||||
func didFailToLoadAD(withPlacementID placementID: String!, error: (any Error)!) {
|
||||
print("----load失败")
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(String(describing: placementID))---error\(String(describing: error))")
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
// 完成加载广告
|
||||
func didFinishLoadingADSource(withPlacementID placementID: String!,extra: [AnyHashable : Any]?) {
|
||||
|
||||
let networkID = extra?["network_firm_id"]
|
||||
|
||||
let ecpm = extra?["adsource_price"]
|
||||
|
||||
let country = extra?["country"]
|
||||
|
||||
|
||||
if let adsourcePriceString = extra?["adsource_price"] as? String,
|
||||
let adsourcePrice = Double(adsourcePriceString) {
|
||||
StartManager.shared.ecpm = Float(adsourcePrice) / 1000
|
||||
print("-----ecpm ID: \(StartManager.shared.ecpm)")
|
||||
} else {
|
||||
print("无法获取 adsource_price 或类型不匹配")
|
||||
}
|
||||
|
||||
StartManager.shared.countryCode = country as? String
|
||||
StartManager.shared.network = network(networkID as! Int)
|
||||
StartManager.shared.shelfNumber = "静态页面壁纸load"
|
||||
StartManager.shared.adId = "n66bdc1da370ec"
|
||||
setPostload()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告被关闭")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension WA_4KVC:UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
@ -643,83 +520,3 @@ extension WA_4KVC:UICollectionViewDelegate,UICollectionViewDataSource,UICollecti
|
||||
}
|
||||
}
|
||||
|
||||
//if self.type == 1{
|
||||
// return self.wallpapers.count
|
||||
//}else if type == 2{
|
||||
// return self.newestWallpapers.count
|
||||
//}else if type == 3{
|
||||
// return self.popularWallpapers.count
|
||||
//}else if type == 4{
|
||||
// return self.SuperheroesWallpapers.count
|
||||
//}else if type == 5{
|
||||
// return self.ChristmasWallpapers.count
|
||||
//}else{
|
||||
// return self.FlowersWallpapers.count
|
||||
//}
|
||||
//extension WA_4KVC: MAAdDelegate
|
||||
//{
|
||||
// func createInterstitialAd()
|
||||
// {
|
||||
// interstitialAd = MAInterstitialAd(adUnitIdentifier: "880a042774979c3c")
|
||||
// interstitialAd.delegate = self
|
||||
//
|
||||
// // Load the first ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//
|
||||
// // MARK: MAAdDelegate Protocol
|
||||
//
|
||||
// func didLoad(_ ad: MAAd)
|
||||
// {
|
||||
// // Interstitial ad is ready to be shown. 'interstitialAd.isReady' will now return 'true'
|
||||
//
|
||||
// // Reset retry attempt
|
||||
// retryAttempt = 0
|
||||
// StartManager.shared.succeed = true
|
||||
//// StartManager.shared.loadTime = self.adLoadTime
|
||||
// StartManager.shared.adPlatform = "MAX"
|
||||
// StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
// StartManager.shared.adId = "880a042774979c3c"
|
||||
// StartManager.shared.platformResponseTime = ad.requestLatency
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
// StartManager.shared.dsp = ad.dspName
|
||||
// StartManager.shared.network = ad.networkName
|
||||
//
|
||||
//
|
||||
// setPostload()
|
||||
// }
|
||||
//
|
||||
// func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to load
|
||||
// // We recommend retrying with exponentially higher delays up to a maximum delay (in this case 64 seconds)
|
||||
//
|
||||
// retryAttempt += 1
|
||||
// let delaySec = pow(2.0, min(6.0, retryAttempt))
|
||||
//
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + delaySec) {
|
||||
// self.interstitialAd.load()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// func didDisplay(_ ad: MAAd)
|
||||
// {
|
||||
// // Pause your app's background audio
|
||||
// }
|
||||
//
|
||||
// func didClick(_ ad: MAAd) {}
|
||||
//
|
||||
// func didHide(_ ad: MAAd)
|
||||
// {
|
||||
// // Resume your app's background audio
|
||||
// // Interstitial ad is hidden. Pre-load the next ad
|
||||
// interstitialAd.load()
|
||||
// self.navigationController?.popViewController(animated: true)
|
||||
// }
|
||||
//
|
||||
// func didFail(toDisplay ad: MAAd, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to display. We recommend loading the next ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//}
|
||||
|
||||
@ -11,9 +11,7 @@ import AppLovinSDK
|
||||
import FirebaseAnalytics
|
||||
import Alamofire
|
||||
import FirebaseRemoteConfig
|
||||
import MTGSDKNewInterstitial
|
||||
import MTGSDKBidding
|
||||
import MTGSDK
|
||||
import AnyThinkInterstitial
|
||||
|
||||
class WA_DetailsVC: WA_RootVC {
|
||||
|
||||
@ -46,7 +44,7 @@ class WA_DetailsVC: WA_RootVC {
|
||||
|
||||
var isadshow:Bool = false
|
||||
var bidToken:String?
|
||||
var newInterstitialAdManager:MTGNewInterstitialBidAdManager?
|
||||
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
@ -107,96 +105,34 @@ class WA_DetailsVC: WA_RootVC {
|
||||
Analytics.logEvent("touch_savephoto", parameters: nil)
|
||||
self.activityView.startAnimating()
|
||||
saveImageToPhotoLibrary()
|
||||
//
|
||||
// if self.isadshow == true{
|
||||
// DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.5) {
|
||||
// if self.interstitialAd.isReady {
|
||||
// self.interstitialAd.show()
|
||||
// Analytics.logEvent("details_load_success", parameters: nil)
|
||||
// self.setPostSHOW()
|
||||
// let logMessage = """
|
||||
// deviceId: \(StartManager.shared.devicID ?? "")
|
||||
// localIp: \(StartManager.shared.localIP ?? "")
|
||||
// "deviceId": \(StartManager.shared.devicID ?? ""),
|
||||
// "localIp": \(StartManager.shared.localIP ?? ""),
|
||||
// "remoteIp": \(StartManager.shared.publicIP ?? ""),
|
||||
// "linkId": "",
|
||||
// "packageName": "com.wallpapaer.hd.live.app",
|
||||
// "gaid": \(StartManager.shared.idfaid ?? ""),
|
||||
// "dataId": "",
|
||||
// "shelfNumber": "壁纸详情点击保存",
|
||||
// "succeed": \(StartManager.shared.succeed),
|
||||
// "loadTime": \(StartManager.shared.loadTime ?? 0),
|
||||
// "adPlatform": \(StartManager.shared.adPlatform ?? ""),
|
||||
// "countryCode": \(StartManager.shared.countryCode ?? ""),
|
||||
// "adId": \(StartManager.shared.adId ?? ""),
|
||||
// "platformResponseTime": \(StartManager.shared.platformResponseTime ?? 0.0),
|
||||
// "getIpResponseTime": \(StartManager.shared.getIpResponseTime ?? 0.0),
|
||||
// "ecpm": \(StartManager.shared.ecpm ?? 0.0),
|
||||
// "dsp": \(StartManager.shared.dsp ?? ""),
|
||||
// "network": \(StartManager.shared.network ?? "")
|
||||
// """
|
||||
// AppDelegate.shared.addLogMessage(logMessage)
|
||||
// }else{
|
||||
// print("-------广告没准备好")
|
||||
// Analytics.logEvent("details_load_fail", parameters: nil)
|
||||
// DispatchQueue.global().asyncAfter(deadline: .now() + 1.5) {
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + 0){
|
||||
// self.activityView.stopAnimating()
|
||||
// // self.view.makeToast("Save Success", duration: 1.5, position: .center)
|
||||
// // 创建一个 UIAlertController
|
||||
// let alertController = UIAlertController(title: "Successfully saved", message: "Do you need to set up a tutorial", preferredStyle: .alert)
|
||||
//
|
||||
// // 添加一个取消按钮
|
||||
// alertController.addAction(UIAlertAction(title: "cancel", style: .cancel, handler: nil))
|
||||
//
|
||||
// // 添加一个确定按钮
|
||||
// alertController.addAction(UIAlertAction(title: "Need", style: .default, handler: { action in
|
||||
// // 点击确定按钮后执行的操作
|
||||
// // print("点击了确定按钮")
|
||||
// let vc = WA_TipVC()
|
||||
// self.present(vc, animated: true)
|
||||
// }))
|
||||
//
|
||||
// // 在当前视图控制器中 present 显示提示框
|
||||
// self.present(alertController, animated: true, completion: nil)
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }else{
|
||||
// Analytics.logEvent("details_load_fail", parameters: nil)
|
||||
// DispatchQueue.global().asyncAfter(deadline: .now() + 1.5) {
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + 0){
|
||||
// self.activityView.stopAnimating()
|
||||
// // self.view.makeToast("Save Success", duration: 1.5, position: .center)
|
||||
// // 创建一个 UIAlertController
|
||||
// let alertController = UIAlertController(title: "Successfully saved", message: "Do you need to set up a tutorial", preferredStyle: .alert)
|
||||
//
|
||||
// // 添加一个取消按钮
|
||||
// alertController.addAction(UIAlertAction(title: "cancel", style: .cancel, handler: nil))
|
||||
//
|
||||
// // 添加一个确定按钮
|
||||
// alertController.addAction(UIAlertAction(title: "Need", style: .default, handler: { action in
|
||||
// // 点击确定按钮后执行的操作
|
||||
// // print("点击了确定按钮")
|
||||
// let vc = WA_TipVC()
|
||||
// self.present(vc, animated: true)
|
||||
// }))
|
||||
//
|
||||
// // 在当前视图控制器中 present 显示提示框
|
||||
// self.present(alertController, animated: true, completion: nil)
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
let issureready = newInterstitialAdManager?.isAdReady()
|
||||
|
||||
if self.isadshow == true{
|
||||
if ((issureready) != nil) {
|
||||
newInterstitialAdManager?.show(from: self)
|
||||
self.setPostSHOW()
|
||||
if ATAdManager.shared().interstitialReady(forPlacementID: "n66bdc1aea4d27"){
|
||||
ATAdManager.shared().showInterstitial(withPlacementID: "n66bdc1aea4d27", in: self, delegate: self)
|
||||
StartManager.shared.shelfNumber = "详情页面SHOW"
|
||||
setPostSHOW()
|
||||
DispatchQueue.global().asyncAfter(deadline: .now() + 1.5) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0){
|
||||
self.activityView.stopAnimating()
|
||||
// self.view.makeToast("Save Success", duration: 1.5, position: .center)
|
||||
// 创建一个 UIAlertController
|
||||
let alertController = UIAlertController(title: "Successfully saved", message: "Do you need to set up a tutorial", preferredStyle: .alert)
|
||||
|
||||
// 添加一个取消按钮
|
||||
alertController.addAction(UIAlertAction(title: "cancel", style: .cancel, handler: nil))
|
||||
|
||||
// 添加一个确定按钮
|
||||
alertController.addAction(UIAlertAction(title: "Need", style: .default, handler: { action in
|
||||
// 点击确定按钮后执行的操作
|
||||
// print("点击了确定按钮")
|
||||
let vc = WA_TipVC()
|
||||
self.present(vc, animated: true)
|
||||
}))
|
||||
|
||||
// 在当前视图控制器中 present 显示提示框
|
||||
self.present(alertController, animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
}else{
|
||||
DispatchQueue.global().asyncAfter(deadline: .now() + 1.5) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0){
|
||||
@ -266,20 +202,17 @@ class WA_DetailsVC: WA_RootVC {
|
||||
// Fetch 配置值
|
||||
remoteConfig.setDefaults(fromPlist: "isopen")
|
||||
// Fetch 配置值
|
||||
let param = MTGBiddingRequestParameter(placementId: "1636950", unitId: "3501963", basePrice: nil)
|
||||
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1636950", unitId: "3501963", delegate: self)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
}else{
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
}
|
||||
loadTopAD()
|
||||
|
||||
}
|
||||
func loadTopAD(){
|
||||
let extra: [String: Any] = [
|
||||
kATAdLoadingExtraMediaExtraKey: "custom_values"
|
||||
]
|
||||
ATAdManager.shared().loadAD(withPlacementID: "n66bdc1aea4d27", extra: extra, delegate: self)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
}
|
||||
|
||||
@ -520,48 +453,12 @@ class WA_DetailsVC: WA_RootVC {
|
||||
@IBAction func back(_ sender: Any) {
|
||||
isback = true
|
||||
|
||||
// if self.isadshow == true{
|
||||
// DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.5) {
|
||||
// if self.interstitialAd.isReady {
|
||||
// self.interstitialAd.show()
|
||||
// Analytics.logEvent("details_load_success", parameters: nil)
|
||||
// self.setPostSHOW()
|
||||
// let logMessage = """
|
||||
// deviceId: \(StartManager.shared.devicID ?? "")
|
||||
// localIp: \(StartManager.shared.localIP ?? "")
|
||||
// "deviceId": \(StartManager.shared.devicID ?? ""),
|
||||
// "localIp": \(StartManager.shared.localIP ?? ""),
|
||||
// "remoteIp": \(StartManager.shared.publicIP ?? ""),
|
||||
// "linkId": "",
|
||||
// "packageName": "com.wallpapaer.hd.live.app",
|
||||
// "gaid": \(StartManager.shared.idfaid ?? ""),
|
||||
// "dataId": "",
|
||||
// "shelfNumber": "壁纸详情返回",
|
||||
// "succeed": \(StartManager.shared.succeed),
|
||||
// "loadTime": \(StartManager.shared.loadTime ?? 0),
|
||||
// "adPlatform": \(StartManager.shared.adPlatform ?? ""),
|
||||
// "countryCode": \(StartManager.shared.countryCode ?? ""),
|
||||
// "adId": \(StartManager.shared.adId ?? ""),
|
||||
// "platformResponseTime": \(StartManager.shared.platformResponseTime ?? 0.0),
|
||||
// "getIpResponseTime": \(StartManager.shared.getIpResponseTime ?? 0.0),
|
||||
// "ecpm": \(StartManager.shared.ecpm ?? 0.0),
|
||||
// "dsp": \(StartManager.shared.dsp ?? ""),
|
||||
// "network": \(StartManager.shared.network ?? "")
|
||||
// """
|
||||
// AppDelegate.shared.addLogMessage(logMessage)
|
||||
// }else{
|
||||
// self.navigationController?.popViewController(animated: true)
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// self.navigationController?.popViewController(animated: true)
|
||||
// }
|
||||
|
||||
|
||||
let issureready = newInterstitialAdManager?.isAdReady()
|
||||
if self.isadshow == true{
|
||||
if ((issureready) != nil) {
|
||||
newInterstitialAdManager?.show(from: self)
|
||||
if ATAdManager.shared().interstitialReady(forPlacementID: "n66bdc1aea4d27"){
|
||||
ATAdManager.shared().showInterstitial(withPlacementID: "n66bdc1aea4d27", in: self, delegate: self)
|
||||
StartManager.shared.shelfNumber = "详情页面SHOW"
|
||||
setPostSHOW()
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}else{
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
@ -572,301 +469,94 @@ class WA_DetailsVC: WA_RootVC {
|
||||
|
||||
}
|
||||
|
||||
func setPostload(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_load_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回加载",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
"showStatus": 0,
|
||||
"washParam": true,
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
func setPostSHOW(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_show_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回展示",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
extension WA_DetailsVC:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
// func newInterstitialBidAdShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告展示成功")
|
||||
// }
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("资源加载成功,表示可播放状态")
|
||||
|
||||
extension WA_DetailsVC:ATInterstitialDelegate{
|
||||
// 插页广告展示成功
|
||||
func interstitialDidShow(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----成功")
|
||||
|
||||
}
|
||||
/// 插页广告被点击
|
||||
func interstitialDidClick(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----点击")
|
||||
}
|
||||
// 插页广告已关闭
|
||||
func interstitialDidClose(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----关闭")
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
if isback == true{
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}else{
|
||||
DispatchQueue.global().asyncAfter(deadline: .now() + 1.5) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0){
|
||||
self.activityView.stopAnimating()
|
||||
// self.view.makeToast("Save Success", duration: 1.5, position: .center)
|
||||
// 创建一个 UIAlertController
|
||||
let alertController = UIAlertController(title: "Successfully saved", message: "Do you need to set up a tutorial", preferredStyle: .alert)
|
||||
|
||||
// 添加一个取消按钮
|
||||
alertController.addAction(UIAlertAction(title: "cancel", style: .cancel, handler: nil))
|
||||
|
||||
// 添加一个确定按钮
|
||||
alertController.addAction(UIAlertAction(title: "Need", style: .default, handler: { action in
|
||||
// 点击确定按钮后执行的操作
|
||||
// print("点击了确定按钮")
|
||||
let vc = WA_TipVC()
|
||||
self.present(vc, animated: true)
|
||||
}))
|
||||
|
||||
// 在当前视图控制器中 present 显示提示框
|
||||
self.present(alertController, animated: true, completion: nil)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
StartManager.shared.succeed = true
|
||||
// StartManager.shared.loadTime = self.adLoadTime
|
||||
StartManager.shared.adPlatform = "mbridge"
|
||||
StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
StartManager.shared.adId = "3501963"
|
||||
StartManager.shared.platformResponseTime = 0
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
StartManager.shared.dsp = ""
|
||||
StartManager.shared.network = ""
|
||||
func didFinishLoadingAD(withPlacementID placementID: String!) {
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
}
|
||||
|
||||
// load失败
|
||||
func didFailToLoadAD(withPlacementID placementID: String!, error: (any Error)!) {
|
||||
print("----load失败")
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(String(describing: placementID))---error\(String(describing: error))")
|
||||
|
||||
}
|
||||
// 完成加载广告
|
||||
func didFinishLoadingADSource(withPlacementID placementID: String!,extra: [AnyHashable : Any]?) {
|
||||
|
||||
let networkID = extra?["network_firm_id"]
|
||||
|
||||
let ecpm = extra?["adsource_price"]
|
||||
|
||||
let country = extra?["country"]
|
||||
|
||||
|
||||
if let adsourcePriceString = extra?["adsource_price"] as? String,
|
||||
let adsourcePrice = Double(adsourcePriceString) {
|
||||
StartManager.shared.ecpm = Float(adsourcePrice) / 1000
|
||||
print("-----ecpm ID: \(StartManager.shared.ecpm)")
|
||||
} else {
|
||||
print("无法获取 adsource_price 或类型不匹配")
|
||||
}
|
||||
|
||||
StartManager.shared.countryCode = country as? String
|
||||
StartManager.shared.network = network(networkID as! Int)
|
||||
StartManager.shared.shelfNumber = "详情页面load"
|
||||
StartManager.shared.adId = "n66bdc1aea4d27"
|
||||
setPostload()
|
||||
}
|
||||
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
if isback == true{
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}else{
|
||||
DispatchQueue.global().asyncAfter(deadline: .now() + 1.5) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0){
|
||||
self.activityView.stopAnimating()
|
||||
// self.view.makeToast("Save Success", duration: 1.5, position: .center)
|
||||
// 创建一个 UIAlertController
|
||||
let alertController = UIAlertController(title: "Successfully saved", message: "Do you need to set up a tutorial", preferredStyle: .alert)
|
||||
|
||||
// 添加一个取消按钮
|
||||
alertController.addAction(UIAlertAction(title: "cancel", style: .cancel, handler: nil))
|
||||
|
||||
// 添加一个确定按钮
|
||||
alertController.addAction(UIAlertAction(title: "Need", style: .default, handler: { action in
|
||||
// 点击确定按钮后执行的操作
|
||||
// print("点击了确定按钮")
|
||||
let vc = WA_TipVC()
|
||||
self.present(vc, animated: true)
|
||||
}))
|
||||
|
||||
// 在当前视图控制器中 present 显示提示框
|
||||
self.present(alertController, animated: true, completion: nil)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告被关闭")
|
||||
if isback == true{
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}else{
|
||||
DispatchQueue.global().asyncAfter(deadline: .now() + 1.5) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0){
|
||||
self.activityView.stopAnimating()
|
||||
// self.view.makeToast("Save Success", duration: 1.5, position: .center)
|
||||
// 创建一个 UIAlertController
|
||||
let alertController = UIAlertController(title: "Successfully saved", message: "Do you need to set up a tutorial", preferredStyle: .alert)
|
||||
|
||||
// 添加一个取消按钮
|
||||
alertController.addAction(UIAlertAction(title: "cancel", style: .cancel, handler: nil))
|
||||
|
||||
// 添加一个确定按钮
|
||||
alertController.addAction(UIAlertAction(title: "Need", style: .default, handler: { action in
|
||||
// 点击确定按钮后执行的操作
|
||||
// print("点击了确定按钮")
|
||||
let vc = WA_TipVC()
|
||||
self.present(vc, animated: true)
|
||||
}))
|
||||
|
||||
// 在当前视图控制器中 present 显示提示框
|
||||
self.present(alertController, animated: true, completion: nil)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
//extension WA_DetailsVC: MAAdDelegate
|
||||
//{
|
||||
// func createInterstitialAd()
|
||||
// {
|
||||
// interstitialAd = MAInterstitialAd(adUnitIdentifier: "880a042774979c3c")
|
||||
// interstitialAd.delegate = self
|
||||
//
|
||||
// // Load the first ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//
|
||||
// // MARK: MAAdDelegate Protocol
|
||||
//
|
||||
// func didLoad(_ ad: MAAd)
|
||||
// {
|
||||
// // Interstitial ad is ready to be shown. 'interstitialAd.isReady' will now return 'true'
|
||||
//
|
||||
// // Reset retry attempt
|
||||
// retryAttempt = 0
|
||||
// StartManager.shared.succeed = true
|
||||
//// StartManager.shared.loadTime = self.adLoadTime
|
||||
// StartManager.shared.adPlatform = "MAX"
|
||||
// StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
// StartManager.shared.adId = "880a042774979c3c"
|
||||
// StartManager.shared.platformResponseTime = ad.requestLatency
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
// StartManager.shared.dsp = ad.dspName
|
||||
// StartManager.shared.network = ad.networkName
|
||||
//
|
||||
//
|
||||
// setPostload()
|
||||
// }
|
||||
//
|
||||
// func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to load
|
||||
// // We recommend retrying with exponentially higher delays up to a maximum delay (in this case 64 seconds)
|
||||
//
|
||||
// retryAttempt += 1
|
||||
// let delaySec = pow(2.0, min(6.0, retryAttempt))
|
||||
//
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + delaySec) {
|
||||
// self.interstitialAd.load()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// func didDisplay(_ ad: MAAd)
|
||||
// {
|
||||
// // Pause your app's background audio
|
||||
// }
|
||||
//
|
||||
// func didClick(_ ad: MAAd) {}
|
||||
//
|
||||
// func didHide(_ ad: MAAd)
|
||||
// {
|
||||
// // Resume your app's background audio
|
||||
// // Interstitial ad is hidden. Pre-load the next ad
|
||||
// interstitialAd.load()
|
||||
// if isback == true{
|
||||
// self.navigationController?.popViewController(animated: true)
|
||||
// }else{
|
||||
// DispatchQueue.global().asyncAfter(deadline: .now() + 1.5) {
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + 0){
|
||||
// self.activityView.stopAnimating()
|
||||
// // self.view.makeToast("Save Success", duration: 1.5, position: .center)
|
||||
// // 创建一个 UIAlertController
|
||||
// let alertController = UIAlertController(title: "Successfully saved", message: "Do you need to set up a tutorial", preferredStyle: .alert)
|
||||
//
|
||||
// // 添加一个取消按钮
|
||||
// alertController.addAction(UIAlertAction(title: "cancel", style: .cancel, handler: nil))
|
||||
//
|
||||
// // 添加一个确定按钮
|
||||
// alertController.addAction(UIAlertAction(title: "Need", style: .default, handler: { action in
|
||||
// // 点击确定按钮后执行的操作
|
||||
// // print("点击了确定按钮")
|
||||
// let vc = WA_TipVC()
|
||||
// self.present(vc, animated: true)
|
||||
// }))
|
||||
//
|
||||
// // 在当前视图控制器中 present 显示提示框
|
||||
// self.present(alertController, animated: true, completion: nil)
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// func didFail(toDisplay ad: MAAd, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to display. We recommend loading the next ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import FirebaseRemoteConfig
|
||||
import MTGSDKNewInterstitial
|
||||
import MTGSDKBidding
|
||||
import MTGSDK
|
||||
import AnyThinkInterstitial
|
||||
|
||||
class WA_LIVEVC: WA_RootVC {
|
||||
|
||||
@ -53,50 +54,11 @@ class WA_LIVEVC: WA_RootVC {
|
||||
|
||||
@IBAction func back(_ sender: Any) {
|
||||
isback = true
|
||||
// if self.isadshow == true{
|
||||
// DispatchQueue.main.asyncAfter(wallDeadline: .now() + 0.5) {
|
||||
// if self.interstitialAd.isReady {
|
||||
// self.interstitialAd.show()
|
||||
// Analytics.logEvent("details_load_success", parameters: nil)
|
||||
// self.setPostSHOW()
|
||||
// let logMessage = """
|
||||
// deviceId: \(StartManager.shared.devicID ?? "")
|
||||
// localIp: \(StartManager.shared.localIP ?? "")
|
||||
// "deviceId": \(StartManager.shared.devicID ?? ""),
|
||||
// "localIp": \(StartManager.shared.localIP ?? ""),
|
||||
// "remoteIp": \(StartManager.shared.publicIP ?? ""),
|
||||
// "linkId": "",
|
||||
// "packageName": "com.wallpapaer.hd.live.app",
|
||||
// "gaid": \(StartManager.shared.idfaid ?? ""),
|
||||
// "dataId": "",
|
||||
// "shelfNumber": "壁纸返回",
|
||||
// "succeed": \(StartManager.shared.succeed),
|
||||
// "loadTime": \(StartManager.shared.loadTime ?? 0),
|
||||
// "adPlatform": \(StartManager.shared.adPlatform ?? ""),
|
||||
// "countryCode": \(StartManager.shared.countryCode ?? ""),
|
||||
// "adId": \(StartManager.shared.adId ?? ""),
|
||||
// "platformResponseTime": \(StartManager.shared.platformResponseTime ?? 0.0),
|
||||
// "getIpResponseTime": \(StartManager.shared.getIpResponseTime ?? 0.0),
|
||||
// "ecpm": \(StartManager.shared.ecpm ?? 0.0),
|
||||
// "dsp": \(StartManager.shared.dsp ?? ""),
|
||||
// "network": \(StartManager.shared.network ?? "")
|
||||
// """
|
||||
// AppDelegate.shared.addLogMessage(logMessage)
|
||||
// }else{
|
||||
// self.navigationController?.popViewController(animated: true)
|
||||
// }
|
||||
// }
|
||||
// }else{
|
||||
// self.navigationController?.popViewController(animated: true)
|
||||
// }
|
||||
|
||||
|
||||
// navigationController?.popViewController(animated: true)
|
||||
let issureready = newInterstitialAdManager?.isAdReady()
|
||||
if self.isadshow == true{
|
||||
if ((issureready) != nil) {
|
||||
newInterstitialAdManager?.show(from: self)
|
||||
self.setPostSHOW()
|
||||
if ATAdManager.shared().interstitialReady(forPlacementID: "n66bdc1be5c449"){
|
||||
ATAdManager.shared().showInterstitial(withPlacementID: "n66bdc1be5c449", in: self, delegate: self)
|
||||
StartManager.shared.shelfNumber = "动态页面壁纸show"
|
||||
setPostSHOW()
|
||||
}else{
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
@ -104,6 +66,7 @@ class WA_LIVEVC: WA_RootVC {
|
||||
}else{
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -129,7 +92,6 @@ class WA_LIVEVC: WA_RootVC {
|
||||
|
||||
|
||||
header.beginRefreshing()
|
||||
// footer.beginRefreshing()
|
||||
}
|
||||
func setCollectionView(){
|
||||
collectionView.delegate = self
|
||||
@ -216,21 +178,16 @@ class WA_LIVEVC: WA_RootVC {
|
||||
// Fetch 配置值
|
||||
// fetchRemoteConfig()
|
||||
|
||||
let param = MTGBiddingRequestParameter(placementId: "1650177", unitId: "3519003", basePrice: nil)
|
||||
loadTopAD()
|
||||
}
|
||||
|
||||
func loadTopAD(){
|
||||
let extra: [String: Any] = [
|
||||
kATAdLoadingExtraMediaExtraKey: "custom_values"
|
||||
]
|
||||
ATAdManager.shared().loadAD(withPlacementID: "n66bdc1be5c449", extra: extra, delegate: self)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1650177", unitId: "3519003", delegate: self)
|
||||
StartManager.shared.ecpm = Float(bidResponse.price)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
}else{
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///是否有广告
|
||||
@ -272,94 +229,14 @@ class WA_LIVEVC: WA_RootVC {
|
||||
}
|
||||
|
||||
|
||||
func setPostload(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_load_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回加载",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
"showStatus": 0,
|
||||
"washParam": true,
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
func setPostSHOW(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_show_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回展示",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
//extension WA_LIVEVC:JXSegmentedListContainerViewListDelegate{
|
||||
// func listView() -> UIView {
|
||||
// return view
|
||||
// }
|
||||
//}
|
||||
|
||||
extension WA_LIVEVC:UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
@ -380,141 +257,66 @@ extension WA_LIVEVC:UICollectionViewDelegate,UICollectionViewDataSource,UICollec
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
extension WA_LIVEVC:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
// func newInterstitialBidAdShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告展示成功")
|
||||
// }
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("资源加载成功,表示可播放状态")
|
||||
|
||||
|
||||
extension WA_LIVEVC:ATInterstitialDelegate{
|
||||
// 插页广告展示成功
|
||||
func interstitialDidShow(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
|
||||
print("----成功")
|
||||
}
|
||||
/// 插页广告被点击
|
||||
func interstitialDidClick(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----点击")
|
||||
}
|
||||
// 插页广告已关闭
|
||||
func interstitialDidClose(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----关闭")
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
StartManager.shared.succeed = true
|
||||
// StartManager.shared.loadTime = self.adLoadTime
|
||||
StartManager.shared.adPlatform = "mbridge"
|
||||
StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
StartManager.shared.adId = "1636952"
|
||||
StartManager.shared.platformResponseTime = 0
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
StartManager.shared.dsp = ""
|
||||
StartManager.shared.network = ""
|
||||
|
||||
func didFinishLoadingAD(withPlacementID placementID: String!) {
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
}
|
||||
|
||||
// load失败
|
||||
func didFailToLoadAD(withPlacementID placementID: String!, error: (any Error)!) {
|
||||
print("----load失败")
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(String(describing: placementID))---error\(String(describing: error))")
|
||||
|
||||
}
|
||||
// 完成加载广告
|
||||
func didFinishLoadingADSource(withPlacementID placementID: String!,extra: [AnyHashable : Any]?) {
|
||||
|
||||
let networkID = extra?["network_firm_id"]
|
||||
|
||||
let ecpm = extra?["adsource_price"]
|
||||
|
||||
let country = extra?["country"]
|
||||
|
||||
|
||||
if let adsourcePriceString = extra?["adsource_price"] as? String,
|
||||
let adsourcePrice = Double(adsourcePriceString) {
|
||||
StartManager.shared.ecpm = Float(adsourcePrice) / 1000
|
||||
print("-----ecpm ID: \(StartManager.shared.ecpm)")
|
||||
} else {
|
||||
print("无法获取 adsource_price 或类型不匹配")
|
||||
}
|
||||
|
||||
StartManager.shared.countryCode = country as? String
|
||||
StartManager.shared.network = network(networkID as! Int)
|
||||
StartManager.shared.shelfNumber = "动态页面壁纸load"
|
||||
StartManager.shared.adId = "n66bdc1be5c449"
|
||||
setPostload()
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告被关闭")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//extension WA_LIVEVC: MAAdDelegate
|
||||
//{
|
||||
// func createInterstitialAd()
|
||||
// {
|
||||
// interstitialAd = MAInterstitialAd(adUnitIdentifier: "880a042774979c3c")
|
||||
// interstitialAd.delegate = self
|
||||
//
|
||||
// // Load the first ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//
|
||||
// // MARK: MAAdDelegate Protocol
|
||||
//
|
||||
// func didLoad(_ ad: MAAd)
|
||||
// {
|
||||
// // Interstitial ad is ready to be shown. 'interstitialAd.isReady' will now return 'true'
|
||||
//
|
||||
// // Reset retry attempt
|
||||
// retryAttempt = 0
|
||||
// StartManager.shared.succeed = true
|
||||
//// StartManager.shared.loadTime = self.adLoadTime
|
||||
// StartManager.shared.adPlatform = "MAX"
|
||||
// StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
// StartManager.shared.adId = "880a042774979c3c"
|
||||
// StartManager.shared.platformResponseTime = ad.requestLatency
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
// StartManager.shared.dsp = ad.dspName
|
||||
// StartManager.shared.network = ad.networkName
|
||||
//
|
||||
//
|
||||
// setPostload()
|
||||
// }
|
||||
//
|
||||
// func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to load
|
||||
// // We recommend retrying with exponentially higher delays up to a maximum delay (in this case 64 seconds)
|
||||
//
|
||||
// retryAttempt += 1
|
||||
// let delaySec = pow(2.0, min(6.0, retryAttempt))
|
||||
//
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + delaySec) {
|
||||
// self.interstitialAd.load()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// func didDisplay(_ ad: MAAd)
|
||||
// {
|
||||
// // Pause your app's background audio
|
||||
// }
|
||||
//
|
||||
// func didClick(_ ad: MAAd) {}
|
||||
//
|
||||
// func didHide(_ ad: MAAd)
|
||||
// {
|
||||
// // Resume your app's background audio
|
||||
// // Interstitial ad is hidden. Pre-load the next ad
|
||||
// interstitialAd.load()
|
||||
// self.navigationController?.popViewController(animated: true)
|
||||
// }
|
||||
//
|
||||
// func didFail(toDisplay ad: MAAd, withError error: MAError)
|
||||
// {
|
||||
// // Interstitial ad failed to display. We recommend loading the next ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
@ -20,6 +20,8 @@ import MTGSDKNewInterstitial
|
||||
import MTGSDKBidding
|
||||
import MTGSDK
|
||||
|
||||
import AnyThinkInterstitial
|
||||
|
||||
struct FilePaths {
|
||||
// 创建目录搜索路径的列表。
|
||||
static let documentsPath : AnyObject = NSSearchPathForDirectoriesInDomains(.cachesDirectory,.userDomainMask,true)[0] as AnyObject
|
||||
@ -152,11 +154,12 @@ class WA_LiveVideoVC: WA_RootVC {
|
||||
|
||||
|
||||
@objc func buttonTapped(){
|
||||
let issureready = newInterstitialAdManager?.isAdReady()
|
||||
if self.isadshow == true{
|
||||
if ((issureready) != nil) {
|
||||
newInterstitialAdManager?.show(from: self)
|
||||
self.setPostSHOW()
|
||||
if ATAdManager.shared().interstitialReady(forPlacementID: "n66bdc18696105"){
|
||||
ATAdManager.shared().showInterstitial(withPlacementID: "n66bdc18696105", in: self, delegate: self)
|
||||
StartManager.shared.shelfNumber = "动态详情页面show"
|
||||
setPostSHOW()
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}else{
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
@ -164,7 +167,6 @@ class WA_LiveVideoVC: WA_RootVC {
|
||||
}else{
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
// navigationController?.popViewController(animated: true)
|
||||
|
||||
}
|
||||
|
||||
@ -217,21 +219,16 @@ class WA_LiveVideoVC: WA_RootVC {
|
||||
remoteConfig.configSettings = settings
|
||||
// Fetch 配置值
|
||||
remoteConfig.setDefaults(fromPlist: "isopen")
|
||||
let param = MTGBiddingRequestParameter(placementId: "1636950", unitId: "3501963", basePrice: nil)
|
||||
loadTopAD()
|
||||
}
|
||||
|
||||
func loadTopAD(){
|
||||
let extra: [String: Any] = [
|
||||
kATAdLoadingExtraMediaExtraKey: "custom_values"
|
||||
]
|
||||
ATAdManager.shared().loadAD(withPlacementID: "n66bdc18696105", extra: extra, delegate: self)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1636950", unitId: "3501963", delegate: self)
|
||||
StartManager.shared.ecpm = Float(bidResponse.price)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
}else{
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///是否有广告
|
||||
@ -272,86 +269,10 @@ class WA_LiveVideoVC: WA_RootVC {
|
||||
|
||||
}
|
||||
|
||||
func setPostload(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_load_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回加载",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
"showStatus": 0,
|
||||
"washParam": true,
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
func setPostSHOW(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_show_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回展示",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@IBAction func saveBtn(_ sender: UIButton) {
|
||||
@ -630,68 +551,60 @@ class WA_LiveVideoVC: WA_RootVC {
|
||||
})
|
||||
}
|
||||
}
|
||||
extension WA_LiveVideoVC:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
// func newInterstitialBidAdShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告展示成功")
|
||||
// }
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("资源加载成功,表示可播放状态")
|
||||
|
||||
extension WA_LiveVideoVC:ATInterstitialDelegate{
|
||||
// 插页广告展示成功
|
||||
func interstitialDidShow(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----成功")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
StartManager.shared.succeed = true
|
||||
// StartManager.shared.loadTime = self.adLoadTime
|
||||
StartManager.shared.adPlatform = "mbridge"
|
||||
StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
StartManager.shared.adId = "3501963"
|
||||
StartManager.shared.platformResponseTime = 0
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
StartManager.shared.dsp = ""
|
||||
StartManager.shared.network = ""
|
||||
|
||||
|
||||
setPostload()
|
||||
/// 插页广告被点击
|
||||
func interstitialDidClick(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----点击")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
// 插页广告已关闭
|
||||
func interstitialDidClose(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----关闭")
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
func didFinishLoadingAD(withPlacementID placementID: String!) {
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// load失败
|
||||
func didFailToLoadAD(withPlacementID placementID: String!, error: (any Error)!) {
|
||||
print("----load失败")
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(String(describing: placementID))---error\(String(describing: error))")
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告被关闭")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
// 完成加载广告
|
||||
func didFinishLoadingADSource(withPlacementID placementID: String!,extra: [AnyHashable : Any]?) {
|
||||
|
||||
let networkID = extra?["network_firm_id"]
|
||||
|
||||
let ecpm = extra?["adsource_price"]
|
||||
|
||||
let country = extra?["country"]
|
||||
|
||||
|
||||
if let adsourcePriceString = extra?["adsource_price"] as? String,
|
||||
let adsourcePrice = Double(adsourcePriceString) {
|
||||
StartManager.shared.ecpm = Float(adsourcePrice) / 1000
|
||||
print("-----ecpm ID: \(StartManager.shared.ecpm)")
|
||||
} else {
|
||||
print("无法获取 adsource_price 或类型不匹配")
|
||||
}
|
||||
|
||||
StartManager.shared.countryCode = country as? String
|
||||
StartManager.shared.network = network(networkID as! Int)
|
||||
StartManager.shared.shelfNumber = "动态详情页面load"
|
||||
StartManager.shared.adId = "n66bdc18696105"
|
||||
setPostload()
|
||||
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import FirebaseRemoteConfig
|
||||
import MTGSDKNewInterstitial
|
||||
import MTGSDKBidding
|
||||
import MTGSDK
|
||||
import AnyThinkInterstitial
|
||||
|
||||
|
||||
class WA_limitsVCViewController: WA_RootVC {
|
||||
@ -42,6 +43,10 @@ class WA_limitsVCViewController: WA_RootVC {
|
||||
var bidToken:String?
|
||||
var ecpmprice:Double?
|
||||
var newInterstitialAdManager:MTGNewInterstitialBidAdManager?
|
||||
|
||||
|
||||
var idstring:String = "n66bdc1e78a5d9"
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
@ -51,7 +56,7 @@ class WA_limitsVCViewController: WA_RootVC {
|
||||
remoteConfig = RemoteConfig.remoteConfig()
|
||||
|
||||
|
||||
|
||||
self.idstring = getRandomString() ?? "n66bdc1e78a5d9"
|
||||
// 设置最小获取间隔(开发期间可以设置较小的值)
|
||||
let settings = RemoteConfigSettings()
|
||||
settings.minimumFetchInterval = 0
|
||||
@ -68,33 +73,25 @@ class WA_limitsVCViewController: WA_RootVC {
|
||||
activityView.style = UIActivityIndicatorView.Style.whiteLarge
|
||||
|
||||
self.view.addSubview(activityView)
|
||||
self.activityView.startAnimating()
|
||||
let param = MTGBiddingRequestParameter(placementId: "1651004", unitId: "3520023", basePrice: nil)
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1651004", unitId: "3520023", delegate: self)
|
||||
StartManager.shared.ecpm = Float(bidResponse.price)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
}else{
|
||||
|
||||
let userDefaults = UserDefaults.standard
|
||||
if userDefaults.bool(forKey: "iswindows"){
|
||||
let appDelegate = UIApplication.shared.delegate
|
||||
appDelegate?.window??.rootViewController = WA_RootNAV(rootViewController: WA_playerVC())
|
||||
|
||||
}else{
|
||||
|
||||
WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
|
||||
}
|
||||
self.activityView.startAnimating()
|
||||
|
||||
|
||||
DispatchQueue.main.asyncAfter(wallDeadline: .now() + 3) {
|
||||
self.loadTopAD()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
func loadTopAD(){
|
||||
let extra: [String: Any] = [
|
||||
kATAdLoadingExtraMediaExtraKey: "custom_values"
|
||||
]
|
||||
ATAdManager.shared().loadAD(withPlacementID: self.idstring, extra: extra, delegate: self)
|
||||
self.fetchRemoteConfig()
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -102,9 +99,6 @@ class WA_limitsVCViewController: WA_RootVC {
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
self.retryBtn.isHidden = true
|
||||
|
||||
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
|
||||
// 请求跟踪授权
|
||||
requestTrackingAuthorization { idfa in
|
||||
@ -240,21 +234,20 @@ class WA_limitsVCViewController: WA_RootVC {
|
||||
let elapsedTime = Date().timeIntervalSince(adCheckStartTime!)
|
||||
let elapsedTimeInMilliseconds = Int(elapsedTime * 1000)
|
||||
// self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
let issureready = newInterstitialAdManager!.isAdReady()
|
||||
|
||||
if issureready {
|
||||
// interstitialAd.show()
|
||||
newInterstitialAdManager?.show(from: self)
|
||||
Analytics.logEvent("open_load_success", parameters: nil)
|
||||
// let issureready = newInterstitialAdManager!.isAdReady()
|
||||
if ATAdManager.shared().interstitialReady(forPlacementID: self.idstring)
|
||||
{
|
||||
ATAdManager.shared().showInterstitial(withPlacementID: self.idstring, in: self, delegate: self)
|
||||
adLoadTime = elapsedTimeInMilliseconds // 记录加载
|
||||
adCheckTimer?.invalidate()
|
||||
self.activityView.stopAnimating()
|
||||
if StartManager.shared.idfaid == ""{
|
||||
self.fetchIDFAUntilSuccess()
|
||||
}else{
|
||||
self.setPostSHOW()
|
||||
setPostSHOW()
|
||||
StartManager.shared.shelfNumber = "开屏show"
|
||||
}
|
||||
} else if elapsedTimeInMilliseconds >= 10000 { // 10000 毫秒 = 10 秒
|
||||
}else if elapsedTimeInMilliseconds >= 10000{
|
||||
adCheckTimer?.invalidate()
|
||||
let userDefaults = UserDefaults.standard
|
||||
if userDefaults.bool(forKey: "iswindows"){
|
||||
@ -267,11 +260,12 @@ class WA_limitsVCViewController: WA_RootVC {
|
||||
}
|
||||
Analytics.logEvent("open_load_fail", parameters: nil)
|
||||
self.activityView.stopAnimating()
|
||||
|
||||
} else {
|
||||
}else{
|
||||
print("广告未准备好,继续检查...")
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -307,98 +301,7 @@ class WA_limitsVCViewController: WA_RootVC {
|
||||
print("未知的相册权限状态")
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// // 停止监听网络状态
|
||||
// func stopListeningNetwork() {
|
||||
// NetworkReachabilityManager.default?.stopListening()
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func setPostload(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_load_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"开屏加载",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime":StartManager.shared.loadTime ?? "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
"showStatus": 0,
|
||||
"washParam": true,
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
func setPostSHOW(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_show_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"开屏展示",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime":StartManager.shared.loadTime ?? "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
]
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
func fetchIDFAUntilSuccess() {
|
||||
DispatchQueue.global(qos: .background).async {
|
||||
@ -430,220 +333,65 @@ class WA_limitsVCViewController: WA_RootVC {
|
||||
|
||||
}
|
||||
|
||||
extension WA_limitsVCViewController:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
// func newInterstitialBidAdShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告展示成功")
|
||||
// }
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("资源加载成功,表示可播放状态")
|
||||
|
||||
|
||||
extension WA_limitsVCViewController:ATInterstitialDelegate{
|
||||
func didFinishLoadingAD(withPlacementID placementID: String!) {
|
||||
print("----")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
StartManager.shared.shelfNumber = "开屏加载"
|
||||
StartManager.shared.succeed = true
|
||||
StartManager.shared.loadTime = self.adLoadTime
|
||||
StartManager.shared.adPlatform = "mbridge"
|
||||
StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
StartManager.shared.adId = self.idad
|
||||
StartManager.shared.platformResponseTime = 0.0
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
StartManager.shared.dsp = ""
|
||||
StartManager.shared.network = ""
|
||||
self.setPostload()
|
||||
}
|
||||
|
||||
// 插页广告展示成功
|
||||
func interstitialDidShow(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
print("----成功")
|
||||
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
/// 插页广告被点击
|
||||
func interstitialDidClick(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----点击")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
let userDefaults = UserDefaults.standard
|
||||
if userDefaults.bool(forKey: "iswindows"){
|
||||
let appDelegate = UIApplication.shared.delegate
|
||||
appDelegate?.window??.rootViewController = WA_RootNAV(rootViewController: WA_playerVC())
|
||||
}else{
|
||||
|
||||
|
||||
WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
// 插页广告已关闭
|
||||
func interstitialDidClose(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----关闭")
|
||||
|
||||
WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// 完成加载广告
|
||||
func didFinishLoadingADSource(withPlacementID placementID: String!,extra: [AnyHashable : Any]?) {
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告被关闭")
|
||||
let userDefaults = UserDefaults.standard
|
||||
if userDefaults.bool(forKey: "iswindows"){
|
||||
let appDelegate = UIApplication.shared.delegate
|
||||
appDelegate?.window??.rootViewController = WA_RootNAV(rootViewController: WA_playerVC())
|
||||
}else{
|
||||
WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
}
|
||||
let networkID = extra?["network_firm_id"]
|
||||
|
||||
let ecpm = extra?["adsource_price"]
|
||||
|
||||
let country = extra?["country"]
|
||||
|
||||
//
|
||||
// /**
|
||||
// * 在取消展示广告后并将控件返回到您的应用时调用
|
||||
// * @param converted - 视频是否播放完整
|
||||
// */
|
||||
// func newInterstitialAdDismissed(withConverted converted: Bool, adManager: MTGNewInterstitialAdManager) {
|
||||
//// log(NSStringFromSelector(#function))
|
||||
// }
|
||||
//
|
||||
// // 广告被关闭
|
||||
// func newInterstitialAdDidClosed(_ adManager: MTGNewInterstitialAdManager) {
|
||||
//// log(NSStringFromSelector(#function))
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 如果设置了插屏奖励,您将收到此回调
|
||||
// * @param rewardedOrNot 是否达到了可奖励状态
|
||||
// * @param alertWindowStatus 支持的类型列表
|
||||
// * 注意:您可以根据该回调决定是否给予奖励
|
||||
// */
|
||||
// func newInterstitialAdRewarded(_ rewardedOrNot: Bool, alertWindowStatus: MTGNIAlertWindowStatus, adManager: MTGNewInterstitialAdManager) {
|
||||
//// log(NSStringFromSelector(#function))
|
||||
// }
|
||||
|
||||
if let adsourcePriceString = extra?["adsource_price"] as? String,
|
||||
let adsourcePrice = Double(adsourcePriceString) {
|
||||
StartManager.shared.ecpm = Float(adsourcePrice) / 1000
|
||||
print("-----ecpm ID: \(StartManager.shared.ecpm)")
|
||||
} else {
|
||||
print("无法获取 adsource_price 或类型不匹配")
|
||||
}
|
||||
|
||||
StartManager.shared.countryCode = country as? String
|
||||
StartManager.shared.network = network(networkID as! Int)
|
||||
StartManager.shared.shelfNumber = "开屏load"
|
||||
StartManager.shared.adId = self.idstring
|
||||
setPostload()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
|
||||
}
|
||||
|
||||
|
||||
//extension WA_limitsVCViewController: MAAdDelegate
|
||||
//{
|
||||
// func createInterstitialAd() {
|
||||
//
|
||||
// let randomString = getRandomString()
|
||||
//
|
||||
// if StartManager.shared.adId == nil{
|
||||
// StartManager.shared.adId = randomString ?? "789b377f3ac14010e"
|
||||
// interstitialAd = MAInterstitialAd(adUnitIdentifier: StartManager.shared.adId!)
|
||||
// print("adid-----\(StartManager.shared.adId ?? "gggg")")
|
||||
// }else{
|
||||
// interstitialAd = MAInterstitialAd(adUnitIdentifier: StartManager.shared.adId!)
|
||||
// print("adid-----\(StartManager.shared.adId ?? "gggg")")
|
||||
// }
|
||||
//
|
||||
// interstitialAd.delegate = self
|
||||
// self.idad = randomString
|
||||
//
|
||||
// // Load the first ad
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//
|
||||
//
|
||||
// // MARK: MAAdDelegate Protocol
|
||||
//
|
||||
// /// 当广告加载成功时调用的方法
|
||||
// func didLoad(_ ad: MAAd) {
|
||||
// // 重试尝试次数重置为0
|
||||
// retryAttempt = 0
|
||||
// // 记录广告加载成功的相关信息
|
||||
// // StartManager.shared.shelfNumber = "开屏加载"
|
||||
// StartManager.shared.succeed = true
|
||||
// StartManager.shared.loadTime = self.adLoadTime
|
||||
// StartManager.shared.adPlatform = "MAX"
|
||||
// StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
// StartManager.shared.adId = self.idad
|
||||
// StartManager.shared.platformResponseTime = ad.requestLatency
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
// StartManager.shared.dsp = ad.dspName
|
||||
// StartManager.shared.network = ad.networkName
|
||||
//
|
||||
// let logMessage = """
|
||||
// deviceId: \(StartManager.shared.devicID ?? "")
|
||||
// localIp: \(StartManager.shared.localIP ?? "")
|
||||
// "remoteIp": \(StartManager.shared.publicIP ?? ""),
|
||||
// "linkId": "",
|
||||
// "packageName": "com.wallpapaer.hd.live.app",
|
||||
// "gaid": \(StartManager.shared.idfaid ?? ""),
|
||||
// "dataId": "",
|
||||
// "shelfNumber": "开屏展示",
|
||||
// "succeed": \(StartManager.shared.succeed),
|
||||
// "loadTime": \(StartManager.shared.loadTime ?? 0),
|
||||
// "adPlatform": \(StartManager.shared.adPlatform ?? ""),
|
||||
// "countryCode": \(StartManager.shared.countryCode ?? ""),
|
||||
// "adId": \(StartManager.shared.adId ?? ""),
|
||||
// "platformResponseTime": \(StartManager.shared.platformResponseTime ?? 0.0),
|
||||
// "getIpResponseTime": \(StartManager.shared.getIpResponseTime ?? 0.0),
|
||||
// "ecpm": \(StartManager.shared.ecpm ?? 0.0),
|
||||
// "dsp": \(StartManager.shared.dsp ?? ""),
|
||||
// "network": \(StartManager.shared.network ?? "")
|
||||
// """
|
||||
//
|
||||
// AppDelegate.shared.addLogMessage(logMessage)
|
||||
//
|
||||
// self.setPostload()
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /// 当广告加载失败时调用的方法
|
||||
// func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError) {
|
||||
// // 广告加载失败,建议进行重试
|
||||
// // 使用指数递增的延迟时间进行重试,最大延迟时间为 64 秒
|
||||
// retryAttempt += 1
|
||||
// let delaySec = pow(2.0, min(6.0, retryAttempt))
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + delaySec) {
|
||||
// self.interstitialAd.load()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /// 当广告显示时调用的方法
|
||||
// func didDisplay(_ ad: MAAd) {
|
||||
// // 暂停您的应用的背景音频
|
||||
// }
|
||||
//
|
||||
// /// 当用户点击广告时调用的方法
|
||||
// func didClick(_ ad: MAAd) {
|
||||
// // 用户点击广告
|
||||
// }
|
||||
//
|
||||
// /// 当广告隐藏时调用的方法
|
||||
// func didHide(_ ad: MAAd) {
|
||||
// // 恢复您的应用的背景音频
|
||||
// // 广告隐藏后,预加载下一个广告
|
||||
// interstitialAd.load()
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /// 当广告无法显示时调用的方法
|
||||
// func didFail(toDisplay ad: MAAd, withError error: MAError) {
|
||||
// // 广告无法显示,建议加载下一个广告
|
||||
// interstitialAd.load()
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
|
||||
// load失败
|
||||
func didFailToLoadAD(withPlacementID placementID: String!, error: (any Error)!) {
|
||||
print("----load失败")
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(String(describing: placementID))---error\(String(describing: error))")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,252 +0,0 @@
|
||||
//
|
||||
// WA_AddPlayerVC.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/7/19.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
import SVProgressHUD
|
||||
import AppLovinSDK
|
||||
import FirebaseAnalytics
|
||||
import FirebaseCore
|
||||
import FirebaseRemoteConfig
|
||||
import MTGSDKNewInterstitial
|
||||
import MTGSDKBidding
|
||||
import MTGSDK
|
||||
import Alamofire
|
||||
|
||||
class WA_AddPlayerVC: WA_RootVC {
|
||||
|
||||
|
||||
let activityView = UIActivityIndicatorView()
|
||||
|
||||
var interstitialAd: MAInterstitialAd!
|
||||
var retryAttempt = 0.0
|
||||
var remoteConfig: RemoteConfig!
|
||||
var isadshow:Bool = false
|
||||
var bidToken:String?
|
||||
var newInterstitialAdManager:MTGNewInterstitialBidAdManager?
|
||||
|
||||
|
||||
var adCheckTimer: Timer?
|
||||
var adCheckStartTime: Date?
|
||||
var adLoadTime: Int = 0
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
let param = MTGBiddingRequestParameter(placementId: "1651004", unitId: "3520023", basePrice: nil)
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1651004", unitId: "3520023", delegate: self)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
|
||||
self.startAdCheck()
|
||||
}else{
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
Analytics.logEvent("in_release", parameters: nil)
|
||||
|
||||
}
|
||||
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
self.navigationController?.navigationBar.isHidden = true
|
||||
|
||||
}
|
||||
|
||||
// /定时加载
|
||||
func startAdCheck() {
|
||||
|
||||
adCheckStartTime = Date()
|
||||
adCheckTimer = Timer.scheduledTimer(timeInterval: 0.01, target: self, selector: #selector(checkAdStatus), userInfo: nil, repeats: true)
|
||||
}
|
||||
|
||||
@objc func checkAdStatus() {
|
||||
let elapsedTime = Date().timeIntervalSince(adCheckStartTime!)
|
||||
let elapsedTimeInMilliseconds = Int(elapsedTime * 1000)
|
||||
|
||||
let issureready = newInterstitialAdManager!.isAdReady()
|
||||
|
||||
if issureready {
|
||||
|
||||
self.newInterstitialAdManager?.show(from: self)
|
||||
self.setPostSHOW()
|
||||
|
||||
|
||||
} else if elapsedTimeInMilliseconds >= 10000 { // 10000 毫秒 = 10 秒
|
||||
adCheckTimer?.invalidate()
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
} else {
|
||||
print("广告未准备好,继续检查...")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func setPostload(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_load_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"社区发布以及点击进入详情",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
"showStatus": 0,
|
||||
"washParam": true,
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
func setPostSHOW(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_show_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"社区发布以及点击进入详情",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//extension WA_AddPlayerVC: UIImagePickerControllerDelegate & UINavigationControllerDelegate {
|
||||
// func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
|
||||
// if let selectedImage = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
|
||||
//// contentImageV.image = selectedImage
|
||||
// }
|
||||
//
|
||||
// picker.dismiss(animated: true, completion: nil)
|
||||
// }
|
||||
//
|
||||
// func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
|
||||
// picker.dismiss(animated: true, completion: nil)
|
||||
// }
|
||||
//}
|
||||
extension WA_AddPlayerVC:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
// func newInterstitialBidAdShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告展示成功")
|
||||
// }
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("资源加载成功,表示可播放状态")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
StartManager.shared.succeed = true
|
||||
// StartManager.shared.loadTime = self.adLoadTime
|
||||
StartManager.shared.adPlatform = "mbridge"
|
||||
StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
StartManager.shared.adId = "3520023"
|
||||
StartManager.shared.platformResponseTime = 0
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
StartManager.shared.dsp = ""
|
||||
StartManager.shared.network = ""
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告被关闭")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
}
|
||||
@ -1,116 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WA_AddPlayerVC" customModule="wallpaper_project" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="view" destination="f9C-Bz-ldZ" id="HKK-5l-LsT"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="f9C-Bz-ldZ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Q5S-UO-5Ch">
|
||||
<rect key="frame" x="20" y="59" width="40" height="40"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="Twn-LZ-60t"/>
|
||||
<constraint firstAttribute="width" constant="40" id="jne-Ss-pgu"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" image="back_black"/>
|
||||
</button>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Recommend my wallpaper" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8ix-Tu-TpG">
|
||||
<rect key="frame" x="93.666666666666686" y="68.666666666666671" width="206" height="20.666666666666671"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="wT7-uV-4u8">
|
||||
<rect key="frame" x="20" y="109.33333333333331" width="353" height="120"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="120" id="3c6-66-2Os"/>
|
||||
</constraints>
|
||||
<color key="textColor" systemColor="labelColor"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
|
||||
</textView>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="add_s" translatesAutoresizingMaskIntoConstraints="NO" id="gvf-Lg-vPP">
|
||||
<rect key="frame" x="65" y="309.33333333333331" width="60" height="60"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="60" id="Yia-3M-phq"/>
|
||||
<constraint firstAttribute="height" constant="60" id="uWh-0o-bs0"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="PI4-1x-gN9">
|
||||
<rect key="frame" x="20" y="239.33333333333337" width="150" height="200"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="150" id="jT4-43-xOi"/>
|
||||
<constraint firstAttribute="height" constant="200" id="oeM-o4-w1k"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XcR-29-QsU">
|
||||
<rect key="frame" x="20" y="239.33333333333337" width="150" height="200"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="200" id="Oun-48-jxl"/>
|
||||
<constraint firstAttribute="width" constant="150" id="ohH-DC-FgE"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Sz5-1j-Mbd">
|
||||
<rect key="frame" x="20" y="499.33333333333326" width="353" height="50"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="YPD-Rl-6lM"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="sure">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
</button>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="Yb6-2I-07d"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Q5S-UO-5Ch" firstAttribute="leading" secondItem="Yb6-2I-07d" secondAttribute="leading" constant="20" id="3VJ-3B-AZw"/>
|
||||
<constraint firstItem="8ix-Tu-TpG" firstAttribute="centerX" secondItem="f9C-Bz-ldZ" secondAttribute="centerX" id="4f4-5W-i5d"/>
|
||||
<constraint firstItem="gvf-Lg-vPP" firstAttribute="centerX" secondItem="PI4-1x-gN9" secondAttribute="centerX" id="BVK-UP-7aa"/>
|
||||
<constraint firstItem="XcR-29-QsU" firstAttribute="leading" secondItem="Yb6-2I-07d" secondAttribute="leading" constant="20" id="ERC-o9-rtq"/>
|
||||
<constraint firstItem="wT7-uV-4u8" firstAttribute="top" secondItem="8ix-Tu-TpG" secondAttribute="bottom" constant="20" id="EyE-MY-Wef"/>
|
||||
<constraint firstItem="gvf-Lg-vPP" firstAttribute="centerY" secondItem="PI4-1x-gN9" secondAttribute="centerY" id="GDe-yf-jr7"/>
|
||||
<constraint firstItem="XcR-29-QsU" firstAttribute="top" secondItem="wT7-uV-4u8" secondAttribute="bottom" constant="10" id="Kbi-QD-edL"/>
|
||||
<constraint firstItem="PI4-1x-gN9" firstAttribute="leading" secondItem="Yb6-2I-07d" secondAttribute="leading" constant="20" id="Lt8-Kh-q1X"/>
|
||||
<constraint firstItem="wT7-uV-4u8" firstAttribute="leading" secondItem="Yb6-2I-07d" secondAttribute="leading" constant="20" id="O0F-rF-0eK"/>
|
||||
<constraint firstItem="Sz5-1j-Mbd" firstAttribute="top" secondItem="PI4-1x-gN9" secondAttribute="bottom" constant="60" id="ONk-v0-hCG"/>
|
||||
<constraint firstItem="Yb6-2I-07d" firstAttribute="trailing" secondItem="Sz5-1j-Mbd" secondAttribute="trailing" constant="20" id="XMX-pj-E7S"/>
|
||||
<constraint firstItem="Sz5-1j-Mbd" firstAttribute="leading" secondItem="Yb6-2I-07d" secondAttribute="leading" constant="20" id="ZAo-g5-jCr"/>
|
||||
<constraint firstItem="8ix-Tu-TpG" firstAttribute="centerY" secondItem="Q5S-UO-5Ch" secondAttribute="centerY" id="bny-Xa-Ywf"/>
|
||||
<constraint firstItem="PI4-1x-gN9" firstAttribute="top" secondItem="wT7-uV-4u8" secondAttribute="bottom" constant="10" id="jml-2u-QdW"/>
|
||||
<constraint firstItem="Q5S-UO-5Ch" firstAttribute="top" secondItem="Yb6-2I-07d" secondAttribute="top" id="o2C-Dv-gDL"/>
|
||||
<constraint firstItem="Yb6-2I-07d" firstAttribute="trailing" secondItem="wT7-uV-4u8" secondAttribute="trailing" constant="20" id="wGD-Ic-Nq9"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="132" y="-11"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="add_s" width="48" height="48"/>
|
||||
<image name="back_black" width="20" height="20"/>
|
||||
<systemColor name="labelColor">
|
||||
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
@ -1,325 +0,0 @@
|
||||
//
|
||||
// WA_CommunityPlayerVC.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/7/19.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import FirebaseAnalytics
|
||||
import FirebaseCore
|
||||
import AppLovinSDK
|
||||
import Alamofire
|
||||
import SVProgressHUD
|
||||
import FirebaseRemoteConfig
|
||||
import MTGSDKNewInterstitial
|
||||
import MTGSDKBidding
|
||||
import MTGSDK
|
||||
|
||||
|
||||
class WA_CommunityPlayerVC: WA_RootVC {
|
||||
|
||||
@IBOutlet weak var tableView: UITableView!
|
||||
|
||||
var MKArr = [WA_RakModel]()
|
||||
var interstitialAd: MAInterstitialAd!
|
||||
var retryAttempt = 0.0
|
||||
var touchrelease:Bool = false
|
||||
var indexrow:Int?
|
||||
var isseleted:Bool = false
|
||||
let activityView = UIActivityIndicatorView()
|
||||
|
||||
var remoteConfig: RemoteConfig!
|
||||
|
||||
var isadshow:Bool = false
|
||||
|
||||
var bidToken:String?
|
||||
var newInterstitialAdManager:MTGNewInterstitialBidAdManager?
|
||||
|
||||
|
||||
var adCheckTimer: Timer?
|
||||
var adCheckStartTime: Date?
|
||||
var adLoadTime: Int = 0
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
// self.createInterstitialAd()
|
||||
setNetwork()
|
||||
settableView()
|
||||
|
||||
let param = MTGBiddingRequestParameter(placementId: "1650169", unitId: "3518993", basePrice: nil)
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1650169", unitId: "3518993", delegate: self)
|
||||
StartManager.shared.ecpm = Float(bidResponse.price)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
|
||||
self.startAdCheck()
|
||||
}else{
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func settableView(){
|
||||
tableView.delegate = self
|
||||
tableView.dataSource = self
|
||||
tableView.register(UINib(nibName: "WA_RakingCell", bundle: nil), forCellReuseIdentifier: "WA_RakingCell")
|
||||
}
|
||||
|
||||
func setNetwork(){
|
||||
if let path = Bundle.main.path(forResource: "rankJson", ofType: "json"),
|
||||
let jsonData = try? Data(contentsOf: URL(fileURLWithPath: path)),
|
||||
let rkModels = try? JSONDecoder().decode([WA_RakModel].self, from: jsonData) {
|
||||
MKArr = rkModels
|
||||
} else {
|
||||
print("Failed to read or parse JSON file.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
self.navigationController?.navigationBar.isHidden = true
|
||||
// 初始化 Remote Config
|
||||
// remoteConfig = RemoteConfig.remoteConfig()
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
// /定时加载
|
||||
func startAdCheck() {
|
||||
|
||||
adCheckStartTime = Date()
|
||||
adCheckTimer = Timer.scheduledTimer(timeInterval: 0.01, target: self, selector: #selector(checkAdStatus), userInfo: nil, repeats: true)
|
||||
}
|
||||
|
||||
@objc func checkAdStatus() {
|
||||
let elapsedTime = Date().timeIntervalSince(adCheckStartTime!)
|
||||
let elapsedTimeInMilliseconds = Int(elapsedTime * 1000)
|
||||
|
||||
let issureready = newInterstitialAdManager!.isAdReady()
|
||||
|
||||
if issureready {
|
||||
|
||||
self.newInterstitialAdManager?.show(from: self)
|
||||
self.setPostSHOW()
|
||||
|
||||
|
||||
} else if elapsedTimeInMilliseconds >= 10000 { // 10000 毫秒 = 10 秒
|
||||
adCheckTimer?.invalidate()
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
} else {
|
||||
print("广告未准备好,继续检查...")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@IBAction func addBtn(_ sender: Any) {
|
||||
self.isseleted = false
|
||||
|
||||
let issureready = newInterstitialAdManager?.isAdReady()
|
||||
if self.isadshow == true{
|
||||
if ((issureready) != nil) {
|
||||
newInterstitialAdManager?.show(from: self)
|
||||
}else{
|
||||
if isLoggedIn(){
|
||||
let vc = WA_AddVC()
|
||||
vc.modalPresentationStyle = .fullScreen
|
||||
self.present(vc, animated: true)
|
||||
|
||||
}else{
|
||||
let vc = WA_LoginVC()
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
if isLoggedIn(){
|
||||
let vc = WA_AddVC()
|
||||
vc.modalPresentationStyle = .fullScreen
|
||||
self.present(vc, animated: true)
|
||||
|
||||
}else{
|
||||
let vc = WA_LoginVC()
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
func setPostload(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_load_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"社区发布以及点击进入详情",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
"showStatus": 0,
|
||||
"washParam": true,
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
func setPostSHOW(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_show_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"社区发布以及点击进入详情",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
extension WA_CommunityPlayerVC:UITableViewDelegate,UITableViewDataSource{
|
||||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return MKArr.count
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "WA_RakingCell", for: indexPath)as!WA_RakingCell
|
||||
cell.model = MKArr[indexPath.row]
|
||||
cell.shView.isHidden = true
|
||||
|
||||
return cell
|
||||
|
||||
}
|
||||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
}
|
||||
|
||||
}
|
||||
extension WA_CommunityPlayerVC:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("资源加载成功,表示可播放状态")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
StartManager.shared.succeed = true
|
||||
// StartManager.shared.loadTime = self.adLoadTime
|
||||
StartManager.shared.adPlatform = "mbridge"
|
||||
StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
StartManager.shared.adId = "3518993"
|
||||
StartManager.shared.platformResponseTime = 0
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
StartManager.shared.dsp = ""
|
||||
StartManager.shared.network = ""
|
||||
|
||||
|
||||
setPostload()
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告被关闭")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WA_CommunityPlayerVC" customModule="wallpaper_project" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="tableView" destination="w0J-5u-6mc" id="xSh-sE-dqe"/>
|
||||
<outlet property="view" destination="B1d-HQ-Adm" id="ukh-gK-6Yw"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="B1d-HQ-Adm">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Community" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MVk-Eu-3ba">
|
||||
<rect key="frame" x="130.66666666666669" y="59" width="131.66666666666669" height="30"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="25"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="w0J-5u-6mc">
|
||||
<rect key="frame" x="0.0" y="109" width="393" height="709"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</tableView>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Upo-Lg-CKV">
|
||||
<rect key="frame" x="313" y="738" width="60" height="60"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" image="add"/>
|
||||
</button>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="cMm-YL-WOc"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="w0J-5u-6mc" firstAttribute="top" secondItem="MVk-Eu-3ba" secondAttribute="bottom" constant="20" id="2vm-HT-hVd"/>
|
||||
<constraint firstItem="cMm-YL-WOc" firstAttribute="trailing" secondItem="w0J-5u-6mc" secondAttribute="trailing" id="7d1-gs-jS8"/>
|
||||
<constraint firstItem="cMm-YL-WOc" firstAttribute="trailing" secondItem="Upo-Lg-CKV" secondAttribute="trailing" constant="20" id="8AQ-bg-Ym2"/>
|
||||
<constraint firstItem="w0J-5u-6mc" firstAttribute="leading" secondItem="cMm-YL-WOc" secondAttribute="leading" id="RQK-GM-hbN"/>
|
||||
<constraint firstItem="MVk-Eu-3ba" firstAttribute="centerX" secondItem="B1d-HQ-Adm" secondAttribute="centerX" id="V26-IJ-uJr"/>
|
||||
<constraint firstItem="MVk-Eu-3ba" firstAttribute="top" secondItem="cMm-YL-WOc" secondAttribute="top" id="Xrj-48-BdS"/>
|
||||
<constraint firstItem="cMm-YL-WOc" firstAttribute="bottom" secondItem="Upo-Lg-CKV" secondAttribute="bottom" constant="20" id="bry-Ji-Hpn"/>
|
||||
<constraint firstItem="cMm-YL-WOc" firstAttribute="bottom" secondItem="w0J-5u-6mc" secondAttribute="bottom" id="ywN-r1-uFY"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-164" y="-38"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="add" width="60" height="60"/>
|
||||
</resources>
|
||||
</document>
|
||||
@ -1,587 +0,0 @@
|
||||
//
|
||||
// WA_player4kVC.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/7/19.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
import JXSegmentedView
|
||||
import MJExtension
|
||||
import MJRefresh
|
||||
import FirebaseAnalytics
|
||||
import AppLovinSDK
|
||||
import Alamofire
|
||||
import FirebaseRemoteConfig
|
||||
import MTGSDKNewInterstitial
|
||||
import MTGSDKBidding
|
||||
import MTGSDK
|
||||
|
||||
class WA_player4kVC: WA_RootVC {
|
||||
@IBOutlet weak var collectionView: UICollectionView!
|
||||
|
||||
@IBOutlet weak var nameLabel: UILabel!
|
||||
|
||||
var wallpapers = [WA_3DModel]()
|
||||
|
||||
var currentPage: Int = 1 // 当前页数
|
||||
let pageSize: Int = 10 // 每页加载的数量
|
||||
var interstitialAd: MAInterstitialAd!
|
||||
var retryAttempt = 0.0
|
||||
// 顶部刷新
|
||||
let header = MJRefreshNormalHeader()
|
||||
// 底部刷新
|
||||
let footer = MJRefreshAutoNormalFooter()
|
||||
// var MKArr = [WallpaperModel]()
|
||||
|
||||
// 存储不同类型的壁纸数组
|
||||
var newestWallpapers: [WallpaperData] = []
|
||||
var popularWallpapers: [WallpaperData] = []
|
||||
var FlowersWallpapers: [WallpaperData] = []
|
||||
var SuperheroesWallpapers: [WallpaperData] = []
|
||||
var ChristmasWallpapers: [WallpaperData] = []
|
||||
|
||||
|
||||
var remoteConfig: RemoteConfig!
|
||||
|
||||
var isadshow:Bool = false
|
||||
|
||||
var bidToken:String?
|
||||
var newInterstitialAdManager:MTGNewInterstitialBidAdManager?
|
||||
var type:Int = 0
|
||||
|
||||
|
||||
var adCheckTimer: Timer?
|
||||
var adCheckStartTime: Date?
|
||||
var adLoadTime: Int = 0
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
let param = MTGBiddingRequestParameter(placementId: "1636950", unitId: "3501963", basePrice: nil)
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1636950", unitId: "3501963", delegate: self)
|
||||
StartManager.shared.ecpm = Float(bidResponse.price)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
|
||||
|
||||
self.startAdCheck()
|
||||
}else{
|
||||
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
// self.createInterstitialAd()
|
||||
Analytics.logEvent("in_4k", parameters: nil)
|
||||
self.view.backgroundColor = .white
|
||||
setCollectionView()
|
||||
|
||||
setRefresh()
|
||||
|
||||
if StartManager.shared.superHero == true{
|
||||
// return dataimag.count
|
||||
// cell.typeImagV.image = UIImage(named: "\(self.dataimag[indexPath.row])")
|
||||
if self.type == 1{
|
||||
self.nameLabel.text = "4K"
|
||||
// self.wallpapers.count
|
||||
}else if type == 2{
|
||||
self.nameLabel.text = "Newest"
|
||||
}else if type == 3{
|
||||
self.nameLabel.text = "Popular Wallpapers"
|
||||
}else if type == 4{
|
||||
self.nameLabel.text = "Superheroes"
|
||||
}else if type == 5{
|
||||
self.nameLabel.text = "Christmas Wallpapers"
|
||||
}else{
|
||||
self.nameLabel.text = "Flowers"
|
||||
}
|
||||
}else{
|
||||
// return dataimaghero.count
|
||||
// cell.typeImagV.image = UIImage(named: "\(self.dataimaghero[indexPath.row])")
|
||||
if self.type == 1{
|
||||
self.nameLabel.text = "4K"
|
||||
// self.wallpapers.count
|
||||
}else if type == 2{
|
||||
self.nameLabel.text = "Newest"
|
||||
}else if type == 3{
|
||||
self.nameLabel.text = "Popular Wallpapers"
|
||||
}else if type == 4{
|
||||
self.nameLabel.text = "Christmas Wallpapers"
|
||||
}else{
|
||||
self.nameLabel.text = "Flowers"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@IBAction func backbtn(_ sender: Any) {
|
||||
|
||||
let issureready = newInterstitialAdManager?.isAdReady()
|
||||
if ((issureready) != nil) {
|
||||
newInterstitialAdManager?.show(from: self)
|
||||
self.setPostSHOW()
|
||||
}else{
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
}
|
||||
@objc func setRefresh(){
|
||||
refreshData()
|
||||
|
||||
header.setRefreshingTarget(self, refreshingAction: #selector(WA_LIVEVC.setRefresh))
|
||||
// 现在的版本要用mj_header
|
||||
|
||||
header.setTitle("pull-to-refresh", for: .idle)
|
||||
header.setTitle("Release updates", for: .pulling)
|
||||
header.setTitle("Refreshing...", for: .refreshing)
|
||||
self.collectionView.mj_header = header
|
||||
|
||||
|
||||
// 上拉刷新
|
||||
footer.setRefreshingTarget(self, refreshingAction: #selector(WA_LIVEVC.loadMoreData))
|
||||
footer.setTitle("Pull up loading", for: .idle)
|
||||
footer.setTitle("Release Load", for: .pulling)
|
||||
footer.setTitle("Loading...", for: .refreshing)
|
||||
self.collectionView.mj_footer = footer
|
||||
|
||||
|
||||
header.beginRefreshing()
|
||||
// footer.beginRefreshing()
|
||||
|
||||
|
||||
}
|
||||
// 下拉刷新
|
||||
@objc func refreshData() {
|
||||
currentPage = 1
|
||||
setJsondata()
|
||||
settypeNetwork()
|
||||
}
|
||||
|
||||
// 上拉加载更多
|
||||
@objc func loadMoreData() {
|
||||
currentPage += 1
|
||||
setJsondata()
|
||||
settypeNetwork()
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
navigationController?.navigationBar.isHidden = true
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// /定时加载
|
||||
func startAdCheck() {
|
||||
|
||||
adCheckStartTime = Date()
|
||||
adCheckTimer = Timer.scheduledTimer(timeInterval: 0.01, target: self, selector: #selector(checkAdStatus), userInfo: nil, repeats: true)
|
||||
}
|
||||
|
||||
@objc func checkAdStatus() {
|
||||
let elapsedTime = Date().timeIntervalSince(adCheckStartTime!)
|
||||
let elapsedTimeInMilliseconds = Int(elapsedTime * 1000)
|
||||
|
||||
let issureready = newInterstitialAdManager!.isAdReady()
|
||||
|
||||
if issureready {
|
||||
|
||||
self.newInterstitialAdManager?.show(from: self)
|
||||
self.setPostSHOW()
|
||||
|
||||
} else if elapsedTimeInMilliseconds >= 10000 { // 10000 毫秒 = 10 秒
|
||||
adCheckTimer?.invalidate()
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
} else {
|
||||
print("广告未准备好,继续检查...")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
func setCollectionView(){
|
||||
collectionView.delegate = self
|
||||
collectionView.dataSource = self
|
||||
|
||||
// 设置 collection view 的布局
|
||||
let layout = CustomCollectionViewFlowLayout()
|
||||
collectionView.collectionViewLayout = layout
|
||||
layout.scrollDirection = .vertical
|
||||
|
||||
collectionView.register(UINib(nibName: "WA_WallpaperCollectionCell", bundle: nil), forCellWithReuseIdentifier: "WA_WallpaperCollectionCell")
|
||||
|
||||
}
|
||||
func setJsondata(){
|
||||
// 读取 JSON 文件并解析
|
||||
if let path = Bundle.main.path(forResource: "4k", ofType: "json") {
|
||||
do {
|
||||
let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .mappedIfSafe)
|
||||
|
||||
// 使用 MJExtension 解析 JSON 数据
|
||||
let jsonArray = try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [[String: Any]]
|
||||
|
||||
if let jsonArray = jsonArray {
|
||||
// 使用 MJExtension 将 JSON 数组转换为模型数组
|
||||
let wallpapersarr = (WA_3DModel.mj_objectArray(withKeyValuesArray: jsonArray) as? [WA_3DModel])!
|
||||
|
||||
if currentPage == 1 {
|
||||
// 只取前10条数据
|
||||
let firstTenWallpapers = Array(wallpapersarr.prefix(10))
|
||||
self.wallpapers = firstTenWallpapers
|
||||
collectionView.reloadData()
|
||||
collectionView.mj_header?.endRefreshing()
|
||||
} else {
|
||||
// 上拉加载更多
|
||||
let startIndex = currentPage * pageSize
|
||||
let moreWallpapers = Array(wallpapersarr.prefix(startIndex))
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5){
|
||||
self.wallpapers = moreWallpapers
|
||||
self.collectionView.reloadData()
|
||||
self.collectionView.mj_footer?.endRefreshing()
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
print("Error reading JSON file:", error.localizedDescription)
|
||||
}
|
||||
} else {
|
||||
print("JSON file not found.")
|
||||
}
|
||||
}
|
||||
|
||||
func settypeNetwork(){
|
||||
// 读取 JSON 文件路径
|
||||
guard let jsonFilePath = Bundle.main.path(forResource: "my_wallpaper", ofType: "json") else {
|
||||
fatalError("Unable to locate my_wallpaper.json file.")
|
||||
}
|
||||
|
||||
// 读取 JSON 数据
|
||||
do {
|
||||
// 读取 JSON 数据
|
||||
let jsonData = try Data(contentsOf: URL(fileURLWithPath: jsonFilePath))
|
||||
|
||||
// 尝试将 JSON 数据转换为 Swift 对象
|
||||
let decoder = JSONDecoder()
|
||||
let wallpaperModels = try decoder.decode([WallpaperModel].self, from: jsonData)
|
||||
|
||||
// 遍历解析后的 WallpaperModel 对象数组
|
||||
for wallpaperModel in wallpaperModels {
|
||||
// 根据名称将数据放入不同的数组中
|
||||
switch wallpaperModel.name {
|
||||
case "Newest":
|
||||
newestWallpapers = wallpaperModel.data
|
||||
case "Popular Wallpapers":
|
||||
popularWallpapers = wallpaperModel.data
|
||||
case "Superheroes":
|
||||
SuperheroesWallpapers = wallpaperModel.data
|
||||
case "Christmas Wallpapers":
|
||||
ChristmasWallpapers = wallpaperModel.data
|
||||
case "Flowers":
|
||||
FlowersWallpapers = wallpaperModel.data
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
} catch {
|
||||
print("Error reading or parsing JSON file: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func setPostload(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_load_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回加载",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
"showStatus": 0,
|
||||
"washParam": true,
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
func setPostSHOW(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_show_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回展示",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
extension WA_player4kVC:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
// func newInterstitialBidAdShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告展示成功")
|
||||
// }
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("资源加载成功,表示可播放状态")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
StartManager.shared.succeed = true
|
||||
// StartManager.shared.loadTime = self.adLoadTime
|
||||
StartManager.shared.adPlatform = "mbridge"
|
||||
StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
StartManager.shared.adId = "3501963"
|
||||
StartManager.shared.platformResponseTime = 0
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
StartManager.shared.dsp = ""
|
||||
StartManager.shared.network = ""
|
||||
|
||||
|
||||
setPostload()
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告被关闭")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
}
|
||||
extension WA_player4kVC:UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
if StartManager.shared.superHero == true{
|
||||
if self.type == 1{
|
||||
return self.wallpapers.count
|
||||
}else if type == 2{
|
||||
return self.newestWallpapers.count
|
||||
}else if type == 3{
|
||||
return self.popularWallpapers.count
|
||||
}else if type == 4{
|
||||
return self.SuperheroesWallpapers.count
|
||||
}else if type == 5{
|
||||
return self.ChristmasWallpapers.count
|
||||
}else{
|
||||
return self.FlowersWallpapers.count
|
||||
}
|
||||
}else{
|
||||
if self.type == 1{
|
||||
return self.wallpapers.count
|
||||
}else if type == 2{
|
||||
return self.newestWallpapers.count
|
||||
}else if type == 3{
|
||||
return self.popularWallpapers.count
|
||||
}else if type == 4{
|
||||
return self.ChristmasWallpapers.count
|
||||
}else{
|
||||
return self.FlowersWallpapers.count
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "WA_WallpaperCollectionCell", for: indexPath)as!WA_WallpaperCollectionCell
|
||||
if StartManager.shared.superHero == true{
|
||||
if self.type == 1{
|
||||
cell.model = self.wallpapers[indexPath.row]
|
||||
}else if type == 2{
|
||||
let model = self.newestWallpapers[indexPath.row]
|
||||
if let imageURL = URL(string: model.previewThumb ?? "") {
|
||||
cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle"))
|
||||
}
|
||||
}else if type == 3{
|
||||
let model = self.popularWallpapers[indexPath.row]
|
||||
if let imageURL = URL(string: model.previewThumb ?? "") {
|
||||
cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle"))
|
||||
}
|
||||
}else if type == 4{
|
||||
let model = self.SuperheroesWallpapers[indexPath.row]
|
||||
if let imageURL = URL(string: model.previewThumb ?? "") {
|
||||
cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle"))
|
||||
}
|
||||
}else if type == 5{
|
||||
let model = self.ChristmasWallpapers[indexPath.row]
|
||||
if let imageURL = URL(string: model.previewThumb ?? "") {
|
||||
cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle"))
|
||||
}
|
||||
}else{
|
||||
let model = self.FlowersWallpapers[indexPath.row]
|
||||
if let imageURL = URL(string: model.previewThumb ?? "") {
|
||||
cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle"))
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if self.type == 1{
|
||||
cell.model = self.wallpapers[indexPath.row]
|
||||
}else if type == 2{
|
||||
let model = self.newestWallpapers[indexPath.row]
|
||||
if let imageURL = URL(string: model.previewThumb ?? "") {
|
||||
cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle"))
|
||||
}
|
||||
}else if type == 3{
|
||||
let model = self.popularWallpapers[indexPath.row]
|
||||
if let imageURL = URL(string: model.previewThumb ?? "") {
|
||||
cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle"))
|
||||
}
|
||||
}else if type == 4{
|
||||
let model = self.ChristmasWallpapers[indexPath.row]
|
||||
if let imageURL = URL(string: model.previewThumb ?? "") {
|
||||
cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle"))
|
||||
}
|
||||
}else{
|
||||
let model = self.FlowersWallpapers[indexPath.row]
|
||||
if let imageURL = URL(string: model.previewThumb ?? "") {
|
||||
cell.wpImagV.sd_setImage(with: imageURL, placeholderImage: UIImage(named: "Rectangle"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return cell
|
||||
}
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
let vc = WA_DetailsVC()
|
||||
vc.type = self.type
|
||||
if StartManager.shared.superHero == true{
|
||||
if self.type == 1{
|
||||
vc.model = self.wallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}else if type == 2{
|
||||
vc.modeltype = self.newestWallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}else if type == 3{
|
||||
vc.modeltype = self.popularWallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}else if type == 4{
|
||||
vc.modeltype = self.SuperheroesWallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}else if type == 5{
|
||||
vc.modeltype = self.ChristmasWallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}else{
|
||||
vc.modeltype = self.FlowersWallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
}else{
|
||||
if self.type == 1{
|
||||
vc.model = self.wallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}else if type == 2{
|
||||
vc.modeltype = self.newestWallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}else if type == 3{
|
||||
vc.modeltype = self.popularWallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}else if type == 4{
|
||||
vc.modeltype = self.ChristmasWallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}else{
|
||||
vc.modeltype = self.FlowersWallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WA_player4kVC" customModule="wallpaper_project" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="collectionView" destination="N65-R7-GMt" id="NRN-FE-QJK"/>
|
||||
<outlet property="nameLabel" destination="dgk-r1-J69" id="7WZ-Rn-AVz"/>
|
||||
<outlet property="view" destination="rzF-3r-OTD" id="O3s-ce-SGA"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="rzF-3r-OTD">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="N65-R7-GMt">
|
||||
<rect key="frame" x="0.0" y="119" width="393" height="699"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="ZtU-IF-r6v">
|
||||
<size key="itemSize" width="128" height="128"/>
|
||||
<size key="headerReferenceSize" width="0.0" height="0.0"/>
|
||||
<size key="footerReferenceSize" width="0.0" height="0.0"/>
|
||||
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
</collectionViewFlowLayout>
|
||||
</collectionView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Live" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dgk-r1-J69">
|
||||
<rect key="frame" x="176" y="65.666666666666671" width="41" height="26.666666666666671"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="22"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6Yc-FF-sMc">
|
||||
<rect key="frame" x="20" y="59" width="40" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="40" id="8AT-V4-4rI"/>
|
||||
<constraint firstAttribute="height" constant="40" id="DHb-pU-Yjs"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" image="back_black"/>
|
||||
</button>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="MbL-3O-g4d"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="6Yc-FF-sMc" firstAttribute="centerY" secondItem="dgk-r1-J69" secondAttribute="centerY" id="CXt-hq-VDw"/>
|
||||
<constraint firstItem="6Yc-FF-sMc" firstAttribute="top" secondItem="MbL-3O-g4d" secondAttribute="top" id="VdK-DC-orA"/>
|
||||
<constraint firstItem="N65-R7-GMt" firstAttribute="leading" secondItem="MbL-3O-g4d" secondAttribute="leading" id="Xd2-7k-39Y"/>
|
||||
<constraint firstItem="dgk-r1-J69" firstAttribute="centerX" secondItem="rzF-3r-OTD" secondAttribute="centerX" id="fJz-eP-dFW"/>
|
||||
<constraint firstItem="MbL-3O-g4d" firstAttribute="bottom" secondItem="N65-R7-GMt" secondAttribute="bottom" id="ygx-29-T8R"/>
|
||||
<constraint firstItem="MbL-3O-g4d" firstAttribute="trailing" secondItem="N65-R7-GMt" secondAttribute="trailing" id="yrI-ch-Z9z"/>
|
||||
<constraint firstItem="6Yc-FF-sMc" firstAttribute="leading" secondItem="MbL-3O-g4d" secondAttribute="leading" constant="20" id="zlt-ly-ZIF"/>
|
||||
<constraint firstItem="N65-R7-GMt" firstAttribute="top" secondItem="MbL-3O-g4d" secondAttribute="top" constant="60" id="zpf-Ny-gHy"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="47" y="-11"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="back_black" width="20" height="20"/>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
@ -1,308 +0,0 @@
|
||||
//
|
||||
// WA_playerRankVC.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/7/19.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MJExtension
|
||||
import MTGSDKNewInterstitial
|
||||
import MTGSDKBidding
|
||||
import MTGSDK
|
||||
import Alamofire
|
||||
|
||||
|
||||
class WA_playerRankVC: WA_RootVC {
|
||||
@IBOutlet weak var collectionView: UICollectionView!
|
||||
var wallpapers = [WA_3DModel]()
|
||||
|
||||
var bidToken:String?
|
||||
var newInterstitialAdManager:MTGNewInterstitialBidAdManager?
|
||||
|
||||
var adCheckTimer: Timer?
|
||||
var adCheckStartTime: Date?
|
||||
var adLoadTime: Int = 0
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
let param = MTGBiddingRequestParameter(placementId: "1650177", unitId: "3519003", basePrice: nil)
|
||||
|
||||
MTGBiddingRequest.getBidWith(param) { bidResponse in
|
||||
if bidResponse.success{
|
||||
self.bidToken = bidResponse.bidToken
|
||||
bidResponse.notifyWin()
|
||||
self.newInterstitialAdManager = MTGNewInterstitialBidAdManager(placementId: "1650177", unitId: "3519003", delegate: self)
|
||||
StartManager.shared.ecpm = Float(bidResponse.price)
|
||||
self.newInterstitialAdManager?.loadAd(withBidToken:self.bidToken!)
|
||||
|
||||
self.startAdCheck()
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
let layout = CustomLayout()
|
||||
collectionView.collectionViewLayout = layout
|
||||
collectionView.backgroundColor = .white
|
||||
collectionView.dataSource = self
|
||||
collectionView.delegate = self
|
||||
collectionView.register(UINib(nibName: "WA_RankCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "WA_RankCollectionViewCell")
|
||||
setJsondata()
|
||||
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
self.navigationController?.navigationBar.isHidden = true
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// /定时加载
|
||||
func startAdCheck() {
|
||||
|
||||
adCheckStartTime = Date()
|
||||
adCheckTimer = Timer.scheduledTimer(timeInterval: 0.01, target: self, selector: #selector(checkAdStatus), userInfo: nil, repeats: true)
|
||||
}
|
||||
|
||||
@objc func checkAdStatus() {
|
||||
let elapsedTime = Date().timeIntervalSince(adCheckStartTime!)
|
||||
let elapsedTimeInMilliseconds = Int(elapsedTime * 1000)
|
||||
|
||||
let issureready = newInterstitialAdManager!.isAdReady()
|
||||
|
||||
if issureready {
|
||||
|
||||
self.newInterstitialAdManager?.show(from: self)
|
||||
self.setPostSHOW()
|
||||
|
||||
|
||||
} else if elapsedTimeInMilliseconds >= 10000 { // 10000 毫秒 = 10 秒
|
||||
adCheckTimer?.invalidate()
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
} else {
|
||||
print("广告未准备好,继续检查...")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
func setJsondata(){
|
||||
// 读取 JSON 文件并解析
|
||||
if let path = Bundle.main.path(forResource: "rank", ofType: "json") {
|
||||
do {
|
||||
let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .mappedIfSafe)
|
||||
|
||||
// 使用 MJExtension 解析 JSON 数据
|
||||
let jsonArray = try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [[String: Any]]
|
||||
|
||||
if let jsonArray = jsonArray {
|
||||
// 使用 MJExtension 将 JSON 数组转换为模型数组
|
||||
|
||||
let wallpapersarr = (WA_3DModel.mj_objectArray(withKeyValuesArray: jsonArray) as? [WA_3DModel])!
|
||||
self.wallpapers = wallpapersarr
|
||||
|
||||
}
|
||||
} catch {
|
||||
print("Error reading JSON file:", error.localizedDescription)
|
||||
}
|
||||
} else {
|
||||
print("JSON file not found.")
|
||||
}
|
||||
|
||||
}
|
||||
func setPostload(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_load_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回加载",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
"showStatus": 0,
|
||||
"washParam": true,
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
func setPostSHOW(){
|
||||
let url = "http://111.9.47.226:38080/top_selection/save_ad_show_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":"壁纸详情页返回展示",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime": "",
|
||||
"adPlatform": StartManager.shared.adPlatform ?? "",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
extension WA_playerRankVC:MTGNewInterstitialBidAdDelegate{
|
||||
|
||||
// func newInterstitialBidAdShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
// print("广告展示成功")
|
||||
// }
|
||||
|
||||
func newInterstitialBidAdResourceLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("资源加载成功,表示可播放状态")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdLoadSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告加载成功")
|
||||
StartManager.shared.succeed = true
|
||||
// StartManager.shared.loadTime = self.adLoadTime
|
||||
StartManager.shared.adPlatform = "mbridge"
|
||||
// StartManager.shared.countryCode = ALSdk.shared().configuration.countryCode
|
||||
StartManager.shared.adId = "3519003"
|
||||
StartManager.shared.platformResponseTime = 0
|
||||
// StartManager.shared.ecpm = Float(ad.revenue)
|
||||
StartManager.shared.dsp = ""
|
||||
StartManager.shared.network = ""
|
||||
|
||||
|
||||
setPostload()
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdLoadFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("-----\(error)")
|
||||
// print(" 广告加载失败")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
func newInterstitialBidAdShowSuccess(withBidToken bidToken: String, adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告展示成功")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdShowFail(_ error: any Error, adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告展示失败")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
|
||||
func newInterstitialBidAdPlayCompleted(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告播放完全播放回调")
|
||||
}
|
||||
|
||||
|
||||
func newInterstitialBidAdEndCardShowSuccess(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("视频播放完成后展示结果页")
|
||||
}
|
||||
|
||||
func newInterstitialBidAdClicked(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
|
||||
print("广告被点击")
|
||||
}
|
||||
|
||||
// 广告被关闭
|
||||
func newInterstitialBidAdDidClosed(_ adManager: MTGNewInterstitialBidAdManager) {
|
||||
print("广告被关闭")
|
||||
self.navigationController?.popViewController(animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
extension WA_playerRankVC:UICollectionViewDataSource, UICollectionViewDelegate{
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
|
||||
return wallpapers.count // 你可以设置你的图片数量
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "WA_RankCollectionViewCell", for: indexPath) as! WA_RankCollectionViewCell
|
||||
|
||||
cell.model = self.wallpapers[indexPath.row]
|
||||
return cell
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
|
||||
let vc = WA_LiveVideoVC()
|
||||
vc.model = self.wallpapers[indexPath.row]
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
|
||||
}
|
||||
|
||||
func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer<CGPoint>) {
|
||||
guard let collectionView = collectionView else { return }
|
||||
|
||||
let itemHeight = collectionView.bounds.height * 2.5 / 3
|
||||
let currentOffset = scrollView.contentOffset.y
|
||||
let targetOffset = targetContentOffset.pointee.y
|
||||
|
||||
let currentItemIndex = round(currentOffset / itemHeight)
|
||||
let targetItemIndex = targetOffset > currentOffset ? currentItemIndex + 1 : currentItemIndex - 1
|
||||
|
||||
let newOffsetY = targetItemIndex * itemHeight
|
||||
targetContentOffset.pointee.y = newOffsetY
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WA_playerRankVC" customModule="wallpaper_project" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="collectionView" destination="As2-4W-aPD" id="nj5-SN-Wzs"/>
|
||||
<outlet property="view" destination="1G9-dP-o0x" id="7uv-oU-Ybd"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="1G9-dP-o0x">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rank" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MBO-nn-Txo">
|
||||
<rect key="frame" x="20" y="79" width="80.666666666666671" height="39.666666666666657"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="heavy" pointSize="33"/>
|
||||
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="As2-4W-aPD">
|
||||
<rect key="frame" x="0.0" y="133.66666666666669" width="393" height="684.33333333333326"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="3vV-dq-oqb">
|
||||
<size key="itemSize" width="128" height="128"/>
|
||||
<size key="headerReferenceSize" width="0.0" height="0.0"/>
|
||||
<size key="footerReferenceSize" width="0.0" height="0.0"/>
|
||||
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
</collectionViewFlowLayout>
|
||||
</collectionView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="Sgx-tr-akm"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="MBO-nn-Txo" firstAttribute="leading" secondItem="Sgx-tr-akm" secondAttribute="leading" constant="20" id="BDF-Ib-8TL"/>
|
||||
<constraint firstItem="Sgx-tr-akm" firstAttribute="trailing" secondItem="As2-4W-aPD" secondAttribute="trailing" id="M26-bT-d5B"/>
|
||||
<constraint firstItem="As2-4W-aPD" firstAttribute="leading" secondItem="Sgx-tr-akm" secondAttribute="leading" id="MSX-WI-sAE"/>
|
||||
<constraint firstItem="MBO-nn-Txo" firstAttribute="top" secondItem="Sgx-tr-akm" secondAttribute="top" constant="20" id="QQj-FA-8Ss"/>
|
||||
<constraint firstItem="As2-4W-aPD" firstAttribute="top" secondItem="MBO-nn-Txo" secondAttribute="bottom" constant="15" id="Zjf-wP-QKR"/>
|
||||
<constraint firstItem="Sgx-tr-akm" firstAttribute="bottom" secondItem="As2-4W-aPD" secondAttribute="bottom" id="vQJ-A8-22J"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="108" y="-12"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
@ -1,67 +0,0 @@
|
||||
//
|
||||
// WA_playerVC.swift
|
||||
// wallpaper_project
|
||||
|
||||
|
||||
import UIKit
|
||||
|
||||
class WA_playerVC: WA_RootVC {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
|
||||
}
|
||||
|
||||
//3519003
|
||||
@IBAction func one(_ sender: Any) {
|
||||
|
||||
let vc = WA_playerRankVC()
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
//3519003
|
||||
@IBAction func two(_ sender: Any) {
|
||||
|
||||
let vc = WA_playerRankVC()
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
//3519003
|
||||
@IBAction func three(_ sender: Any) {
|
||||
|
||||
let vc = WA_playerRankVC()
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
|
||||
// 3501963
|
||||
@IBAction func four(_ sender: Any) {
|
||||
|
||||
let vc = WA_player4kVC()
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
|
||||
// 3501963
|
||||
@IBAction func five(_ sender: Any) {
|
||||
|
||||
let vc = WA_player4kVC()
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
// 3158993
|
||||
@IBAction func six(_ sender: Any) {
|
||||
let vc = WA_CommunityPlayerVC()
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
|
||||
//3519003
|
||||
@IBAction func ID35(_ sender: Any) {
|
||||
let vc = WA_player4kVC()
|
||||
navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@IBAction func back(_ sender: Any) {
|
||||
WA_TabbarCommon.TabBarController()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,197 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="WA_playerVC" customModule="wallpaper_project" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VkR-sE-9sa">
|
||||
<rect key="frame" x="0.0" y="228" width="414" height="40"/>
|
||||
<color key="backgroundColor" systemColor="systemBrownColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="Ara-bB-nS8"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="22"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="ID:3501963">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="four:" destination="-1" eventType="touchUpInside" id="giV-HD-cJo"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ndr-X1-Nep">
|
||||
<rect key="frame" x="0.0" y="138" width="414" height="40"/>
|
||||
<color key="backgroundColor" systemColor="systemPurpleColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="4Bf-ei-9mn"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="22"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="ID:3519003">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="three:" destination="-1" eventType="touchUpInside" id="hoW-FZ-Z5A"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="iPL-jk-PZJ">
|
||||
<rect key="frame" x="0.0" y="93" width="414" height="40"/>
|
||||
<color key="backgroundColor" systemColor="systemGreenColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="PMq-MZ-llS"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="22"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="ID:3519003">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="two:" destination="-1" eventType="touchUpInside" id="jkK-A6-XJx"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Bei-WL-J7H">
|
||||
<rect key="frame" x="0.0" y="48" width="414" height="40"/>
|
||||
<color key="backgroundColor" systemColor="systemRedColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="hBo-Rl-aMe"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="22"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="ID:3519003">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="one:" destination="-1" eventType="touchUpInside" id="caT-me-p7n"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TjA-3a-vmx">
|
||||
<rect key="frame" x="0.0" y="273" width="414" height="40"/>
|
||||
<color key="backgroundColor" systemColor="tableCellBlueTextColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="Q9c-XW-5i1"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="22"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="ID:3501963">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="five:" destination="-1" eventType="touchUpInside" id="8tM-TW-ZD0"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="K9a-r1-8BN">
|
||||
<rect key="frame" x="0.0" y="318" width="414" height="40"/>
|
||||
<color key="backgroundColor" systemColor="systemGray2Color"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="mcm-5A-dmE"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="22"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="ID:3158993">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="six:" destination="-1" eventType="touchUpInside" id="HfE-qa-XHc"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cHG-tj-5ow">
|
||||
<rect key="frame" x="314" y="812" width="100" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="100" id="Btu-IH-6xM"/>
|
||||
<constraint firstAttribute="height" constant="50" id="QQf-YO-APv"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="返回"/>
|
||||
<connections>
|
||||
<action selector="back:" destination="-1" eventType="touchUpInside" id="sBL-Uc-ade"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Vh6-3h-QE2">
|
||||
<rect key="frame" x="0.0" y="183" width="414" height="40"/>
|
||||
<color key="backgroundColor" systemColor="systemOrangeColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="ned-20-CrZ"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="22"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="ID:3519003">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="ID35:" destination="-1" eventType="touchUpInside" id="UDg-jr-nFe"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Vh6-3h-QE2" firstAttribute="top" secondItem="Ndr-X1-Nep" secondAttribute="bottom" constant="5" id="0Ho-fc-ch4"/>
|
||||
<constraint firstAttribute="trailing" secondItem="K9a-r1-8BN" secondAttribute="trailing" id="6Bx-jw-kaw"/>
|
||||
<constraint firstItem="TjA-3a-vmx" firstAttribute="top" secondItem="VkR-sE-9sa" secondAttribute="bottom" constant="5" id="7IN-Ku-sdS"/>
|
||||
<constraint firstItem="Ndr-X1-Nep" firstAttribute="top" secondItem="iPL-jk-PZJ" secondAttribute="bottom" constant="5" id="96k-4z-mKX"/>
|
||||
<constraint firstItem="K9a-r1-8BN" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="9QR-k6-AmQ"/>
|
||||
<constraint firstAttribute="trailing" secondItem="TjA-3a-vmx" secondAttribute="trailing" id="9or-Ch-wjI"/>
|
||||
<constraint firstItem="VkR-sE-9sa" firstAttribute="top" secondItem="Vh6-3h-QE2" secondAttribute="bottom" constant="5" id="AYQ-rk-3XF"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Bei-WL-J7H" secondAttribute="trailing" id="DXf-Qx-3Jg"/>
|
||||
<constraint firstAttribute="trailing" secondItem="iPL-jk-PZJ" secondAttribute="trailing" id="F59-s0-O8O"/>
|
||||
<constraint firstItem="iPL-jk-PZJ" firstAttribute="top" secondItem="Bei-WL-J7H" secondAttribute="bottom" constant="5" id="FzF-1g-hBE"/>
|
||||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="VkR-sE-9sa" secondAttribute="trailing" id="G48-Ql-cwG"/>
|
||||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Vh6-3h-QE2" secondAttribute="trailing" id="K5p-lS-vPR"/>
|
||||
<constraint firstItem="Bei-WL-J7H" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="NhC-9j-SZC"/>
|
||||
<constraint firstItem="TjA-3a-vmx" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="QUV-Ls-F2m"/>
|
||||
<constraint firstItem="Ndr-X1-Nep" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="WFX-ue-h9N"/>
|
||||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="cHG-tj-5ow" secondAttribute="bottom" id="ZIr-rV-0l5"/>
|
||||
<constraint firstItem="K9a-r1-8BN" firstAttribute="top" secondItem="TjA-3a-vmx" secondAttribute="bottom" constant="5" id="j5l-Bi-I0Q"/>
|
||||
<constraint firstItem="Vh6-3h-QE2" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="k1W-1d-1rF"/>
|
||||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Ndr-X1-Nep" secondAttribute="trailing" id="l7L-kt-BmJ"/>
|
||||
<constraint firstItem="Bei-WL-J7H" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="or9-qE-cH2"/>
|
||||
<constraint firstItem="VkR-sE-9sa" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="pcn-o5-hBR"/>
|
||||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="cHG-tj-5ow" secondAttribute="trailing" id="ptr-LK-rxd"/>
|
||||
<constraint firstItem="iPL-jk-PZJ" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="s1G-9q-YZa"/>
|
||||
<constraint firstItem="Ndr-X1-Nep" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="txO-KL-qwv"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="8.6956521739130448" y="-12.053571428571429"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemBrownColor">
|
||||
<color red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemGray2Color">
|
||||
<color red="0.68235294120000001" green="0.68235294120000001" blue="0.69803921570000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemGreenColor">
|
||||
<color red="0.20392156859999999" green="0.78039215689999997" blue="0.34901960780000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemOrangeColor">
|
||||
<color red="1" green="0.58431372550000005" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemPurpleColor">
|
||||
<color red="0.68627450980000004" green="0.32156862749999998" blue="0.87058823529999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemRedColor">
|
||||
<color red="1" green="0.23137254900000001" blue="0.18823529410000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
<systemColor name="tableCellBlueTextColor">
|
||||
<color red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
@ -75,3 +75,21 @@ func requestIDFA(completion: @escaping (String?) -> Void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func network(_ network: Int) -> String {
|
||||
switch network {
|
||||
case 6:
|
||||
return "Mintegral"
|
||||
case 11:
|
||||
return "Ironsource"
|
||||
case 12:
|
||||
return "UnityAds"
|
||||
case 13:
|
||||
return "Vungle"
|
||||
case 50:
|
||||
return "Pangle"
|
||||
default:
|
||||
return "Mintegral"
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,3 +35,80 @@ class NetworkManager {
|
||||
}
|
||||
}
|
||||
|
||||
func setPostSHOW(){
|
||||
let url = "http://192.168.40.8:8080/top_selection/save_ad_show_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":StartManager.shared.shelfNumber,
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime":StartManager.shared.loadTime ?? "",
|
||||
"adPlatform": "TopOn",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
]
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
func setPostload(){
|
||||
let url = "http://192.168.40.8:8080/top_selection/save_ad_load_log"
|
||||
let parameters:[String : Any] = [
|
||||
"deviceId": StartManager.shared.devicID ?? "",
|
||||
"localIp": StartManager.shared.localIP ?? "",
|
||||
"remoteIp": StartManager.shared.publicIP ?? "",
|
||||
"linkId": "",
|
||||
"packageName": "com.wallpapaer.hd.live.app",
|
||||
"gaid": StartManager.shared.idfaid ?? "",
|
||||
"dataId": "",
|
||||
"shelfNumber":StartManager.shared.shelfNumber ?? "",
|
||||
"succeed": StartManager.shared.succeed,
|
||||
"loadTime":StartManager.shared.loadTime ?? "",
|
||||
"adPlatform": "TopOn",
|
||||
"countryCode": StartManager.shared.countryCode ?? "",
|
||||
"adId": StartManager.shared.adId ?? "",
|
||||
"platformResponseTime": StartManager.shared.platformResponseTime ?? "",
|
||||
"getIpResponseTime": StartManager.shared.getIpResponseTime ?? "",
|
||||
"ecpm": StartManager.shared.ecpm ?? "",
|
||||
"dsp": StartManager.shared.dsp ?? "",
|
||||
"network": StartManager.shared.network ?? "",
|
||||
"showStatus": 0,
|
||||
"washParam": true,
|
||||
]
|
||||
|
||||
|
||||
let headers: HTTPHeaders = [
|
||||
"Content-Type": "application/json"
|
||||
]
|
||||
|
||||
NetworkManager.shared.postRequest(url: url, parameters: parameters, headers: headers) { result in
|
||||
switch result {
|
||||
case .success(let data):
|
||||
print("Response:--- \(data)")
|
||||
case .failure(let error):
|
||||
print("Error:--- \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
import Foundation
|
||||
let strings = ["789b377f3ac4010e", "880a042774979c3c", "83802ca889ba09e6","8e1bc1f22c8d6c9d"]
|
||||
let strings = ["n66bdc1e78a5d9", "n66bdc1da370ec", "n66bdc1be5c449","n66bdc1aea4d27","n66bdc18696105"]
|
||||
|
||||
func getRandomString() -> String? {
|
||||
return strings.randomElement()
|
||||
|
||||
7
wallpaper_project/TopOn/LUXNetWorkManager.swift
Normal file
7
wallpaper_project/TopOn/LUXNetWorkManager.swift
Normal file
@ -0,0 +1,7 @@
|
||||
//
|
||||
// LUXNetWorkManager.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/8/5.
|
||||
//
|
||||
|
||||
126
wallpaper_project/TopOn/LUXTopOnConfigure.swift
Normal file
126
wallpaper_project/TopOn/LUXTopOnConfigure.swift
Normal file
@ -0,0 +1,126 @@
|
||||
//
|
||||
// LUXTopOnConfigure.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/8/5.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AppTrackingTransparency
|
||||
import AdSupport
|
||||
import Firebase
|
||||
import FirebaseRemoteConfig
|
||||
|
||||
class LUXTopOnConfigure {
|
||||
static let shared = LUXTopOnConfigure()
|
||||
var attTimer: Timer?
|
||||
private init() {
|
||||
// 初始化代码
|
||||
}
|
||||
|
||||
@objc func checkATT() {
|
||||
if #available(iOS 14, *) {
|
||||
ATTrackingManager.requestTrackingAuthorization { status in
|
||||
// 获取到权限后,依然使用老方法获取idfa
|
||||
if status == .notDetermined {
|
||||
if self.attTimer == nil {
|
||||
self.attTimer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(self.checkATT), userInfo: nil, repeats: true)
|
||||
|
||||
ATTrackingManager.requestTrackingAuthorization { status in
|
||||
if status != .notDetermined {
|
||||
print("用户已做出选择")
|
||||
self.invalidATTTimer()
|
||||
} else {
|
||||
print("用户未做出选择,可能是弹框未弹出...")
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
self.invalidATTTimer()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@objc func invalidATTTimer() {
|
||||
attTimer?.invalidate()
|
||||
attTimer = nil
|
||||
}
|
||||
|
||||
func configureADByFirebase(with window: UIWindow) {
|
||||
FirebaseApp.configure()
|
||||
|
||||
if LUXToponManager.shared.isADSSMode() {
|
||||
self.configureAD(window: window)
|
||||
} else {
|
||||
// 读取 firebase 数据
|
||||
let rc = RemoteConfig.remoteConfig()
|
||||
let rcs = RemoteConfigSettings()
|
||||
rcs.minimumFetchInterval = 0
|
||||
rc.configSettings = rcs
|
||||
|
||||
rc.fetchAndActivate { status, error in
|
||||
DispatchQueue.main.async {
|
||||
if status == .successFetchedFromRemote {
|
||||
let localVer = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
|
||||
if let value = rc.configValue(forKey: "isopen").jsonValue as? [String: Any],
|
||||
let isadopen = value["isadopen"] as? Bool,
|
||||
let version = value["version"] as? String {
|
||||
if !isadopen || (version == localVer) {
|
||||
self.configureRootVC(window: window)
|
||||
} else {
|
||||
self.configureAD(window: window)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
|
||||
self.configureADByFirebase(with: window)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func configureAD(window:UIWindow){
|
||||
LUXToponManager.shared.configureadWithTopOn()
|
||||
|
||||
|
||||
LUXToponManager.shared.addAD(withInterstitialId: "n66acb8888353f") { vc in
|
||||
// let onevc = OneVc()
|
||||
// onevc.adIndex = 1
|
||||
// vc.navigationController?.pushViewController(onevc, animated: true)
|
||||
}
|
||||
LUXToponManager.shared.addAD(withInterstitialId: "n66acb8894e8df") { vc in
|
||||
let onevc = OneVc()
|
||||
onevc.adIndex = 1
|
||||
vc.navigationController?.pushViewController(onevc, animated: true)
|
||||
}
|
||||
LUXToponManager.shared.addAD(withInterstitialId: "n66acb888b9441") { vc in
|
||||
let onevc = OneVc()
|
||||
onevc.adIndex = 2
|
||||
vc.navigationController?.pushViewController(onevc, animated: true)
|
||||
}
|
||||
LUXToponManager.shared.addAD(withInterstitialId: "n66acb8891f516") { vc in
|
||||
let onevc = OneVc()
|
||||
onevc.adIndex = 3
|
||||
vc.navigationController?.pushViewController(onevc, animated: true)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
func configureRootVC(window: UIWindow?) {
|
||||
let hasLaunchedBeforeKey = "hasLaunchedBefore"
|
||||
|
||||
window?.frame = UIScreen.main.bounds
|
||||
|
||||
let userDefaults = UserDefaults.standard
|
||||
|
||||
let vc = WA_NewHomeVC()
|
||||
window?.rootViewController = WA_RootNAV(rootViewController: vc)
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
26
wallpaper_project/TopOn/LUXTopOnVC.swift
Normal file
26
wallpaper_project/TopOn/LUXTopOnVC.swift
Normal file
@ -0,0 +1,26 @@
|
||||
//
|
||||
// LUXTopOnVC.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/8/5.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class LUXTopOnVC: UIViewController {
|
||||
|
||||
var adIndex:Int = 0
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
81
wallpaper_project/TopOn/LUXToponManager.swift
Normal file
81
wallpaper_project/TopOn/LUXToponManager.swift
Normal file
@ -0,0 +1,81 @@
|
||||
//
|
||||
// LUXToponManager.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/8/5.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import AnyThinkInterstitial
|
||||
|
||||
|
||||
typealias LuxADManagerActionBlock = (UIViewController) -> Void
|
||||
|
||||
var adItemsArr = ["n66acb8888353f","n66acb8894e8df","n66acb888b9441","n66acb8891f516"]
|
||||
|
||||
class LUXToponManager:NSObject,ATInterstitialDelegate {
|
||||
static let shared = LUXToponManager()
|
||||
|
||||
private override init() {}
|
||||
|
||||
|
||||
func isADSSMode() -> Bool{
|
||||
|
||||
return UserDefaults.standard.bool(forKey: "kLuxSSFaceKey")
|
||||
|
||||
}
|
||||
|
||||
func addAD(withInterstitialId id: String, actionBlock block: @escaping LuxADManagerActionBlock) {
|
||||
|
||||
}
|
||||
|
||||
func configureadWithTopOn(){
|
||||
initializationTopOn.toponeSDK()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
func initOtherInitIntersitialAD() {
|
||||
for i in 1..<adItemsArr.count {
|
||||
let item = adItemsArr[i]
|
||||
let extra: [String: Any] = [
|
||||
kATAdLoadingExtraMediaExtraKey: "custom_values"
|
||||
]
|
||||
ATAdManager.shared().loadAD(withPlacementID: item, extra: extra, delegate: self)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 插页广告展示成功
|
||||
@objc func interstitialDidShow(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
|
||||
print("----成功")
|
||||
}
|
||||
/// 插页广告被点击
|
||||
@objc func interstitialDidClick(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----点击")
|
||||
}
|
||||
// 插页广告已关闭
|
||||
@objc func interstitialDidClose(forPlacementID placementID: String, extra: [AnyHashable : Any]) {
|
||||
print("----关闭")
|
||||
// WA_TabbarCommon.TabBarController()
|
||||
|
||||
|
||||
}
|
||||
|
||||
@objc func didFinishLoadingAD(withPlacementID placementID: String!) {
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(placementID)")
|
||||
}
|
||||
|
||||
// load失败
|
||||
@objc func didFailToLoadAD(withPlacementID placementID: String!, error: (any Error)!) {
|
||||
print("----load失败")
|
||||
print("ATInterstitialViewController::didFailToLoadADWithPlacementID:\(String(describing: placementID))---error\(String(describing: error))")
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
18
wallpaper_project/TopOn/initializationTopOn.h
Normal file
18
wallpaper_project/TopOn/initializationTopOn.h
Normal file
@ -0,0 +1,18 @@
|
||||
//
|
||||
// test.h
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/8/2.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface initializationTopOn : NSObject
|
||||
|
||||
+(void)toponeSDK;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
29
wallpaper_project/TopOn/initializationTopOn.m
Normal file
29
wallpaper_project/TopOn/initializationTopOn.m
Normal file
@ -0,0 +1,29 @@
|
||||
//
|
||||
// test.m
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/8/2.
|
||||
//
|
||||
|
||||
#import "initializationTopOn.h"
|
||||
#import <AnyThinkSDK/AnyThinkSDK.h>
|
||||
|
||||
@interface initializationTopOn ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation initializationTopOn
|
||||
|
||||
|
||||
|
||||
+(void)toponeSDK{
|
||||
[ATAPI setLogEnabled:YES];//Turn on debug logs
|
||||
NSError *err;
|
||||
[[ATAPI sharedInstance] startWithAppID:@"h66bdc159dc481" appKey:@"430fd5c3c27f10631919c1b7f9b24c08" error:&err];
|
||||
if (err) {
|
||||
NSLog(@"err:%@",err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
43
wallpaper_project/TopOn/vc/LUXTopbtnVC.swift
Normal file
43
wallpaper_project/TopOn/vc/LUXTopbtnVC.swift
Normal file
@ -0,0 +1,43 @@
|
||||
//
|
||||
// LUXTopbtnVC.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/8/5.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class LUXTopbtnVC: UIViewController {
|
||||
@IBOutlet weak var One: UIButton!
|
||||
|
||||
@IBOutlet weak var two: UIButton!
|
||||
|
||||
@IBOutlet weak var three: UIButton!
|
||||
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
|
||||
}
|
||||
|
||||
@IBAction func touchOne(_ sender: UIButton) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@IBAction func touchTwo(_ sender: UIButton) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@IBAction func touchThree(_ sender: UIButton) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
92
wallpaper_project/TopOn/vc/LUXTopbtnVC.xib
Normal file
92
wallpaper_project/TopOn/vc/LUXTopbtnVC.xib
Normal file
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LUXTopbtnVC" customModule="wallpaper_project" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="One" destination="Ycg-DX-seR" id="eSO-Ca-QIP"/>
|
||||
<outlet property="three" destination="GLr-11-2uP" id="z6i-vh-noz"/>
|
||||
<outlet property="two" destination="bN6-GS-pfm" id="ab8-uc-Cni"/>
|
||||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
|
||||
</connections>
|
||||
</placeholder>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ycg-DX-seR">
|
||||
<rect key="frame" x="0.0" y="48" width="414" height="50"/>
|
||||
<color key="backgroundColor" systemColor="tintColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="5nv-Rx-WMu"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="touchOne:" destination="-1" eventType="touchUpInside" id="n7M-WQ-DVr"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bN6-GS-pfm">
|
||||
<rect key="frame" x="0.0" y="108" width="414" height="50"/>
|
||||
<color key="backgroundColor" systemColor="tintColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="dl6-GA-DLu"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="touchTwo:" destination="-1" eventType="touchUpInside" id="VV7-MZ-FHu"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GLr-11-2uP">
|
||||
<rect key="frame" x="0.0" y="168" width="414" height="50"/>
|
||||
<color key="backgroundColor" systemColor="tintColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="4aq-PL-ilR"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="touchThree:" destination="-1" eventType="touchUpInside" id="S47-nj-7ca"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="GLr-11-2uP" secondAttribute="trailing" id="01t-m4-p8b"/>
|
||||
<constraint firstItem="bN6-GS-pfm" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="05V-AR-fhq"/>
|
||||
<constraint firstItem="GLr-11-2uP" firstAttribute="top" secondItem="bN6-GS-pfm" secondAttribute="bottom" constant="10" id="8eI-YO-VYB"/>
|
||||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="Ycg-DX-seR" secondAttribute="trailing" id="Ehm-yM-5AR"/>
|
||||
<constraint firstItem="bN6-GS-pfm" firstAttribute="top" secondItem="Ycg-DX-seR" secondAttribute="bottom" constant="10" id="TAH-dF-3ka"/>
|
||||
<constraint firstItem="Ycg-DX-seR" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="e80-TN-rSp"/>
|
||||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="bN6-GS-pfm" secondAttribute="trailing" id="h1O-5Q-Qfg"/>
|
||||
<constraint firstItem="Ycg-DX-seR" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="pmF-R2-nNT"/>
|
||||
<constraint firstItem="GLr-11-2uP" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="wD9-PU-DXE"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="131" y="-11"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
<systemColor name="tintColor">
|
||||
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
19
wallpaper_project/TopOn/vc/OneVc.swift
Normal file
19
wallpaper_project/TopOn/vc/OneVc.swift
Normal file
@ -0,0 +1,19 @@
|
||||
//
|
||||
// OneVc.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/8/5.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class OneVc: LUXTopOnVC {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
18
wallpaper_project/TopOn/vc/threeVC.swift
Normal file
18
wallpaper_project/TopOn/vc/threeVC.swift
Normal file
@ -0,0 +1,18 @@
|
||||
//
|
||||
// threeVC.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/8/5.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class threeVC: LUXTopOnVC {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
29
wallpaper_project/TopOn/vc/twovc.swift
Normal file
29
wallpaper_project/TopOn/vc/twovc.swift
Normal file
@ -0,0 +1,29 @@
|
||||
//
|
||||
// twovc.swift
|
||||
// wallpaper_project
|
||||
//
|
||||
// Created by 忆海16 on 2024/8/5.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class twovc: LUXTopOnVC {
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// MARK: - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
// Get the new view controller using segue.destination.
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user