From ddfcff0571dc1c3ae67302a2eb5d92803bba1cb4 Mon Sep 17 00:00:00 2001 From: Jason Praful Date: Wed, 10 Sep 2025 16:55:55 +0100 Subject: [PATCH] fix: resolve React Native codegen compatibility issues - Replace union types with Object to fix "union types are unsupported in structs" error - Update IntercomReactNativeSpec.h import path for New Architecture --- ios/IntercomModule.h | 2 +- package.json | 2 +- src/NativeIntercomSpec.ts | 11 +++-------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ios/IntercomModule.h b/ios/IntercomModule.h index 507a4f01..2cc6860d 100644 --- a/ios/IntercomModule.h +++ b/ios/IntercomModule.h @@ -1,7 +1,7 @@ #import #ifdef RCT_NEW_ARCH_ENABLED -#import "IntercomReactNativeSpec.h" +#import @interface IntercomModule : NSObject #else @interface IntercomModule : NSObject diff --git a/package.json b/package.json index 60f319a6..6ecccbb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@intercom/intercom-react-native", - "version": "9.0.2", + "version": "9.0.3", "description": "React Native wrapper to bridge our iOS and Android SDK", "source": "./src/index.tsx", "main": "./lib/commonjs/index.js", diff --git a/src/NativeIntercomSpec.ts b/src/NativeIntercomSpec.ts index c773e10d..dcd6b799 100644 --- a/src/NativeIntercomSpec.ts +++ b/src/NativeIntercomSpec.ts @@ -4,13 +4,13 @@ import { TurboModuleRegistry } from 'react-native'; export interface UserAttributes { companies?: Array<{ createdAt?: number; - customAttributes?: { [key: string]: boolean | string | number }; + customAttributes?: Object; // { [key: string]: boolean | string | number }; id: string; monthlySpend?: number; name?: string; plan?: string; }>; - customAttributes?: { [key: string]: boolean | string | number }; + customAttributes?: Object; // { [key: string]: boolean | string | number }; email?: string; languageOverride?: string; name?: string; @@ -21,12 +21,7 @@ export interface UserAttributes { } interface TurboModuleContent { - type: - | 'ARTICLE' - | 'CAROUSEL' - | 'SURVEY' - | 'HELP_CENTER_COLLECTIONS' - | 'CONVERSATION'; + type: string; // ARTICLE, CAROUSEL, SURVEY, HELP_CENTER_COLLECTIONS, CONVERSATION id?: string; ids?: Array; }