Skip to content

Commit

Permalink
add plugin injections
Browse files Browse the repository at this point in the history
  • Loading branch information
ElenaDiachenko committed Jan 16, 2024
1 parent 4e400dc commit a2358f4
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactActivityDelegate;

{{PLUGIN_ACTIVITY_IMPORTS}}

public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
{{PLUGIN_ON_CREATE}};
{{INJECT_ON_CREATE}};
}

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactActivityDelegate;

{{PLUGIN_ACTIVITY_IMPORTS}}

public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
{{PLUGIN_ON_CREATE}};
{{INJECT_ON_CREATE}};
}

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#import <RCTAppDelegate.h>
#import <UIKit/UIKit.h>

@interface AppDelegate : RCTAppDelegate
{{APPDELEGATE_H_IMPORTS}}

@interface AppDelegate : RCTAppDelegate {{APPDELEGATE_H_EXTENSIONS}}

@end
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
#import "AppDelegate.h"

#import <React/RCTBundleURLProvider.h>
{{APPDELEGATE_MM_IMPORTS}}

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.moduleName = @"RNVApp";
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};
{{APPDELEGATE_METHODS}}

return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

@end
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -13,28 +13,19 @@
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="RNVApp" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
<rect key="frame" x="0.0" y="202" width="375" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
<rect key="frame" x="0.0" y="626" width="375" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="launch-image" translatesAutoresizingMaskIntoConstraints="NO" id="Lbb-EF-Vui">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
<constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
<constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
<constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
<constraint firstItem="Lbb-EF-Vui" firstAttribute="trailing" secondItem="Bcu-3y-fUS" secondAttribute="trailing" id="BFY-LL-QCf"/>
<constraint firstItem="Lbb-EF-Vui" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="Gn8-TB-M9Y"/>
<constraint firstItem="Lbb-EF-Vui" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="aLd-9Q-2YD"/>
<constraint firstAttribute="bottom" secondItem="Lbb-EF-Vui" secondAttribute="bottom" id="cqS-Bs-r40"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
</view>
Expand All @@ -44,4 +35,7 @@
<point key="canvasLocation" x="52.173913043478265" y="375"/>
</scene>
</scenes>
</document>
<resources>
<image name="launch-image" width="1000" height="1000"/>
</resources>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactActivityDelegate;

{{PLUGIN_ACTIVITY_IMPORTS}}

public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
{{PLUGIN_ON_CREATE}};
{{INJECT_ON_CREATE}};
}

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
Expand Down
18 changes: 0 additions & 18 deletions packages/engine-rn/templates/platforms/ios/RNVApp/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,5 @@ @implementation AppDelegate

{{APPDELEGATE_METHODS}}

// - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
// {
// self.moduleName = @"RNVApp";
// // You can add your custom initial props in the dictionary below.
// // They will be passed down to the ViewController used by React Native.
// self.initialProps = @{};

// return [super application:application didFinishLaunchingWithOptions:launchOptions];
// }

// - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
// {
// #if DEBUG
// return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
// #else
// return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
// #endif
// }

@end

0 comments on commit a2358f4

Please sign in to comment.