Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛  مشکل: نمایش داده نشدن تبلیغ در لانچ اول #95

Open
AmirSinaRZ opened this issue Sep 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@AmirSinaRZ
Copy link

در بعضی مواقع تبلیغات در لانچ اول نمایش داده نمیشه.
لاگ :

Tapsell, requestAdError
null

کد ها و نحوه استفاده :

@Override
    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        homeBinding = FragmentHomeBinding.inflate(inflater, container, false);
        init();
        return homeBinding.getRoot();
    }
...
    private void init() {
        setupTapsellAD();
    }
...
private void setupTapsellAD() {
        adHolder = TapsellPlus.createAdHolder(
                getActivity(), homeBinding.adContainer, R.layout.my_native_ad);
        requestAd();
    }
...
private void requestAd() {
        TapsellPlus.requestNativeAd(
                getActivity(),
                MyTapsell.NativeAD,
                new AdRequestCallback() {
                    @Override
                    public void response(TapsellPlusAdModel tapsellPlusAdModel) {
                        super.response(tapsellPlusAdModel);

                        //Ad is ready to show
                        //Put the ad's responseId to your responseId variable
                        nativeAdResponseId = tapsellPlusAdModel.getResponseId();
                        showAd();
                        Log.i("Tapsell", "requested");
                    }

                    @Override
                    public void error(@NonNull String message) {
                        if (!isRequestedOnce) {
                            requestAd();
                            isRequestedOnce = true;
                        }
                        Log.wtf("Tapsell", "requestAdError\n" + message);
                    }
                });
    }
...
private void showAd() {
        TapsellPlus.showNativeAd(getActivity(), nativeAdResponseId, adHolder,
                new AdShowListener() {
                    @Override
                    public void onOpened(TapsellPlusAdModel tapsellPlusAdModel) {
                        super.onOpened(tapsellPlusAdModel);
                        Log.i("Tapsell", "OnOpen");
                    }

                    @Override
                    public void onError(TapsellPlusErrorModel tapsellPlusErrorModel) {
                        super.onError(tapsellPlusErrorModel);
                        Log.wtf("Tapsell onError", "onError");
                    }
                });
    }
@AmirSinaRZ AmirSinaRZ added the bug Something isn't working label Sep 11, 2024
@MortezaNedaei
Copy link
Member

این مشکل رو تونستید در اپ سمپل هم بازتولید کنید؟
در صورت وقوع در اپ سمپل، نیاز به اطلاعات جزئی تری داریم که بتونیم این مشکل رو سمت خودمون بازتولید کنیم

@AmirSinaRZ
Copy link
Author

توی اپ سمپل داخل اکتیویتی پیاده سازی شده ولی من توی فرگمنت استفاده میکنم

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants