- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Google AdMob 现在显示以下警告。
为 iOS 14 准备您的应用程序 Apple 宣布了新的 AppTrackingTransparency 框架,该框架需要对您的 iOS 应用程序进行更改。实现 GMA SDK 7.64.0(或更高版本)并设置同意消息,以帮助防止广告收入出现重大损失。
某些应用尚未配置为使用 Apple 的 SKAdNetwork 为确保您获得所有广告事件(例如应用安装)的功劳,请务必使用 Google 的网络 ID 配置 SKAdNetwork。
您的某些 iOS 应用程序需要 GMA SDK 更新 要保持广告正常转换并最大限度地减少广告收入损失,请为您的 iOS 应用程序实现 GMA SDK 7.64.0(或更高版本)。并使用 Google 的网络 ID 在您的应用中配置 SKAdNetwork。
为此我做了这些改变
1. GADApplicationIdentifier key with a string value of AdMob app ID.
2. Added SKAdNetworkItems in plist as mentioned here https://developers.google.com/admob/ios/ios14
3. NSUserTrackingUsageDescription key with value 'Game_Name would like to access IDFA for thirdparty advertising purpose'
info.plist 截图
- (void)requestIDFA
{
if (@available(iOS 14.0, *))
{
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
// Admob Ads
[self loadAdmob_Ads];
[self loadRewardedInterstitial];
[self requestAppOpenAd];
}];
}
else
{
// Admob Ads
[self loadAdmob_Ads];
[self loadRewardedInterstitial];
[self requestAppOpenAd];
}
}
我还需要在 Xcode 中做些什么吗?
最佳答案
更新:苹果认可的游戏。这是带有最新 admob 广告的游戏(GADInterstitialAd、GADRewardedInterstitialAd、GADRewardedAd、GADAppOpenAd):
https://apps.apple.com/us/app/ocean-fishing-master-3d-games/id1550945081
在 Info.plist 中添加了 Google Admob SKAdNetworkIdentifier 值
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4fzdc2evr5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2fnua5tdw4.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ydx93a7ass.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>5a6flpkh64.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>p78axxw29g.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>v72qych5uu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>c6k4g5qg8m.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>s39g8k73mm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qy4746246.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3sh42y64q3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>f38h382jlk.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>hs6bdukanm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>prcb7njmu6.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>wzmmz9fp6w.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>yclnxrl5pm.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4468km3ulz.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>t38b2kh725.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>7ug5zh24hu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>9rd848q2bz.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>n6fk4nfna4.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>kbd757ywx3.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>9t245vhmpl.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>2u9pt9hc89.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>8s468mfl3y.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>av6w8kgt66.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>klf5c3l5u5.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ppxm28t8ap.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>424m5254lk.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>uw77j35x4d.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>e5fvkxwrpn.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>zq492l623r.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>3qcr597p9d.skadnetwork</string>
</dict>
</array>
在 didFinishLaunchingWithOptions 中添加了 requestIDFA。它会打开 App Tracking Transparency 对话框。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[GADMobileAds sharedInstance] startWithCompletionHandler:nil];
[self requestIDFA];
.
.
.
}
请求IDFA函数:
- (void)requestIDFA
{
if (@available(iOS 14.0, *))
{
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
// Admob Ads
[self requestAppOpenAd];
[self loadAdmob_Ads];
[self loadRewardedInterstitial];
}];
}
else
{
// Admob Ads
[self requestAppOpenAd];
[self loadAdmob_Ads];
[self loadRewardedInterstitial];
}
}
将 AppTrackingTransparency.framework 添加到 Xcode。
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
Admob 广告相关功能:
- (void)requestAppOpenAd {
self.appOpenAd = nil;
[GADAppOpenAd loadWithAdUnitID:ADMOB_APP_OPEN_ID
request:[GADRequest request]
orientation:UIInterfaceOrientationPortrait
completionHandler:^(GADAppOpenAd *_Nullable appOpenAd, NSError *_Nullable error) {
if (error) {
NSLog(@"Failed to load app open ad: %@", error);
return;
}
self.appOpenAd = appOpenAd;
self.appOpenAd.fullScreenContentDelegate = self;
}];
}
- (void)tryToPresentAd
{
if (self.appOpenAd) {
UIViewController *rootController = self.window.rootViewController;
[self.appOpenAd presentFromRootViewController:rootController];
} else {
// If you don't have an ad ready, request one.
[self requestAppOpenAd];
}
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[self tryToPresentAd];
}
-(void)loadAdmob_Ads
{
GADRequest *request = [GADRequest request];
[GADInterstitialAd loadWithAdUnitID:ADMOB_FULL_SCREEM
request:request
completionHandler:^(GADInterstitialAd *ad, NSError *error)
{
if (error)
{
NSLog(@"\nAdmob Failed to load interstitial ad with error: %@", [error localizedDescription]);
return;
}
self.interstitial = ad;
self.interstitial.fullScreenContentDelegate = self;
}];
}
-(void)showAdmobAdsFullScreen
{
if (self.interstitial) {
[self.interstitial presentFromRootViewController:self.viewController];
}
}
-(void)loadRewardedInterstitial
{
[GADRewardedInterstitialAd
loadWithAdUnitID:ADMOB_REWARDED_INTERSTITIAL
request:[GADRequest request]
completionHandler:^(
GADRewardedInterstitialAd *_Nullable rewardedInterstitialAd,
NSError *_Nullable error) {
if (!error) {
self.rewardedInterstitialAd = rewardedInterstitialAd;
self.rewardedInterstitialAd.fullScreenContentDelegate = self;
}
}];
}
-(void)playRewardedInterstitial
{
[self.rewardedInterstitialAd presentFromRootViewController:self.viewController
userDidEarnRewardHandler:^{
[self rewardInterstitialDoneRewardUser];
[self loadRewardedInterstitial];
}];
}
谷歌官方文档:
关于ios - 适用于 iOS : SKAdNetworkItems, NSUserTrackingUsageDescription、ATTrackingManager 的 Google AdMob 新 SDK 设置。准则 5.1.2 - 法律 - 隐私 - 数据使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66177136/
Google AdMob 现在显示以下警告。 为 iOS 14 准备您的应用程序 Apple 宣布了新的 AppTrackingTransparency 框架,该框架需要对您的 iOS 应用程序进行更
我是一名优秀的程序员,十分优秀!