Skip to content

Commit 1a93331

Browse files
authored
fix: resolve React Native codegen compatibility issues (#322)
- Replace union types with Object to fix "union types are unsupported in structs" error - Update IntercomReactNativeSpec.h import path for New Architecture
1 parent 2aaaadd commit 1a93331

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

ios/IntercomModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#import <React/RCTBridgeModule.h>
22

33
#ifdef RCT_NEW_ARCH_ENABLED
4-
#import "IntercomReactNativeSpec.h"
4+
#import <IntercomReactNativeSpec/IntercomReactNativeSpec.h>
55
@interface IntercomModule : NSObject <NativeIntercomSpecSpec>
66
#else
77
@interface IntercomModule : NSObject <RCTBridgeModule>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@intercom/intercom-react-native",
3-
"version": "9.0.2",
3+
"version": "9.0.3",
44
"description": "React Native wrapper to bridge our iOS and Android SDK",
55
"source": "./src/index.tsx",
66
"main": "./lib/commonjs/index.js",

src/NativeIntercomSpec.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { TurboModuleRegistry } from 'react-native';
44
export interface UserAttributes {
55
companies?: Array<{
66
createdAt?: number;
7-
customAttributes?: { [key: string]: boolean | string | number };
7+
customAttributes?: Object; // { [key: string]: boolean | string | number };
88
id: string;
99
monthlySpend?: number;
1010
name?: string;
1111
plan?: string;
1212
}>;
13-
customAttributes?: { [key: string]: boolean | string | number };
13+
customAttributes?: Object; // { [key: string]: boolean | string | number };
1414
email?: string;
1515
languageOverride?: string;
1616
name?: string;
@@ -21,12 +21,7 @@ export interface UserAttributes {
2121
}
2222

2323
interface TurboModuleContent {
24-
type:
25-
| 'ARTICLE'
26-
| 'CAROUSEL'
27-
| 'SURVEY'
28-
| 'HELP_CENTER_COLLECTIONS'
29-
| 'CONVERSATION';
24+
type: string; // ARTICLE, CAROUSEL, SURVEY, HELP_CENTER_COLLECTIONS, CONVERSATION
3025
id?: string;
3126
ids?: Array<string>;
3227
}

0 commit comments

Comments
 (0)