Skip to content

Commit 134fd9a

Browse files
authored
Merge pull request #675 from Iterable/MOB-11733
MOB-11733
2 parents bffaa7c + 0865c96 commit 134fd9a

File tree

10 files changed

+116
-161
lines changed

10 files changed

+116
-161
lines changed

example/ios/Podfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ target 'ReactNativeSdkExample' do
2525
:app_path => "#{Pod::Config.instance.installation_root}/.."
2626
)
2727

28-
target 'ReactNativeSdkExampleTests' do
29-
inherit! :complete
30-
# Pods for testing
31-
end
32-
3328
post_install do |installer|
3429
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
3530
react_native_post_install(

example/ios/ReactNativeSdkExample.xcodeproj/project.pbxproj

Lines changed: 40 additions & 101 deletions
Large diffs are not rendered by default.

example/ios/ReactNativeSdkExample/AppDelegate.h

Lines changed: 0 additions & 6 deletions
This file was deleted.

example/ios/ReactNativeSdkExample/AppDelegate.mm

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//
2+
// AppDelegate.swift
3+
// ReactNativeSdkExample
4+
//
5+
// Created by Loren Posen on 6/11/25.
6+
//
7+
8+
import UIKit
9+
import React
10+
import React_RCTAppDelegate
11+
import ReactAppDependencyProvider
12+
13+
@main
14+
class AppDelegate: UIResponder, UIApplicationDelegate {
15+
var window: UIWindow?
16+
17+
var reactNativeDelegate: ReactNativeDelegate?
18+
var reactNativeFactory: RCTReactNativeFactory?
19+
20+
func application(
21+
_ application: UIApplication,
22+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
23+
) -> Bool {
24+
let delegate = ReactNativeDelegate()
25+
let factory = RCTReactNativeFactory(delegate: delegate)
26+
delegate.dependencyProvider = RCTAppDependencyProvider()
27+
28+
reactNativeDelegate = delegate
29+
reactNativeFactory = factory
30+
31+
window = UIWindow(frame: UIScreen.main.bounds)
32+
33+
factory.startReactNative(
34+
withModuleName: "ReactNativeSdkExample",
35+
in: window,
36+
launchOptions: launchOptions
37+
)
38+
39+
return true
40+
}
41+
}
42+
43+
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
44+
override func sourceURL(for bridge: RCTBridge) -> URL? {
45+
self.bundleURL()
46+
}
47+
48+
override func bundleURL() -> URL? {
49+
#if DEBUG
50+
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
51+
#else
52+
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
53+
#endif
54+
}
55+
}
56+

example/ios/ReactNativeSdkExample/main.m

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//
2+
// Use this file to import your target's public headers that you would like to expose to Swift.
3+
//
4+

ios/RNIterableAPI.xcodeproj/project.pbxproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
AC13877D243BA05600A02674 /* Serialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC13877C243BA05600A02674 /* Serialization.swift */; };
1111
AC76DC322423C2290071587E /* ReactIterableAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC76DC302423C2290071587E /* ReactIterableAPI.swift */; };
12-
ACDDDF2224212BB9001686E5 /* RNIterableAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = ACDDDF2124212BB9001686E5 /* RNIterableAPI.m */; };
12+
ACDDDF2224212BB9001686E5 /* RNIterableAPI.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACDDDF2124212BB9001686E5 /* RNIterableAPI.mm */; };
1313
/* End PBXBuildFile section */
1414

1515
/* Begin PBXCopyFilesBuildPhase section */
@@ -25,11 +25,12 @@
2525
/* End PBXCopyFilesBuildPhase section */
2626

2727
/* Begin PBXFileReference section */
28+
779227302DFA3AD400D69EC0 /* RNIterableAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNIterableAPI.h; sourceTree = "<group>"; };
2829
AC13877C243BA05600A02674 /* Serialization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Serialization.swift; sourceTree = "<group>"; };
2930
AC547A9024004D39008782E7 /* libRNIterableAPI.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNIterableAPI.a; sourceTree = BUILT_PRODUCTS_DIR; };
3031
AC76DC302423C2290071587E /* ReactIterableAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReactIterableAPI.swift; sourceTree = "<group>"; };
3132
AC76DC312423C2290071587E /* RNIterable-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RNIterable-Bridging-Header.h"; sourceTree = "<group>"; };
32-
ACDDDF2124212BB9001686E5 /* RNIterableAPI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNIterableAPI.m; sourceTree = "<group>"; };
33+
ACDDDF2124212BB9001686E5 /* RNIterableAPI.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RNIterableAPI.mm; sourceTree = "<group>"; };
3334
/* End PBXFileReference section */
3435

3536
/* Begin PBXFrameworksBuildPhase section */
@@ -65,7 +66,8 @@
6566
AC13877C243BA05600A02674 /* Serialization.swift */,
6667
AC76DC302423C2290071587E /* ReactIterableAPI.swift */,
6768
AC76DC312423C2290071587E /* RNIterable-Bridging-Header.h */,
68-
ACDDDF2124212BB9001686E5 /* RNIterableAPI.m */,
69+
ACDDDF2124212BB9001686E5 /* RNIterableAPI.mm */,
70+
779227302DFA3AD400D69EC0 /* RNIterableAPI.h */,
6971
);
7072
path = RNIterableAPI;
7173
sourceTree = "<group>";
@@ -130,7 +132,7 @@
130132
files = (
131133
AC76DC322423C2290071587E /* ReactIterableAPI.swift in Sources */,
132134
AC13877D243BA05600A02674 /* Serialization.swift in Sources */,
133-
ACDDDF2224212BB9001686E5 /* RNIterableAPI.m in Sources */,
135+
ACDDDF2224212BB9001686E5 /* RNIterableAPI.mm in Sources */,
134136
);
135137
runOnlyForDeploymentPostprocessing = 0;
136138
};

ios/RNIterableAPI/RNIterableAPI.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//
2+
// RNIterableAPI.h
3+
// RNIterableAPI
4+
//
5+
// Created by Loren Posen on 6/11/25.
6+
// Copyright © 2025 Iterable. All rights reserved.
7+
//
8+
#import <React/RCTBridgeModule.h>
9+

ios/RNIterableAPI/RNIterableAPI.m renamed to ios/RNIterableAPI/RNIterableAPI.mm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
// Created by Tapash Majumder on 3/19/20.
33
// Copyright © 2020 Iterable. All rights reserved.
44
//
5-
6-
#import <React/RCTBridgeModule.h>
5+
#import "RNIterableAPI.h"
76

87
@interface RCT_EXTERN_REMAP_MODULE(RNIterableAPI, ReactIterableAPI, NSObject)
98

0 commit comments

Comments
 (0)