0

I am trying to show an interstitial ad after a certain number of clicks but I am not able to do so, I know there are some answers already there but they don't much help me.

Here is a list of onClick methods I want to use to implement an interstitial ad after certain clicks

 @SuppressLint("SetTextI18n")
    private void back() {
        if (position > 0) {
            position = (position - 1) % quotes_list.size();
            quotesTxt.setText(quotes_list.get(position));
            countTxt.setText(position + "/" + quotes_list.size());
            Log.d(TAG, quotes_list.toString());
        }
    }

    @SuppressLint("SetTextI18n")
    private void next() {
        position = (position + 1) % quotes_list.size();
        quotesTxt.setText(quotes_list.get(position));
        countTxt.setText(position + "/" + quotes_list.size());
        Log.d(TAG, quotes_list.toString());
    }

    @SuppressLint("SetTextI18n")
    private void random() {
        position = randomQ.nextInt(quotes_list.size());
        quotesTxt.setText(quotes_list.get(position));
        countTxt.setText(position + "/" + quotes_list.size());
        Log.d(TAG, quotes_list.toString());
    }


    private void copy() {
        if (mInterstitialAd != null) {
            mInterstitialAd.show(HomeActivity.this);
            mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                @Override
                public void onAdDismissedFullScreenContent() {
                    super.onAdDismissedFullScreenContent();
                    startActivity(new Intent(HomeActivity.this, HomeActivity.class));
                    mInterstitialAd = null;
                    intertitalAd();
                    ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
                    ClipData clipData = ClipData.newPlainText("text", quotesTxt.getText());
                    if (clipboardManager != null) {
                        clipboardManager.setPrimaryClip(clipData);
                    }
                    Toast.makeText(getApplicationContext(), "Copied", Toast.LENGTH_SHORT).show();
                    Log.d(TAG, quotes_list.toString());
                }
            });
        } else {
            startActivity(new Intent(HomeActivity.this, HomeActivity.class));


        }

    }

    private void share() {
        clickCount += 1;
        if (clickCount < 4) {
            startActivity(new Intent(HomeActivity.this, HomeActivity.class));
            Intent intent = new Intent(Intent.ACTION_SEND);
            intent.setType("text/plain");
            intent.putExtra(Intent.EXTRA_TEXT, quotesTxt.getText());
            startActivity(Intent.createChooser(intent, "Share to"));
        } else {
            if (mInterstitialAd != null) {
                mInterstitialAd.show(HomeActivity.this);
                mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                    @Override
                    public void onAdDismissedFullScreenContent() {
                        super.onAdDismissedFullScreenContent();
                        startActivity(new Intent(HomeActivity.this, HomeActivity.class));
                        mInterstitialAd = null;
                        intertitalAd();
                        Intent intent = new Intent(Intent.ACTION_SEND);
                        intent.setType("text/plain");
                        intent.putExtra(Intent.EXTRA_TEXT, quotesTxt.getText());
                        startActivity(Intent.createChooser(intent, "Share to"));
                        clickCount = 0;
                    }
                });
            } else {
                startActivity(new Intent(HomeActivity.this, HomeActivity.class));


            }
        }


    }

 @SuppressLint("SetTextI18n")
    private void latestQuote() {

        position = quotes_list.size() - 1;
        quotesTxt.setText(quotes_list.get(position));
        countTxt.setText(position + "/" + quotes_list.size());
        Log.d(TAG, quotes_list.toString());


    }

    @SuppressLint("SetTextI18n")
    private void firstQuote() {
        position = 0;
        quotesTxt.setText(quotes_list.get(position));
        countTxt.setText(position + "/" + quotes_list.size());
        Log.d(TAG, quotes_list.toString());
    }

There are five methods: latestQuote, firstQuote, back, next, and random. The confusion I have is with the onClick methods, since I'm getting a text, rather than getting a new activity/fragment whenever a button is clicked, so basically what I want is to show a text after the interstitial ad, but within the same activity., but, as I understand it, you have to get a new intent after an interstitial ad.

