我正在使用AdMob向欧盟的用户投放广告。文档指出,我可以通过以下代码行传递用户同意状态:
try
{
# Copy all of the files from the source location to the deployment directory
Write-Host "DeployService: Deploying new files for ""$serviceWebSiteName""..."
Copy-Item $sourceDirectory"\*.dll" $deploymentDirectory
Copy-Item $sourceDirectory"\*.exe" $deploymentDirectory
Copy-Item $sourceDirectory"\*.pdb" $deploymentDirectory
Copy-Item $sourceDirectory"\*.xap" $deploymentDirectory2
Write-Host "DeployService: Deploying new files for ""$serviceWebSiteName""...complete"
}
catch
{
Write-Host $_.Exception.ToString() -foregroundcolor red
}
问题是此行无法编译。 AdRequst对象上没有AddAddtra这样的功能。我确实使用了最新的AdMob库。
AdRequest request = new AdRequest.Builder() .AddExtra("npa", "1") .Build();
因此,我实际上该如何将此“ npa”值传递给AdMob。
有人吗?
答案 0 :(得分:1)
您可以使用类似于下面的<g transform="translate(168.88, 85.00) scale(0.36)">
方法添加npa
addNetworkExtrasBundle
还请查看以下官方链接
https://developers.google.com/admob/android/eu-consent#forward_consent_to_the_google_mobile_ads_sdk