From 3de42032108722e56e314e9e8aa02d362c503c51 Mon Sep 17 00:00:00 2001 From: Katherine P Brennan Date: Wed, 2 Oct 2024 14:11:26 +0100 Subject: [PATCH 1/2] update to version 18.1.0 of ios SDK --- example/ios/Podfile.lock | 14 +++++++------- intercom-react-native.podspec | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 96474dd..f13c658 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -11,9 +11,9 @@ PODS: - ReactCommon/turbomodule/core (= 0.73.8) - fmt (6.2.1) - glog (0.3.5) - - Intercom (17.2.1) - - intercom-react-native (7.2.0): - - Intercom (~> 17.2.1) + - Intercom (18.1.0) + - intercom-react-native (8.0.0): + - Intercom (~> 18.1.0) - React-Core - RCT-Folly (2022.05.16.00): - boost @@ -1192,13 +1192,13 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: d3f49c53809116a5d38da093a8aa78bf551aed09 - DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953 + DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 FBLazyVector: df34a309e356a77581809834f6ec3fbe7153f620 FBReactNativeSpec: bbe8b686178e5ce03d1d8a356789f211f91f31b8 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 - Intercom: 3e9e26c8e2d0655e8f7527c395e570bb7733d5fa - intercom-react-native: 317a729e085695938ba74b8abab7f70ddfe4d4b4 + glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b + Intercom: b3a7282d46c7a670d805b70430cb929d9473ddb1 + intercom-react-native: f4e484301273c2a2ff7c1839eb3c9c2da1c0aa26 RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0 RCTRequired: 0c7f03a41ee32dec802c74c341e317a4165973d5 RCTTypeSafety: 57698bb7fcde424922e201dab377f496a08a63e3 diff --git a/intercom-react-native.podspec b/intercom-react-native.podspec index 78d8be7..d970a01 100644 --- a/intercom-react-native.podspec +++ b/intercom-react-native.podspec @@ -18,5 +18,5 @@ Pod::Spec.new do |s| s.resource_bundles = { 'IntercomFramework' => ['ios/assets/*'] } s.dependency "React-Core" - s.dependency "Intercom", '~> 17.2.2' + s.dependency "Intercom", '~> 18.1.0' end diff --git a/package.json b/package.json index 976710d..92b8ea0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@intercom/intercom-react-native", - "version": "7.2.1", + "version": "8.0.0", "description": "React Native wrapper to bridge our iOS and Android SDK", "main": "lib/commonjs/index", "module": "lib/module/index", From 4ed2eeecd1ab8f088bd7dac500c380cd659f0802 Mon Sep 17 00:00:00 2001 From: Katherine P Brennan Date: Wed, 2 Oct 2024 15:45:25 +0100 Subject: [PATCH 2/2] update help center APIs --- README.md | 9 ++---- .../IntercomHelpCenterHelpers.java | 30 ++----------------- .../project.pbxproj | 15 ++-------- ios/IntercomHelpCenterHelpers.h | 1 - ios/IntercomHelpCenterHelpers.m | 15 +--------- 5 files changed, 7 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 7693bcf..e1cdf21 100644 --- a/README.md +++ b/README.md @@ -853,7 +853,7 @@ Fetch a list of all Collections. ___ ### `Intercom.fetchHelpCenterCollection(collectionId)` -Get a list of sections/articles for a collection. +Get a list of subcollections/articles for a collection. ### Options @@ -1022,11 +1022,6 @@ type HelpCenterArticle = { title: string; }; -type HelpCenterSection = { - name: string; - articles: HelpCenterArticle; -}; - type HelpCenterCollectionItem = { id: string; title: string; @@ -1038,7 +1033,7 @@ type HelpCenterCollectionContent = { name: string; summary: string; articles: HelpCenterArticle[]; - sections: HelpCenterSection[]; + collections: HelpCenterCollectionItem[]; }; type HelpCenterArticleSearchResult = { diff --git a/android/src/main/java/com/intercom/reactnative/IntercomHelpCenterHelpers.java b/android/src/main/java/com/intercom/reactnative/IntercomHelpCenterHelpers.java index 6dc8c28..834683c 100644 --- a/android/src/main/java/com/intercom/reactnative/IntercomHelpCenterHelpers.java +++ b/android/src/main/java/com/intercom/reactnative/IntercomHelpCenterHelpers.java @@ -14,7 +14,6 @@ import io.intercom.android.sdk.helpcenter.collections.HelpCenterCollection; import io.intercom.android.sdk.helpcenter.sections.HelpCenterArticle; import io.intercom.android.sdk.helpcenter.sections.HelpCenterCollectionContent; -import io.intercom.android.sdk.helpcenter.sections.HelpCenterSection; public class IntercomHelpCenterHelpers { @@ -59,38 +58,13 @@ public static WritableMap parseHelpCenterCollectionsContentToReadableMap(HelpCen WritableArray articles = parseArticlesToReadableArray(helpCenterCollectionContent.getHelpCenterArticles()); helpCenterCollection.putArray("articles", articles); - WritableArray sections = parseHelpCenterSectionsToReadableArray(helpCenterCollectionContent.getHelpCenterSections()); - helpCenterCollection.putArray("sections", sections); + WritableArray collections = parseHelpCenterCollectionsToReadableArray(helpCenterCollectionContent.getSubCollections()); + helpCenterCollection.putArray("collections", collections); return helpCenterCollection; } - public static WritableMap parseHelpCenterSectionToReadableMap(HelpCenterSection helpCenterSection) { - WritableMap section = Arguments.createMap(); - section.putString("title", helpCenterSection.getTitle()); - - - WritableArray articles = parseArticlesToReadableArray(helpCenterSection.getHelpCenterArticles()); - section.putArray("articles", articles); - - - return section; - } - - public static WritableArray parseHelpCenterSectionsToReadableArray(List helpCenterSectionList) { - WritableArray sections = Arguments.createArray(); - - HelpCenterSection[] sectionsArray = new HelpCenterSection[helpCenterSectionList.size()]; - sectionsArray = helpCenterSectionList.toArray(sectionsArray); - ; - - for (HelpCenterSection section : sectionsArray) { - sections.pushMap(parseHelpCenterSectionToReadableMap(section)); - } - return sections; - } - public static WritableArray parseHelpCenterCollectionsToReadableArray(List helpCenterCollections) { HelpCenterCollection[] collectionsArray = new HelpCenterCollection[helpCenterCollections.size()]; collectionsArray = helpCenterCollections.toArray(collectionsArray); diff --git a/example/ios/IntercomReactNativeExample.xcodeproj/project.pbxproj b/example/ios/IntercomReactNativeExample.xcodeproj/project.pbxproj index 6dd6247..62dd41e 100644 --- a/example/ios/IntercomReactNativeExample.xcodeproj/project.pbxproj +++ b/example/ios/IntercomReactNativeExample.xcodeproj/project.pbxproj @@ -18,7 +18,6 @@ 7D95B169267240E3008096E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; DE090379E5BDFCC31EBBB1FC /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D19CD0A976BD44CB326047B6 /* PrivacyInfo.xcprivacy */; }; - F1076432ED80A4D786051E17 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = EAC2E03D0DF529027F412E05 /* PrivacyInfo.xcprivacy */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -39,9 +38,7 @@ A85ABA48189A5CFD1A074287 /* Pods-IntercomReactNativeExampleUI.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IntercomReactNativeExampleUI.debug.xcconfig"; path = "Target Support Files/Pods-IntercomReactNativeExampleUI/Pods-IntercomReactNativeExampleUI.debug.xcconfig"; sourceTree = ""; }; BBBD0C6D5A5B9C44EDCA9EB6 /* libPods-IntercomReactNativeExampleUI.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-IntercomReactNativeExampleUI.a"; sourceTree = BUILT_PRODUCTS_DIR; }; CA3E69C5B9553B26FBA2DF04 /* libPods-IntercomReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-IntercomReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - D19CD0A976BD44CB326047B6 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = IntercomReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; E95549C9E2FCB27F79DD3B37 /* Pods-IntercomReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IntercomReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-IntercomReactNativeExample/Pods-IntercomReactNativeExample.debug.xcconfig"; sourceTree = ""; }; - EAC2E03D0DF529027F412E05 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = IntercomReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; /* End PBXFileReference section */ @@ -121,7 +118,6 @@ 83CBBA001A601CBA00E9B192 /* Products */, 2D16E6871FA4F8E400B85C8A /* Frameworks */, 6B9684456A2045ADE5A6E47E /* Pods */, - EAC2E03D0DF529027F412E05 /* PrivacyInfo.xcprivacy */, ); indentWidth = 2; sourceTree = ""; @@ -237,7 +233,6 @@ files = ( 7D95B168267240E3008096E0 /* LaunchScreen.storyboard in Resources */, 7D95B169267240E3008096E0 /* Images.xcassets in Resources */, - F1076432ED80A4D786051E17 /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -651,10 +646,7 @@ ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "$(inherited)"; OTHER_CPLUSPLUSFLAGS = "$(inherited)"; - OTHER_LDFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_LDFLAGS = "$(inherited) "; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = false; @@ -720,10 +712,7 @@ MTL_ENABLE_DEBUG_INFO = NO; OTHER_CFLAGS = "$(inherited)"; OTHER_CPLUSPLUSFLAGS = "$(inherited)"; - OTHER_LDFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_LDFLAGS = "$(inherited) "; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = false; diff --git a/ios/IntercomHelpCenterHelpers.h b/ios/IntercomHelpCenterHelpers.h index cc79658..d8ef325 100644 --- a/ios/IntercomHelpCenterHelpers.h +++ b/ios/IntercomHelpCenterHelpers.h @@ -5,7 +5,6 @@ + (NSMutableArray *)parseCollectionsToArray:(NSArray *)collections; + (NSMutableArray *)parseArticlesToArray:(NSArray *)articlesArray; + (NSMutableDictionary *)parseHelpCenterCollectionToDictionary:(ICMHelpCenterCollectionContent *)collectionContent; -+ (NSMutableArray *)parseHelpCenterSectionsToDictionary:(NSArray *)sectionArray; + (NSMutableArray *)parseHelpCenterArticleSearchResultToArray:(NSArray*)articleArray; @end diff --git a/ios/IntercomHelpCenterHelpers.m b/ios/IntercomHelpCenterHelpers.m index 01e2f70..f60e845 100644 --- a/ios/IntercomHelpCenterHelpers.m +++ b/ios/IntercomHelpCenterHelpers.m @@ -36,24 +36,11 @@ + (NSMutableDictionary *)parseHelpCenterCollectionToDictionary:(ICMHelpCenterCol [item setValue:[collectionContent title] forKey:@"title"]; [item setValue:[collectionContent summary] forKey:@"summary"]; [item setValue:[self parseArticlesToArray:[collectionContent articles]] forKey:@"articles"]; - [item setValue:[self parseHelpCenterSectionsToDictionary:[collectionContent sections]] forKey:@"sections"]; + [item setValue:[self parseCollectionsToArray:[collectionContent collections]] forKey:@"collections"]; return item; } -+ (NSMutableArray *)parseHelpCenterSectionsToDictionary:(NSArray *)sectionArray { - - NSMutableArray *parsedSections = [NSMutableArray arrayWithCapacity:[sectionArray count]]; - for (ICMHelpCenterSection *sectionObject in sectionArray) { - NSMutableDictionary *sectionItem = [NSMutableDictionary dictionary]; - [sectionItem setValue:[sectionObject title] forKey:@"title"]; - [sectionItem setValue:[self parseArticlesToArray:[sectionObject articles]] forKey:@"articles"]; - [parsedSections addObject:sectionItem]; - } - - return parsedSections; -} - + (NSMutableArray *)parseHelpCenterArticleSearchResultToArray:(NSArray*)articleArray { NSMutableArray *parsedArticles = [NSMutableArray arrayWithCapacity:[articleArray count]];