However, I also want to show interstitial ads on copy() and share() too. I tried to add a counter to the share() first, but that did not work for me.

Update :- as requested in the comment here is the full code

public class HomeActivity extends AppCompatActivity implements View.OnClickListener {
    TextView countTxt, quotesTxt, noAds;
    ImageView previousBtn, randomBtn, shareBtn, copyBtn, nextBtn;
    List<String> quotes_list;
    DatabaseReference databaseReference;
    TextView noInternet;
    RelativeLayout mainRelativeLayout;
    Model model;
    int position = 0;
    Random randomQ = new Random();
    int clickCount = 0;
    private InterstitialAd mInterstitialAd;

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home_activity);
        Window window = this.getWindow();
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(ContextCompat.getColor(this, R.color.woodActionBar));
        countTxt = findViewById(R.id.countText);
        quotesTxt = findViewById(R.id.quotesTextView);
        previousBtn = findViewById(R.id.backBtn);
        randomBtn = findViewById(R.id.randomBtn);
        shareBtn = findViewById(R.id.shareBtn);
        copyBtn = findViewById(R.id.copyBtn);
        nextBtn = findViewById(R.id.nextBtn);
        noInternet = findViewById(R.id.noInternet);
        mainRelativeLayout = findViewById(R.id.relativelayoutMain);
        noAds = findViewById(R.id.noAds);


        Toolbar toolbar = findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        Objects.requireNonNull(this.getSupportActionBar()).setDisplayShowTitleEnabled(false);

        previousBtn.setOnClickListener(this);
        randomBtn.setOnClickListener(this);
        shareBtn.setOnClickListener(this);
        copyBtn.setOnClickListener(this);
        nextBtn.setOnClickListener(this);


        databaseReference = FirebaseDatabase.getInstance().getReference("Quotes");
        model = new Model();
        quotes_list = new ArrayList<>();
        databaseReference.addValueEventListener(new ValueEventListener() {
            @SuppressLint("SetTextI18n")
            @Override
            public void onDataChange(@NonNull @org.jetbrains.annotations.NotNull DataSnapshot snapshot) {
                for (DataSnapshot dataSnapshot1 : snapshot.getChildren()) {
                    model = dataSnapshot1.getValue(Model.class);
                    if (model != null) {
                        quotes_list.add(model.getTitle());
                        position = randomQ.nextInt(quotes_list.size());
                        Log.d(TAG, quotes_list.toString());

                    }
                }
                quotesTxt.setText(quotes_list.get(position));
                countTxt.setText(position + "/" + quotes_list.size());
                Log.d(TAG, quotes_list.toString());
            }

            @Override
            public void onCancelled(@NonNull @org.jetbrains.annotations.NotNull DatabaseError error) {
                Toast.makeText(HomeActivity.this, "Error", Toast.LENGTH_SHORT).show();
                Log.d(TAG, error.getMessage());

            }
        });

        // Ads

        MobileAds.initialize(this, initializationStatus -> {
        });

        AdView mAdView = findViewById(R.id.adView);

        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd(adRequest);
        mAdView.setAdListener(new AdListener() {
            @Override
            public void onAdLoaded() {
                super.onAdLoaded();
            }

            @Override
            public void onAdFailedToLoad(@NotNull LoadAdError adError) {
                super.onAdFailedToLoad(adError);
                mAdView.loadAd(adRequest);
            }

            @Override
            public void onAdOpened() {
                super.onAdOpened();
            }

            @Override
            public void onAdClicked() {
                super.onAdClicked();
            }

            @Override
            public void onAdClosed() {
                super.onAdClosed();
            }
        });

        intertitalAd();
        // Internet on/off
        if (isOnline()) {
            noInternet.setVisibility(View.INVISIBLE); // Online
            mainRelativeLayout.setVisibility(View.VISIBLE);

        } else {
            noInternet.setVisibility(View.VISIBLE); // Disconnected
            mainRelativeLayout.setVisibility(View.INVISIBLE);
        }

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menue, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @SuppressLint("NonConstantResourceId")
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        switch (item.getItemId()) {
            case R.id.latestQuote:
                latestQuote();
                return true;
            case R.id.firstQuote:
                firstQuote();
                return true;

            case R.id.guide:
                guide();
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    @SuppressLint("SetTextI18n")
    private void latestQuote() {

        position = quotes_list.size() - 1;
        quotesTxt.setText(quotes_list.get(position));
        countTxt.setText(position + "/" + quotes_list.size());
        Log.d(TAG, quotes_list.toString());


    }

    @SuppressLint("SetTextI18n")
    private void firstQuote() {
        position = 0;
        quotesTxt.setText(quotes_list.get(position));
        countTxt.setText(position + "/" + quotes_list.size());
        Log.d(TAG, quotes_list.toString());
    }

    private void guide() {
        Intent intent = new Intent(HomeActivity.this, Guide.class);
        startActivity(intent);
    }


    @SuppressLint("NonConstantResourceId")
    @Override
    public void onClick(View view) {

        switch (view.getId()) {
            case R.id.backBtn:
                back();
                break;
            case R.id.randomBtn:
                random();
                break;
            case R.id.copyBtn:
                copy();
                break;
            case R.id.shareBtn:
                share();
                break;
            case R.id.nextBtn:
                next();
                break;
        }

    }

    @SuppressLint("SetTextI18n")
    private void back() {
        if (position > 0) {
            position = (position - 1) % quotes_list.size();
            quotesTxt.setText(quotes_list.get(position));
            countTxt.setText(position + "/" + quotes_list.size());
            Log.d(TAG, quotes_list.toString());
        }
    }

    @SuppressLint("SetTextI18n")
    private void next() {
        position = (position + 1) % quotes_list.size();
        quotesTxt.setText(quotes_list.get(position));
        countTxt.setText(position + "/" + quotes_list.size());
        Log.d(TAG, quotes_list.toString());
    }

    @SuppressLint("SetTextI18n")
    private void random() {
        position = randomQ.nextInt(quotes_list.size());
        quotesTxt.setText(quotes_list.get(position));
        countTxt.setText(position + "/" + quotes_list.size());
        Log.d(TAG, quotes_list.toString());
    }


    private void copy() {
        if (mInterstitialAd != null) {
            mInterstitialAd.show(HomeActivity.this);
            mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                @Override
                public void onAdDismissedFullScreenContent() {
                    super.onAdDismissedFullScreenContent();
                    startActivity(new Intent(HomeActivity.this, HomeActivity.class));
                    mInterstitialAd = null;
                    intertitalAd();
                    ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
                    ClipData clipData = ClipData.newPlainText("text", quotesTxt.getText());
                    if (clipboardManager != null) {
                        clipboardManager.setPrimaryClip(clipData);
                    }
                    Toast.makeText(getApplicationContext(), "Copied", Toast.LENGTH_SHORT).show();
                    Log.d(TAG, quotes_list.toString());
                }
            });
        } else {
            startActivity(new Intent(HomeActivity.this, HomeActivity.class));


        }

    }

    private void share() {
        clickCount += 1;
        if (clickCount < 4) {
            startActivity(new Intent(HomeActivity.this, HomeActivity.class));
            Intent intent = new Intent(Intent.ACTION_SEND);
            intent.setType("text/plain");
            intent.putExtra(Intent.EXTRA_TEXT, quotesTxt.getText());
            startActivity(Intent.createChooser(intent, "Share to"));
        } else {
            if (mInterstitialAd != null) {
                mInterstitialAd.show(HomeActivity.this);
                mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                    @Override
                    public void onAdDismissedFullScreenContent() {
                        super.onAdDismissedFullScreenContent();
                        startActivity(new Intent(HomeActivity.this, HomeActivity.class));
                        mInterstitialAd = null;
                        intertitalAd();
                        Intent intent = new Intent(Intent.ACTION_SEND);
                        intent.setType("text/plain");
                        intent.putExtra(Intent.EXTRA_TEXT, quotesTxt.getText());
                        startActivity(Intent.createChooser(intent, "Share to"));
                        clickCount = 0;
                    }
                });
            } else {
                startActivity(new Intent(HomeActivity.this, HomeActivity.class));


            }
        }


    }

    // Internet on/off
    public boolean isOnline() {
        boolean connected = false;
        try {
            ConnectivityManager connectivityManager = (ConnectivityManager) this.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
            connected = networkInfo != null && networkInfo.isAvailable() && networkInfo.isConnected();
            return connected;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return connected;
    }

    public void intertitalAd() {

        AdRequest adRequest = new AdRequest.Builder().build();


        InterstitialAd.load(this, "ca-app-pub-3940256099942544/8691691433", adRequest,
                new InterstitialAdLoadCallback() {
                    @Override
                    public void onAdLoaded(@NonNull InterstitialAd interstitialAd) {
                        // The mInterstitialAd reference will be null until
                        // an ad is loaded.
                        mInterstitialAd = interstitialAd;
                    }

                    @Override
                    public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
                        // Handle the error
                        mInterstitialAd = null;
                    }
                });

    }

}
  • 1
    Please tell and show what questions and answers have you reviewed, and how, specifically, have they not helped you. – Hovercraft Full Of Eels Jun 13 '22 at 14:32
  • @HovercraftFullOfEels Here is one of them https://stackoverflow.com/questions/53986567/how-to-show-the-interstitial-ads-on-second-click#:~:text=Just%20use%20a%20int%20counter,second%20click%20and%20show%20ad –  Jun 14 '22 at 03:59
  • 1
    "as I understand it, you have to get a new intent after an interstitial ad." - you don't have to do this. You didn't copied the piece of code where you are setting `mInterstitialAd` - maybe it is `null` all the time? Also if all the methods you copied are inside `HomeActivity`, it seems you recreating activity more then required, and you counter is resetting each time. Please post the whole file with the code. – Vasily Kabunov Jun 14 '22 at 11:33
  • @VasilyKabunov please check I have updated the question now with the full code, talking about your question, if possible I don't want to get an intent after an interstitial ad –  Jun 14 '22 at 12:45

