NativeScript / firebase

Modular Firebase 🔥 implementation for NativeScript. Supports both iOS & Android platforms for all Firebase services.
https://docs.nativescript.org/plugins/firebase-core.html
Apache License 2.0
54 stars 47 forks source link

[firebase-admob] [iOS] When a NativeAdView comes back into view, an error is thrown (iOS only) #151

Closed LewisSmallwood closed 1 year ago

LewisSmallwood commented 1 year ago

See attached error log. I can fix this by checking if the child already has a parent before calling this code.

Screenshot 2022-11-02 at 16 19 40
LewisSmallwood commented 1 year ago

Should have mentioned this was on version 2.4.1.

The fix for this was:

 onLoaded() {
        super.onLoaded();
        if (this._child && !this._child.nativeView.isDescendantOfView(this._native)) {
            this._addView(this._child);
            this._native.addSubview(this._child.nativeView);
        }
    }

But it has already been resolved in 2.4.4 when migrating to the content view.