Configure iOS
OpenWeb Native View Configuration
- In the Podfile in your project's iOS folder, set
use_frameworks!
. - (React Native 0.63+) Comment out the following lines within the Podfile to disable
flipper
.
...
#add_flipper_pods!
# post_install do |installer|
# flipper_post_install(installer)
#end
...
- (React Native 0.63+) In AppDelegate.m, remove the following lines to disable the Flipper initialization.
...
#if DEBUG
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
static void InitializeFlipper(UIApplication *application) {
FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
[client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
[client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
[client addPlugin:[FlipperKitReactPlugin new]];
[client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
client start];
}
#endif
...
#if DEBUG
InitializeFlipper(application);
#endif
...
- To support native navigation, wrap the app with a navigation controller.
The default React-Native root view controller is an instance ofUIViewController
. OpenWeb usesUINavigationController
to navigate to native view controllers.
AppDelegate.h
@property (nonatomic, strong) UINavigationController *navControll;
AppDelegate.m
...
UIViewController *rootViewController = [UIViewController new];
self.navControll = [[UINavigationController alloc] initWithRootViewController:rootViewController];
[self.navControll setNavigationBarHidden:YES]; // Hide nav bar if you don't use native navigation controller
rootViewController.view = rootView;
self.window.rootViewController = self.navControll;
...
Monetization Configuration (AdsProvider)
-
Run
pod install
in the "ios" folder -
Open in Finder the following dir
Pods\SpotImCore\SpotImAdsProvider\
and copy the fileGoogleAdsProvider.swift
into your app target folder (where AppDelegate.m\h are) and make sure that in XcodeGoogleAdsProvider.swift
is included in your app target.

-
In
AppDelegate.m
at the top add#import "<ProductName>-Swift.h
(explanation here) -
In
AppDelegate.m
inapplication:didFinishLaunchingWithOptions:
method, please add the following line:
[GoogleAdsProvider setSpotImSDKWithProvider];
Updated almost 2 years ago