2 Answers2

0

Okay I figured it out by myself with 2 global variables

1:- countClick for checking the button click

2 :- triggerClicks, if countClick and triggerClicks are equal I will show the ad

Note:- I have added this extra int triggerClicksNav because I want to get ads for some methods on different amounts of clicks so I have added 2 total triggerClicks but it is not necessary, I did it for my convenience

have a look at how I did

 int triggerClicks = 3;
    int countClicks = 0;
    int triggerClicksNav = 7;

 @SuppressLint("SetTextI18n")
    private void latestQuote() {
        countClicks++;
        if (countClicks != 3) {
            position = quotes_list.size() - 1;
            quotesTxt.setText(quotes_list.get(position));
            countTxt.setText(position + "/" + quotes_list.size());
            Log.d(TAG, quotes_list.toString());
        }
        if (mInterstitialAd != null && countClicks >= triggerClicks) {
            mInterstitialAd.show(HomeActivity.this);
            mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                @Override
                public void onAdDismissedFullScreenContent() {
                    super.onAdDismissedFullScreenContent();
                    mInterstitialAd = null;
                    intertitalAd();
                    position = quotes_list.size() - 1;
                    quotesTxt.setText(quotes_list.get(position));
                    countTxt.setText(position + "/" + quotes_list.size());
                    Log.d(TAG, quotes_list.toString());
                    countClicks = 0;


                }
            });
        }
    }

    @SuppressLint("SetTextI18n")
    private void firstQuote() {
        countClicks++;
        if (countClicks != 3) {
            position = 0;
            quotesTxt.setText(quotes_list.get(position));
            countTxt.setText(position + "/" + quotes_list.size());
            Log.d(TAG, quotes_list.toString());
        }
        if (mInterstitialAd != null && countClicks >= triggerClicks) {
            mInterstitialAd.show(HomeActivity.this);
            mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                @Override
                public void onAdDismissedFullScreenContent() {
                    super.onAdDismissedFullScreenContent();
                    mInterstitialAd = null;
                    intertitalAd();
                    position = 0;
                    quotesTxt.setText(quotes_list.get(position));
                    countTxt.setText(position + "/" + quotes_list.size());
                    countClicks = 0;


                }
            });
        }

    }

    private void guide() {
        Intent intent = new Intent(HomeActivity.this, Guide.class);
        startActivity(intent);
    }


    @SuppressLint("SetTextI18n")
    private void back() {
        countClicks++;
        if (countClicks != 7) {
            if (position > 0) {
                position = (position - 1) % quotes_list.size();
                quotesTxt.setText(quotes_list.get(position));
                countTxt.setText(position + "/" + quotes_list.size());
                Log.d(TAG, quotes_list.toString());
            }
        }
        if (mInterstitialAd != null && countClicks >= triggerClicksNav) {
            mInterstitialAd.show(HomeActivity.this);
            mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                @Override
                public void onAdDismissedFullScreenContent() {
                    super.onAdDismissedFullScreenContent();
                    mInterstitialAd = null;
                    intertitalAd();
                    if (position > 0) {
                        position = (position - 1) % quotes_list.size();
                        quotesTxt.setText(quotes_list.get(position));
                        countTxt.setText(position + "/" + quotes_list.size());
                        Log.d(TAG, quotes_list.toString());
                    }
                    countClicks = 0;


                }
            });
        }

    }

    @SuppressLint("SetTextI18n")
    private void next() {
        countClicks++;
        if (countClicks != 7) {
            position = (position + 1) % quotes_list.size();
            quotesTxt.setText(quotes_list.get(position));
            countTxt.setText(position + "/" + quotes_list.size());
            Log.d(TAG, quotes_list.toString());
        }
        if (mInterstitialAd != null && countClicks >= triggerClicksNav) {
            mInterstitialAd.show(HomeActivity.this);
            mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                @Override
                public void onAdDismissedFullScreenContent() {
                    super.onAdDismissedFullScreenContent();
                    mInterstitialAd = null;
                    intertitalAd();
                    position = (position + 1) % quotes_list.size();
                    quotesTxt.setText(quotes_list.get(position));
                    countTxt.setText(position + "/" + quotes_list.size());
                    countClicks = 0;


                }
            });
        }
    }

    @SuppressLint("SetTextI18n")
    private void random() {
        countClicks++;
        if (countClicks != 7) {
            position = randomQ.nextInt(quotes_list.size());
            quotesTxt.setText(quotes_list.get(position));
            countTxt.setText(position + "/" + quotes_list.size());
            Log.d(TAG, quotes_list.toString());
        }
        if (mInterstitialAd != null && countClicks >= triggerClicksNav) {
            mInterstitialAd.show(HomeActivity.this);
            mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                @Override
                public void onAdDismissedFullScreenContent() {
                    super.onAdDismissedFullScreenContent();
                    mInterstitialAd = null;
                    intertitalAd();
                    position = randomQ.nextInt(quotes_list.size());
                    quotesTxt.setText(quotes_list.get(position));
                    countTxt.setText(position + "/" + quotes_list.size());
                    countClicks = 0;


                }
            });
        }

    }


    private void copy() {
        countClicks++;
        if (countClicks != 3) {
            ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
            ClipData clipData = ClipData.newPlainText("text", quotesTxt.getText());
            if (clipboardManager != null) {
                clipboardManager.setPrimaryClip(clipData);
            }
            Toast.makeText(getApplicationContext(), "Copied", Toast.LENGTH_SHORT).show();
        }
        if (mInterstitialAd != null && countClicks >= triggerClicks) {
            mInterstitialAd.show(HomeActivity.this);
            mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                @Override
                public void onAdDismissedFullScreenContent() {
                    super.onAdDismissedFullScreenContent();
                    mInterstitialAd = null;
                    intertitalAd();

                    ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
                    ClipData clipData = ClipData.newPlainText("text", quotesTxt.getText());
                    if (clipboardManager != null) {
                        clipboardManager.setPrimaryClip(clipData);
                    }
                    Toast.makeText(getApplicationContext(), "Copied", Toast.LENGTH_SHORT).show();
                    countClicks = 0;
                }
            });
        }

    }

    private void share() {
        countClicks++;
        if (countClicks != 3) {
            Intent intent = new Intent(Intent.ACTION_SEND);
            intent.setType("text/plain");
            intent.putExtra(Intent.EXTRA_TEXT, quotesTxt.getText());
            startActivity(Intent.createChooser(intent, "Share to"));

        }
        if (mInterstitialAd != null && countClicks >= triggerClicks) {
            mInterstitialAd.show(HomeActivity.this);
            mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                @Override
                public void onAdDismissedFullScreenContent() {
                    super.onAdDismissedFullScreenContent();
                    mInterstitialAd = null;
                    intertitalAd();
                    Intent intent = new Intent(Intent.ACTION_SEND);
                    intent.setType("text/plain");
                    intent.putExtra(Intent.EXTRA_TEXT, quotesTxt.getText());
                    startActivity(Intent.createChooser(intent, "Share to"));
                    countClicks = 0;
                }

            });
        }
    }
  • if anyone has a better version or I say more clean and optimised version of the code , feel free to share –  Jun 15 '22 at 06:18
