-
-
Notifications
You must be signed in to change notification settings - Fork 182
Description
Documentation Feedback
Hello, I was improving the startup performance of our app and noticed that when we test with a very slow connection (128 kbps), the initialize
method takes about 10 seconds to respond.
The documentation says:
Initialize the Google Mobile Ads SDK
Before loading ads, have your app initialize the Google Mobile Ads SDK by calling initialize which initializes the SDK and returns a promise once initialization is complete (or after a 30-second timeout). This needs to be done only once, ideally at app launch.
Source: https://docs.page/invertase/react-native-google-mobile-ads#initialize-the-google-mobile-ads-sdk
I have a few questions:
The example only calls the initialize
method on Android, does not wait for the promise, and mentions that it's only used for the debug menu:
constructor() {
// Android requires SDK initialization before opening the Debug Menu
Platform.OS === 'android' && MobileAds().initialize().catch(console.error);
}
I tested removing it, and everything still seems to work fine, at least test ads are loading correctly.
My question is: Is it required to use the initialize
method, or is it safe to remove it? Alternatively, should I still call it but avoid waiting for the promise before loading ads?
Also, the documentation mentions a 30 seconds timeout, but in my case I consistently get a response after 10 seconds. Does this mean the current timeout is actually 10 seconds instead of 30?
Thanks,