Skip to content

Commit 196ec16

Browse files
cgxhgcffdfgfgdylancom
authored andcommitted
fix: Fabric codegen support for new arch
1 parent 09dad84 commit 196ec16

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

ios/RNGoogleMobileAds/RNGoogleMobileAdsMediaView.mm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,23 @@ - (void)setResizeMode:(NSString *)resizeMode {
129129

130130
@end
131131

132+
#ifndef RCT_NEW_ARCH_ENABLED
133+
132134
@implementation RNGoogleMobileAdsMediaViewManager
133135

134136
RCT_EXPORT_MODULE(RNGoogleMobileAdsMediaView)
135137

136138
RCT_EXPORT_VIEW_PROPERTY(responseId, NSString)
137-
138139
RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSString)
139140

140-
#ifndef RCT_NEW_ARCH_ENABLED
141141
- (UIView *)view {
142142
return [[RNGoogleMobileAdsMediaView alloc] initWithBridge:self.bridge];
143143
}
144-
#endif
145144

146145
@end
147146

147+
#endif
148+
148149
#ifdef RCT_NEW_ARCH_ENABLED
149150
Class<RCTComponentViewProtocol> RNGoogleMobileAdsMediaViewCls(void) {
150151
return RNGoogleMobileAdsMediaView.class;

ios/RNGoogleMobileAds/RNGoogleMobileAdsNativeView.mm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,17 @@ - (void)dealloc {
187187

188188
@end
189189

190+
#ifndef RCT_NEW_ARCH_ENABLED
191+
192+
@interface RNGoogleMobileAdsNativeViewManager : RCTViewManager
193+
@end
194+
190195
@implementation RNGoogleMobileAdsNativeViewManager
191196

192197
RCT_EXPORT_MODULE(RNGoogleMobileAdsNativeView)
193198

194199
RCT_EXPORT_VIEW_PROPERTY(responseId, NSString)
195200

196-
#ifndef RCT_NEW_ARCH_ENABLED
197201
- (UIView *)view {
198202
return [[RNGoogleMobileAdsNativeView alloc] initWithBridge:self.bridge];
199203
}
@@ -212,10 +216,11 @@ - (UIView *)view {
212216
[view registerAsset:assetType reactTag:assetReactTag.intValue];
213217
}];
214218
}
215-
#endif
216219

217220
@end
218221

222+
#endif
223+
219224
#ifdef RCT_NEW_ARCH_ENABLED
220225
Class<RCTComponentViewProtocol> RNGoogleMobileAdsNativeViewCls(void) {
221226
return RNGoogleMobileAdsNativeView.class;

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@
169169
"name": "RNGoogleMobileAdsSpec",
170170
"type": "all",
171171
"jsSrcsDir": "./src/specs",
172+
"ios": {
173+
"componentProvider": {
174+
"RNGoogleMobileAdsNativeView": "RNGoogleMobileAdsNativeView",
175+
"RNGoogleMobileAdsMediaView": "RNGoogleMobileAdsMediaView"
176+
}
177+
},
172178
"android": {
173179
"javaPackageName": "io.invertase.googlemobileads"
174180
}

0 commit comments

Comments
 (0)