Dear Team,
Please find my configuration :
Expo SDK 45
iOS platform
Bare project
I want to remove the home indicator from my app.
I tried with react-native-home-indicator but when I remove this line from AppDelegate :
UIViewController *rootViewController = [self.reactDelegate createRootViewController];
The expo orientation doesn’t work.
I tried with “Swizzling” methods with this code :
@implementation UIViewController (Swizzling)
- (void)load
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
SEL originalSelector = @selector(prefersHomeIndicatorAutoHidden);
SEL swizzledSelector = @selector(swizzledPrefersHomeIndicatorAutoHidden);
Method originalMethod = class_getInstanceMethod([self class], originalSelector);
Method swizzledMethod = class_getInstanceMethod([self class], swizzledSelector);
const BOOL didAdd = class_addMethod([self class], originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod));
if (didAdd)
class_replaceMethod([self class], swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));
else
method_exchangeImplementations(originalMethod, swizzledMethod);
});
}
- (BOOL)prefersHomeIndicatorAutoHidden
{
return YES; //Doesn’t matter what you return here. In this you could return the actual property value.
}
- (BOOL)swizzledPrefersHomeIndicatorAutoHidden //This is the actual
prefersHomeIndicatorAutoHidden
call{
return YES ;
}
@end
But since Expo SDK 45 the home indicator is not removed.
Could you tell me why and how can I fixe it ?
Thanks in advance for your help,
Kind regards,
Kévin Graillot