It is a verry important topic About Admob

0 favourites
  • 1 posts
From the Asset Store
AdMob Plus PRO
$12.99 USD
[ Support C3 Build service ] Native Ad, App Open Ad, Banner Ad, Interstitial Ad, Rewarded Interstitial Ad, Rewarded Ad.
  • I have recive a mail from admob (google) new cookie law for EU!

    But how to add this code in our games?

    Where to paste and how we dont have a "MainActivity" whern we expoet to intel sdk.

    The code is for android:

    // This code works on Android API level 1 (Android 1.0) and up.
    // Tested on the latest (at the moment) API level 19 (Android 4.4 KitKat).
    // In the main activity of your app:
    public class MainActivity extends Activity 

    override[/p] public void onStart() {[/p] super.onStart();[/p] final SharedPreferences settings =[/p] getSharedPreferences("localPreferences", MODE_PRIVATE);[/p] if (settings.getBoolean("isFirstRun", true)) {[/p] new AlertDialog.Builder(this)[/p] .setTitle("Cookies")[/p] .setMessage("Your message for visitors here")[/p] .setNeutralButton("Close message", new OnClickListener() {[/p] override[/p] public void onClick(DialogInterface dialog, int which) [/p] settings.edit().putBoolean("isFirstRun", false).commit();[/p] }[/p] }).show();[/p] }[/p] }[/p] }[/code:3tcp4004][/p] [/p] And for Ios[/p] [/p] [code:3tcp4004]// This code will work in iOS 2 and up[/p] // (spoiler: you're not going to need anything below iOS 6).[/p] // Tested in iOS 7 [/p] // In your app's UIApplicationDelegate:[/p] [/p] [ul][/p] [li](BOOL)application:(UIApplication *)application[/li][/p] [/ul] didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[/p] (...)[/p] NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];[/p] if (![defaults boolForKey:@"termsAccepted"]) [/p] NSString *message =[/p] "Your message for visitors here";[/p] UIAlertView *alert =[/p] [[UIAlertView alloc] initWithTitle:@"Cookies"[/p] message:message[/p] delegate:self[/p] cancelButtonTitle:nil[/p] otherButtonTitles:@"Close message", nil];[/p] [alert show];[/p] }[/p] }[/p] [/p] [/code:3tcp4004][/p] I think it is a lot of people having trouble with this.[/p] And yes me too .[/p] Thank's

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)