Closed dylancom closed 4 years ago
Hi @dylancom. It seems to be a bug on native SDK side. The idea was that once you call initialise method of Appodeal SDK you are able to use banners without awaiting initialisation callback. We will research this case and add fixes in future release of Appodeal SDK. For now please use your approach with extra delay.
@dylancom
I've resolved this issue by updating state value. so on initialize callback I've updated the state and show banner once appodeal SDK initialized.
Here's the code snippet I've used:
//componentDidMount initialize(true, (status: AppodealConsentStatus, regulation: AppodealConsentRegulation) => { this.setState({ initialised: true, }) })
//render {this.state.initialised ( //show banner view here
)}
@dylancom We've fixed banner behaviour in 2.6.5. Since 2.6.5 banner view API can be used synchronously after Appodeal.initialize
method.
@staskochkin Thanks, I'm going to test it now!
If I directly show a banner after Appodeal.initialize('Your app key', adTypes, consent), it won't display on App startup. Unless I add a delay of around 1 second in between. Is there any way to know when Appodeal was initialized, so I can show the banner directly after the callback?