Skip to content

Commit a2de9ea

Browse files
committed
iOS Old architecture working with codegen
1 parent cc9b365 commit a2de9ea

File tree

7 files changed

+26
-12
lines changed

7 files changed

+26
-12
lines changed

android/src/main/java/com/mparticle/react/MParticleModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MParticleModule(private val reactContext: ReactApplicationContext) :
3333
NativeMParticleSpec(reactContext) {
3434

3535
companion object {
36-
const val MODULE_NAME = "MParticle"
36+
const val MODULE_NAME = "RNMParticle"
3737
private const val LOG_TAG = "MParticleModule"
3838
}
3939

ios/RNMParticle/RNMPRokt.m

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#elif defined(__has_include) && __has_include(<mParticle_Apple_SDK_NoLocation/mParticle.h>)
66
#import <mParticle_Apple_SDK_NoLocation/mParticle.h>
77
#else
8-
#import "mParticle.h"
8+
#import <mParticle_Apple_SDK/Include/mParticle.h>
99
#endif
1010
#if defined(__has_include) && __has_include(<mParticle_Apple_SDK/mParticle_Apple_SDK-Swift.h>)
1111
#import <mParticle_Apple_SDK/mParticle_Apple_SDK-Swift.h>
@@ -41,6 +41,17 @@ + (void)load {
4141
RCTRegisterModule(self);
4242
}
4343

44+
- (dispatch_queue_t)methodQueue
45+
{
46+
return self.bridge.uiManager.methodQueue;
47+
}
48+
49+
- (void)setMethodQueue:(dispatch_queue_t)methodQueue
50+
{
51+
// No-op setter to satisfy TurboModule requirements
52+
// We always return the UI manager's method queue
53+
}
54+
4455
RCT_EXPORT_METHOD(selectPlacements:(NSString *) identifer attributes:(NSDictionary *)attributes placeholders:(NSDictionary * _Nullable)placeholders roktConfig:(NSDictionary * _Nullable)roktConfig fontFilesMap:(NSDictionary * _Nullable)fontFilesMap)
4556
{
4657
NSMutableDictionary *finalAttributes = [self convertToMutableDictionaryOfStrings:attributes];

ios/RNMParticle/RNMParticle.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#elif defined(__has_include) && __has_include(<mParticle_Apple_SDK_NoLocation/mParticle.h>)
55
#import <mParticle_Apple_SDK_NoLocation/mParticle.h>
66
#else
7-
#import "mParticle.h"
7+
#import <mParticle_Apple_SDK/Include/mParticle.h>
88
#endif
99
#if defined(__has_include) && __has_include(<mParticle_Apple_SDK/mParticle_Apple_SDK-Swift.h>)
1010
#import <mParticle_Apple_SDK/mParticle_Apple_SDK-Swift.h>
@@ -25,7 +25,7 @@ @implementation RNMParticle
2525
RCT_EXTERN void RCTRegisterModule(Class);
2626

2727
+ (NSString *)moduleName {
28-
return @"MParticle";
28+
return @"RNMParticle";
2929
}
3030

3131
+ (void)load {

js/specs/NativeMParticle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,4 @@ export interface Spec extends TurboModule {
156156
aliasUsers(aliasRequest: AliasRequest, callback: () => void): void;
157157
}
158158

159-
export default TurboModuleRegistry.getEnforcing<Spec>('MParticle');
159+
export default TurboModuleRegistry.getEnforcing<Spec>('RNMParticle');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"typescript": "5.0.4"
3535
},
3636
"codegenConfig": {
37-
"name": "MParticle",
37+
"name": "RNMParticle",
3838
"type": "all",
3939
"jsSrcsDir": "js/specs",
4040
"android": {

react-native-mparticle.podspec

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ Pod::Spec.new do |s|
1818

1919
s.source = { :git => "https://github.com/mParticle/react-native-mparticle.git", :tag => "#{s.version}" }
2020
s.source_files = "ios/**/*.{h,m,mm,swift}"
21-
22-
if defined?(install_modules_dependencies()) != nil
23-
install_modules_dependencies(s);
21+
22+
if respond_to?(:install_modules_dependencies, true)
23+
install_modules_dependencies(s)
2424
else
25-
s.dependency 'React'
25+
s.dependency "React-Core"
2626
end
27-
s.dependency 'mParticle-Apple-SDK', '~> 8.0'
27+
28+
s.dependency 'mParticle-Apple-SDK', '~> 8.0'
2829
end

sample/ios/Podfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ENV['RCT_NEW_ARCH_ENABLED'] == '0'
1+
ENV['RCT_NEW_ARCH_ENABLED'] = '0'
22
# Resolve react_native_pods.rb with node to allow for hoisting
33
require Pod::Executable.execute_command('node', ['-p',
44
'require.resolve(
@@ -50,3 +50,5 @@ target 'MParticleSample' do
5050
)
5151
end
5252
end
53+
54+
#xcodebuild -workspace MParticleSample.xcworkspace -configuration Debug -scheme MParticleSample -destination id=4E6FD888-A8E8-4022-8562-1475E9D80A59

0 commit comments

Comments
 (0)