Recently I implemented consent dialog for users based on https://developers.google.com/admob/ump/android/quick-start
Today I received the next issue in my Admob account:
IAB TCF v2.0 errors detected. We've detected an issue on your IAB TC
string on one or more of your sites or apps. These errors may affect
your ability to serve ads to European users. A detailed report is
available for you on the EU user consent page.
I pressed "GO TO EU USER CONSENT" button and this was shown:
Downloaded csv file, here's content:
iab_tcf_errors_12_3_2020.csv
Mobile App,Ad unit,Error,Error count,Last detected date
com.*.*,7579454036,1.2,140,12/2/2020
com.*.*,3141515571,1.2,140,12/1/2020
Error code 1.2 from https://support.google.com/adsense/answer/9999955:
Consent code in my app (userConsentSDKSetup is called in onCreate of launch activity):
fun userConsentSDKSetup() {
val params = ConsentRequestParameters.Builder().build()
val information = UserMessagingPlatform.getConsentInformation(activity)
information.requestConsentInfoUpdate(
activity,
params,
{
// The consent information state was updated.
// You are now ready to check if a form is available.
if (information.isConsentFormAvailable && information.consentStatus == ConsentInformation.ConsentStatus.REQUIRED) {
activity.lifecycleScope.launchWhenStarted {
loadUserConsentForm(information)
}
}
},
{ Timber.e("userConsentSDK error ${it.message}") }
)
}
private fun loadUserConsentForm(information: ConsentInformation) {
UserMessagingPlatform.loadConsentForm(
activity,
{ consentForm ->
if (information.consentStatus == ConsentInformation.ConsentStatus.REQUIRED) {
activity.lifecycleScope.launchWhenStarted {
consentForm.show(activity) { // Handle dismissal by reloading form.
loadUserConsentForm(information)
}
}
}
}
) { Timber.e("userConsentSDK error loadForm ${it.message}") }
}
So what is wrong here? How can I solve this issue?
Related
I'm currently using a combination of FingerprintDialog with BiometricPrompt. I've run into an issue where I will repeatedly input the incorrect fingerprint to force failed fingerprint attempts, I receive my expected prompt saying that user exceeded fingerprint attempts, etc...
After I close the dialog, I proceed to login using password but for some reason the Login button is unresponsive and cannot login. The only solution has been restarting the app.
I assumed it was all due to the Biometric lockout which is 30 seconds, so I've tried waiting 30 seconds and still doesn't work. I've waited up to 10 minutes and never works. The only time it worked was when I let the device sleep and turn on after some time.
private fun setFpView() {
val context = context ?: return
if (mTouchFailCount >= MAX_NUM_TOUCH_FAILS) {
dismissFpDialog()
setPasswordLoginInUserSettings()
mUsernameInput.postDelayed(
{
if (!isAdded || isStateSaved) {
return#postDelayed
}
showDialog(
"too many failed attempts"
)
},
ERROR_DIALOG_DELAY_MILLIS.toLong()
) dismissFpDialog()
} else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
if (fpDialog == null) {
closeDialogIfShowing()
showFpDialog()
} else {
fpDialog?.apply {
setDialogListener(this#BiometricFragment)
setFpListener(this#BiometricFragment)
}
}
}
}
Sorry I've been stuck on this for a while and I tried searching all over but couldn't find anything that helped resolve this issue.
For showing interestitial ad in my android app (which i have made using ionic) i have used the following code :
<script type="text/javascript">
function runads(){
document.addEventListener("deviceready", onDeviceReady, false);
}
function initAds() {
if (admob) {
var adPublisherIds = {
ios : {
banner : "###############",
interstitial : "##################"
},
android : {
banner : "#############",
interstitial : "#########################"
}
};
var admobid = (/(android)/i.test(navigator.userAgent)) ? adPublisherIds.android : adPublisherIds.ios;
admob.setOptions({
publisherId: admobid.banner,
interstitialAdId: admobid.interstitial,
tappxIdiOs: "/XXXXXXXXX/Pub-XXXX-iOS-IIII",
tappxIdAndroid: "/XXXXXXXXX/Pub-XXXX-Android-AAAA",
tappxShare: 0.5
});
registerAdEvents();
} else {
alert('AdMobAds plugin not ready');
}
}
function onAdLoaded(e) {
if (e.adType === admob.AD_TYPE.INTERSTITIAL) {
admob.showInterstitialAd();
showNextInterstitial = setTimeout(function() {
admob.requestInterstitialAd();
}, 2 * 60 * 1000); // 2 minutes
}
}
// optional, in case respond to events
function registerAdEvents() {
document.addEventListener(admob.events.onAdLoaded, onAdLoaded);
document.addEventListener(admob.events.onAdFailedToLoad, function (e) {});
document.addEventListener(admob.events.onAdOpened, function (e) {});
document.addEventListener(admob.events.onAdClosed, function (e) {});
document.addEventListener(admob.events.onAdLeftApplication, function (e) {});
document.addEventListener(admob.events.onInAppPurchaseRequested, function (e) {});
}
function onDeviceReady() {
document.removeEventListener('deviceready', onDeviceReady, false);
initAds();
// display a banner at startup
admob.createBannerView();
// request an interstitial
admob.requestInterstitialAd();
}
My interestitial ad is showing perfectly using this code.Then, i have uploaded it in google play store.suddenly i have got a message from google Admob team regarding interestitial ad placing . The message is -
Hello,We are alerting you that your app is currently in violation of the AdMob program policies. Importantly, this will require action on your part to ensure no disruption in ad serving. Please read below for more information on the actions you need to take:
Violation explanation
LAYOUT ENCOURAGES ACCIDENTAL CLICKS - INTERSTITIAL ADS:Publishers are not permitted to encourage users to click AdMob interstitial ads in any way. Please review how you’ve implemented interstitial ads and be mindful of the following non-compliant implementation(s):Interstitial ads that load unexpectedly while a user is viewing the app’s content.For more information about our policies and tips for how to comply please read the following:
Interstitial ads that load unexpectedly while a user is viewing the app’s content.For more information about our policies and tips for how to comply please read the following:AdMob ad placement policyAdMob interstitial ad guidanceAdMob preload instructions for Android and iOSAction required: Please make changes immediately to your app to comply with AdMob program policies.Current account status: ActiveYou do not need to contact us once you've made the necessary changes to your app. Please be aware that if additional violations are accrued, ad serving may be disabled to the app listed above.Note that the app listed above is just one example and the same violation may exist on other apps you own. We suggest that you review all your apps for compliance with the AdMob program policies to reduce the likelihood of future warnings.For more information regarding our policy warning notifications, visit our Help Center.Thank you for your cooperation.Sincerely,The Google AdMob Team
How Can i solve this problem ?
Probably what is going on is that the loading of an interstitial ad takes some time, so you need to plan the loading of an interstitial and ensure the interstitial is available when you need to show it. If not, launching admob.showInterstitialAd() will load the interstital and show it when it is available (as the flag autoShowInterstitial is true by default, see https://github.com/appfeel/admob-google-cordova/wiki/setOptions).
There is a complete example on how to plan the interstitials: https://github.com/appfeel/admob-google-cordova/wiki/showInterstitialAd.
Basically what you do is to request an interstitial and let the app know if the interstitial is available or not. Probably your code for ionic should look like this:
angular.module('myApp', ['admobModule'])
.constant('AdmobConfig', {
bannerId: /(android)/i.test(navigator.userAgent) ? "ca-app-pub-XXXXXXXXXXXXXXXX/ANDROID_BANNER_ID" : "ca-app-pub-XXXXXXXXXXXXXXXX/IOS_BANNER_ID",
interstitialId: /(android)/i.test(navigator.userAgent) ? "ca-app-pub-XXXXXXXXXXXXXXXX/ANDROID_INTERSTITIAL_ID" : "ca-app-pub-XXXXXXXXXXXXXXXX/IOS_INTERSTITIAL_ID",
})
.config(function (admobSvcProvider, AdmobConfig) {
admobSvcProvider.setOptions({
publisherId: AdmobConfig.bannerId,
interstitialAdId: AdmobConfig.interstitialId,
autoShowInterstitial: false,
});
})
.run(function ($rootScope, $ionicPlatform, $timeout, admobSvc) {
admobSvc.requestInterstitialAd();
$rootScope.isInterstitialAvailable = false;
$rootScope.isAppForeground = false;
$rootScope.$on(admobSvc.events.onAdLoaded, function onAdLoaded(evt, e) {
if ($rootScope.isAppForeground) {
if (e.adType === admobSvc.AD_TYPE.INTERSTITIAL) {
$rootScope.isInterstitialAvailable = true;
}
}
});
$rootScope.$on(admobSvc.events.onAdOpened, function onAdOpened(evt, e) {
if ($rootScope.isAppForeground) {
if (e.adType === admobSvc.AD_TYPE.INTERSTITIAL) {
$rootScope.isInterstitialAvailable = false;
$timeout(admobSvc.requestInterstitialAd, 1); // Immediately request next interstitial asap
}
}
});
$ionicPlatform.on('pause', function onPause() {
if ($rootScope.isAppForeground) {
$rootScope.isAppForeground = false;
}
});
$ionicPlatform.on('resume', function onResume() {
if (!$rootScope.isAppForeground) {
$timeout(admobSvc.requestInterstitialAd, 1);
$rootScope.isAppForeground = true;
}
});
})
.controller('YourController', function ($rootScope, admobSvc) {
var vm = this;
vm.pleaseShowInterstitial = function () {
if ($rootScope.isInterstitialAvailable) {
admobSvc.showInterstitialAd();
}
};
});
Also note that there is a management for foreground app. This is important as if not, the user could put the app in background and the interstitial would automatically be shown. In your case it is not so relevant, as you control when the interstitial is shown, but I recommend you to keep this, in case you decide to start auto showing interstitials :)
I explored mobileCore a month ago and decided to use today. But I couldnt integrate.
My Code for İntegrate Stickeez Ad Type:
MobileCore.init(MainActivity.this, "4U5PUKTA688XO2HBFI8O2SPYVVJ47",
MobileCore.LOG_TYPE.PRODUCTION,MobileCore.AD_UNITS.INTERSTITIAL, MobileCore.AD_UNITS.STICKEEZ);
MobileCore.showStickee(MainActivity.this, MobileCore.AD_UNIT_TRIGGER.APP_START);
I dont know why showStickee but it isnt wrong. How can I fix it?
It seems that you're trying to show the ad unit before it is ready. We recommend to use the Ad Unit Event Listener to confirm that the ad unit is ready before calling showStickee(), or at least to not call it together with MobileCore.Init().
Also, if you're using the latest version (v2.0), note that we've added a new loadAdUnit() method that requires to manually fetch the ads before displaying.
Here's an example using Android SDK v2.0:
First, In the onCreate() method of your main activity, Init the SDK:
MobileCore.init(MainActivity.this, *YOUR_DEVELOPER_HASH_HERE*,
MobileCore.LOG_TYPE.PRODUCTION,MobileCore.AD_UNITS.INTERSTITIAL, MobileCore.AD_UNITS.STICKEEZ);
Now here's an example code that loads the ad unit after Init has finished and then displays the ad upon receiving AD_UNIT_READY event:
MobileCore.setAdUnitEventListener(new AdUnitEventListener() {
#Override
public void onAdUnitEvent(MobileCore.AD_UNITS adUnit, EVENT_TYPE eventType,
MobileCore.AD_UNIT_TRIGGER... trigger) {
if (adUnit == MobileCore.AD_UNITS.STICKEEZ) {
if (eventType == EVENT_TYPE.AD_UNIT_INIT_SUCCEEDED) {
MobileCore.loadAdUnit(MobileCore.AD_UNITS.STICKEEZ, MobileCore.AD_UNIT_TRIGGER.APP_START);
}
else if (eventType == AdUnitEventListener.EVENT_TYPE.AD_UNIT_READY) {
for (MobileCore.AD_UNIT_TRIGGER myTrigger : trigger) {
if (myTrigger.equals(MobileCore.AD_UNIT_TRIGGER.APP_START)) {
MobileCore.showStickee(MainActivity.this,
MobileCore.AD_UNIT_TRIGGER.APP_START);
}
}
}
}
}
});
Feel free to contact us at support#mobilecore.com with any question.
I'm trying to implement Facebook sharing in my game using Unity 3D + Facebook Unity SDK. But when I tried testing to post to my wall, this error shows up: "We are Sorry, this post is no longer available. It may have been removed." Can anybody help me? Thanks in advance.
BTW, here's my code:
using UnityEngine;
using System.Collections;
public class FacebookController : MonoBehaviour {
public bool isUsingFacebook = true; //Are we using Facebook SDK? This variable is only
//Feed parameters.
private string link = "market://details?id=com.LaserCookie.Queue"; //The link that will show the user the game's google play store address
private string linkName = "Queue"; //The link name
private string linkCaption = "Wow this game is great! 10/10 must play!"; // The caption of the link
private string linkDescription = "I achieved the score of " + PlayerController.instance.score.ToString() + "! Try to beat me if you can!"; //The description of the link
private string picture = "http://www.drycreekequestriancenter.com/testImage.jpeg"; //This is the image / game icon for the link. For now, it's shamelessly got from a random source. Thank you, random citizen...
void Awake()
{
}
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
//Init FB
private void Init()
{
if (!FB.IsInitialized)
{
FB.Init(OnInitComplete, OnHideUnity);
}
}
//Callback that will be called when the initialization is completed
private void OnInitComplete()
{
Debug.Log("FB.Init completed: Is user logged in? " + FB.IsLoggedIn);
//Check if we are logged in.
//If not, we will log in.
//If we are, post status.
if (!FB.IsLoggedIn)
{
LoginWithPublish();
}
else
{
PostImpl();
}
}
//Callback that will be called when the game is shown / not
private void OnHideUnity(bool isGameShown)
{
Debug.Log("Is game showing? " + isGameShown);
}
//Post to Facebook. This is the only exposed method because we only use this to post to Facebook.
//The initialization and login will be called when needed.
//It will first detect whether or not we have been initialized. And will init if we haven't.
//Then it will check whether or not we have been logged in with publish. And will log in if not.
public void PostToFacebook()
{
//Are we using facebook SDK?
if (isUsingFacebook)
{
if (!FB.IsInitialized) //Check for initialization
{
Init();
}
else if (!FB.IsLoggedIn) //Check for login
{
LoginWithPublish();
}
else //Post if we are already initia;ized and logged in
{
PostImpl();
}
}
}
//The true implementation of the posting
private void PostImpl()
{
FB.Feed("",link, linkName,linkCaption,linkDescription,picture);
}
//Login to Facebook with publish
private void LoginWithPublish()
{
// It is generally good behavior to split asking for read and publish
// permissions rather than ask for them all at once.
//
// In your own game, consider postponing this call until the moment
// you actually need it.
FB.Login("publish_actions", LoginCallback);
}
//Login callback
void LoginCallback(FBResult result)
{
if (result.Error != null)
{
Debug.Log( "Error Response:\n" + result.Error );
//TODO: Retry login if we have error? Or do we display a pop up?
}
else if (!FB.IsLoggedIn)
{
Debug.Log( "Login cancelled by Player" );
//TODO: Do we display a pop up?
}
else
{
Debug.Log( "Login was successful!" );
PostImpl();
}
}
}
You need to add Key Hash for FB application.
Go to My Apps, select you application, open Setting tab, add platform for android, and add you key hash.
check this link out
Setting a Release Key Hash
I've fixed the issue. It turns out it's because I used my still in development google store address as the link. I thought it would be automatically recognized regardless of my app is live or not. Thank you anyway. :)
I'm using facebook 3.0.1 titanium module. In Android, the Facebook apprequests dialog always returns as cancelled, even while the actual apprequest is send as can be seen on Facebook. Because of this I cannot store the requestid in my back-end, which makes the apprequest useless.
But in iOS it works fine.
This is my code
var fb = require('facebook');
fb.appid = 'my_app_id';
fb.permissions = ['publish_stream', 'read_stream', 'email']; // Permissions your app needs
fb.forceDialogAuth = true;
fb.addEventListener('login', function(evt) {
if (evt.success) {
fb.dialog("apprequests", {
message:"LeaugeNation",
// max_recipients : "2"
}, function(response) {
alert(JSON.stringify(response));
if(response.result) {
alert("send friend req");
// sendFacebookInvite(e.result);
}
});
} else if (evt.error) {
alert("error");
} else if (evt.cancelled) {
alert("cancelled");
} else {
alert("default");
}
});
fb.authorize();
If i run the code i'm getting the following result
{"cancelled":true,"code":-1,"success":false}
I made the following changes, but did't got the result.
changed the appid won't change result
changed the Key Hash for that Facebook App
Thanks in advance.
Can you please tell me what change, that i want to made to get the correct result in Android.
You must look to facebook setting. did you register Your activity and allow the permission from developers site which you are using here. Also If you are not exporting your app please export properly with proper keystore.