0

I would suggest a few things:

  1. You don't have to call startActivity(new Intent(HomeActivity.this, HomeActivity.class)); every time after ad closing. It will prevent you activity from unnecessary recreation every time. UPD. I see you did this in your updated post, hope now it works correctly.

  2. You can simplify your code and avoid code duplication and unnecessary UI updating something like:

@SuppressLint("SetTextI18n")
private void random() {
    countClicks++;
    
    position = randomQ.nextInt(quotes_list.size());
    quotesTxt.setText(quotes_list.get(position));
    countTxt.setText(position + "/" + quotes_list.size());
    Log.d(TAG, quotes_list.toString());
    
    if (mInterstitialAd != null && countClicks >= triggerClicksNav) {
        mInterstitialAd.show(HomeActivity.this);
        mInterstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
            @Override
            public void onAdDismissedFullScreenContent() {
                super.onAdDismissedFullScreenContent();

                countClicks = 0;
                
                // Only request new ad is required here
                mInterstitialAd = null;
                intertitalAd();
                
                // No need to call the code to update UI again
            }
        });
    }
}

3.You can save your count variables between activity recreations if needed. For example when user rotates the device your counts will be reset to 0.

Vasily Kabunov
  • 6,511
  • 13
  • 49
  • 53
  • Hi, thanks a lot, it is now easier and more optimized, can I ask you a question, according to what should be a good number to show ads? The next(), back(), random(), latestQuote() & firstQuote() buttons let users switch between different quotes, I am wondering what number to show ads after, for example, currently I am showing ads after 7 clicks, is it a good number or should I just set it high or low? For share() & copy(), the number is 3 –  Jun 15 '22 at 11:07
  • In my app I use time delay to realise should the ad be shown or not. For example when user does some action (for example passes a level or click a button etc), I store that time. When user does the action again, I check how much time passed. If it's more than 1 min for example, I show the ad. In this case user won't see the ad too often – Vasily Kabunov Jun 15 '22 at 11:14
  • so i should stick with 7 ? –  Jun 15 '22 at 11:31
  • I would use 7 to avoid show ads too often. It depends on how long users spent time in the up between clicks – Vasily Kabunov Jun 15 '22 at 12:10
  • That i can only know after the app will get released –  Jun 15 '22 at 12:31