Open JoonDong2 opened 3 years ago
Could you please share a repo where we can easily reproduce this bug ? Thanks in advance :)
Could you please share a repo where we can easily reproduce this bug ? Thanks in advance :)
When the video interstitial is executed and closed, the height value of the status bar in iOS becomes 0.
So, because of this, when the keyboard appears in the KeyboardAvoidingView, there is an empty space as much as the status bar below.
I am temporarily managing keyboardVerticalOffset
as a state.
import { NativeModules } from "react-native";
const { StatusBarManager } = NativeModules;
useEffect(() => {
StatusBarManager.getHeight((statusBarFrameData: any) => {
console.log(statusBarFrameData.height) // => initial value is 20 on iPhone 6S.
});
return () => {}
}, [])
const preloadInterstitialAd = async () => {
const didClick = await InterstitialAdManager.preloadAd(FacebookAdsPlacementIds['interstitial']);
if(isIOS) {
StatusBarManager.getHeight((statusBarFrameData: any) => {
setKeyboardVerticalOffset(statusBarFrameData.height) // => changed to 0.
});
}
if(didClick) {
// ...
}
}
// getStatusBarHeight() returns 20 on iPhone 6S.
return (
<KeyboardAvoidingView
enabled
behavior={isAndroid ? 'height' : 'padding'}
keyboardVerticalOffset={getStatusBarHeight()}>
...
</<KeyboardAvoidingView>
)
Bug Report
Before opening
Ad Modules video interstitial
Platforms iOS
Versions 14.4.2
Ads Environment
Current Behaviour If there is a KeyboardAvoidingView component on the screen, after the video interstitial is closed and the keyboard appears, a new space is created. Interstitial ads without video do not.
I tested on react native 0.63.4 and 0.64.0. and I am using latest version of this libaray.