Skip to content

Commit d791e4b

Browse files
authored
Release 8.0.0 (#229)
* update to version 18.1.0 of ios SDK * update help center APIs
1 parent b6f353e commit d791e4b

File tree

8 files changed

+16
-72
lines changed

8 files changed

+16
-72
lines changed

README.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ Fetch a list of all Collections.
853853
___
854854
### `Intercom.fetchHelpCenterCollection(collectionId)`
855855

856-
Get a list of sections/articles for a collection.
856+
Get a list of subcollections/articles for a collection.
857857

858858
### Options
859859

@@ -1022,11 +1022,6 @@ type HelpCenterArticle = {
10221022
title: string;
10231023
};
10241024

1025-
type HelpCenterSection = {
1026-
name: string;
1027-
articles: HelpCenterArticle;
1028-
};
1029-
10301025
type HelpCenterCollectionItem = {
10311026
id: string;
10321027
title: string;
@@ -1038,7 +1033,7 @@ type HelpCenterCollectionContent = {
10381033
name: string;
10391034
summary: string;
10401035
articles: HelpCenterArticle[];
1041-
sections: HelpCenterSection[];
1036+
collections: HelpCenterCollectionItem[];
10421037
};
10431038

10441039
type HelpCenterArticleSearchResult = {

android/src/main/java/com/intercom/reactnative/IntercomHelpCenterHelpers.java

+2-28
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import io.intercom.android.sdk.helpcenter.collections.HelpCenterCollection;
1515
import io.intercom.android.sdk.helpcenter.sections.HelpCenterArticle;
1616
import io.intercom.android.sdk.helpcenter.sections.HelpCenterCollectionContent;
17-
import io.intercom.android.sdk.helpcenter.sections.HelpCenterSection;
1817

1918
public class IntercomHelpCenterHelpers {
2019

@@ -59,38 +58,13 @@ public static WritableMap parseHelpCenterCollectionsContentToReadableMap(HelpCen
5958
WritableArray articles = parseArticlesToReadableArray(helpCenterCollectionContent.getHelpCenterArticles());
6059
helpCenterCollection.putArray("articles", articles);
6160

62-
WritableArray sections = parseHelpCenterSectionsToReadableArray(helpCenterCollectionContent.getHelpCenterSections());
63-
helpCenterCollection.putArray("sections", sections);
61+
WritableArray collections = parseHelpCenterCollectionsToReadableArray(helpCenterCollectionContent.getSubCollections());
62+
helpCenterCollection.putArray("collections", collections);
6463

6564

6665
return helpCenterCollection;
6766
}
6867

69-
public static WritableMap parseHelpCenterSectionToReadableMap(HelpCenterSection helpCenterSection) {
70-
WritableMap section = Arguments.createMap();
71-
section.putString("title", helpCenterSection.getTitle());
72-
73-
74-
WritableArray articles = parseArticlesToReadableArray(helpCenterSection.getHelpCenterArticles());
75-
section.putArray("articles", articles);
76-
77-
78-
return section;
79-
}
80-
81-
public static WritableArray parseHelpCenterSectionsToReadableArray(List<HelpCenterSection> helpCenterSectionList) {
82-
WritableArray sections = Arguments.createArray();
83-
84-
HelpCenterSection[] sectionsArray = new HelpCenterSection[helpCenterSectionList.size()];
85-
sectionsArray = helpCenterSectionList.toArray(sectionsArray);
86-
;
87-
88-
for (HelpCenterSection section : sectionsArray) {
89-
sections.pushMap(parseHelpCenterSectionToReadableMap(section));
90-
}
91-
return sections;
92-
}
93-
9468
public static WritableArray parseHelpCenterCollectionsToReadableArray(List<HelpCenterCollection> helpCenterCollections) {
9569
HelpCenterCollection[] collectionsArray = new HelpCenterCollection[helpCenterCollections.size()];
9670
collectionsArray = helpCenterCollections.toArray(collectionsArray);

example/ios/IntercomReactNativeExample.xcodeproj/project.pbxproj

+2-13
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
7D95B169267240E3008096E0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1919
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
2020
DE090379E5BDFCC31EBBB1FC /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D19CD0A976BD44CB326047B6 /* PrivacyInfo.xcprivacy */; };
21-
F1076432ED80A4D786051E17 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = EAC2E03D0DF529027F412E05 /* PrivacyInfo.xcprivacy */; };
2221
/* End PBXBuildFile section */
2322

2423
/* Begin PBXFileReference section */
@@ -39,9 +38,7 @@
3938
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 = "<group>"; };
4039
BBBD0C6D5A5B9C44EDCA9EB6 /* libPods-IntercomReactNativeExampleUI.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-IntercomReactNativeExampleUI.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4140
CA3E69C5B9553B26FBA2DF04 /* libPods-IntercomReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-IntercomReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
42-
D19CD0A976BD44CB326047B6 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = IntercomReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
4341
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 = "<group>"; };
44-
EAC2E03D0DF529027F412E05 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = IntercomReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
4542
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
4643
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; };
4744
/* End PBXFileReference section */
@@ -121,7 +118,6 @@
121118
83CBBA001A601CBA00E9B192 /* Products */,
122119
2D16E6871FA4F8E400B85C8A /* Frameworks */,
123120
6B9684456A2045ADE5A6E47E /* Pods */,
124-
EAC2E03D0DF529027F412E05 /* PrivacyInfo.xcprivacy */,
125121
);
126122
indentWidth = 2;
127123
sourceTree = "<group>";
@@ -237,7 +233,6 @@
237233
files = (
238234
7D95B168267240E3008096E0 /* LaunchScreen.storyboard in Resources */,
239235
7D95B169267240E3008096E0 /* Images.xcassets in Resources */,
240-
F1076432ED80A4D786051E17 /* PrivacyInfo.xcprivacy in Resources */,
241236
);
242237
runOnlyForDeploymentPostprocessing = 0;
243238
};
@@ -651,10 +646,7 @@
651646
ONLY_ACTIVE_ARCH = YES;
652647
OTHER_CFLAGS = "$(inherited)";
653648
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
654-
OTHER_LDFLAGS = (
655-
"$(inherited)",
656-
" ",
657-
);
649+
OTHER_LDFLAGS = "$(inherited) ";
658650
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
659651
SDKROOT = iphoneos;
660652
USE_HERMES = false;
@@ -720,10 +712,7 @@
720712
MTL_ENABLE_DEBUG_INFO = NO;
721713
OTHER_CFLAGS = "$(inherited)";
722714
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
723-
OTHER_LDFLAGS = (
724-
"$(inherited)",
725-
" ",
726-
);
715+
OTHER_LDFLAGS = "$(inherited) ";
727716
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
728717
SDKROOT = iphoneos;
729718
USE_HERMES = false;

example/ios/Podfile.lock

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ PODS:
1111
- ReactCommon/turbomodule/core (= 0.73.8)
1212
- fmt (6.2.1)
1313
- glog (0.3.5)
14-
- Intercom (17.2.1)
15-
- intercom-react-native (7.2.0):
16-
- Intercom (~> 17.2.1)
14+
- Intercom (18.1.0)
15+
- intercom-react-native (8.0.0):
16+
- Intercom (~> 18.1.0)
1717
- React-Core
1818
- RCT-Folly (2022.05.16.00):
1919
- boost
@@ -1192,13 +1192,13 @@ EXTERNAL SOURCES:
11921192

11931193
SPEC CHECKSUMS:
11941194
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
1195-
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
1195+
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
11961196
FBLazyVector: df34a309e356a77581809834f6ec3fbe7153f620
11971197
FBReactNativeSpec: bbe8b686178e5ce03d1d8a356789f211f91f31b8
11981198
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
1199-
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
1200-
Intercom: 3e9e26c8e2d0655e8f7527c395e570bb7733d5fa
1201-
intercom-react-native: 317a729e085695938ba74b8abab7f70ddfe4d4b4
1199+
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
1200+
Intercom: b3a7282d46c7a670d805b70430cb929d9473ddb1
1201+
intercom-react-native: f4e484301273c2a2ff7c1839eb3c9c2da1c0aa26
12021202
RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0
12031203
RCTRequired: 0c7f03a41ee32dec802c74c341e317a4165973d5
12041204
RCTTypeSafety: 57698bb7fcde424922e201dab377f496a08a63e3

intercom-react-native.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ Pod::Spec.new do |s|
1818
s.resource_bundles = { 'IntercomFramework' => ['ios/assets/*'] }
1919

2020
s.dependency "React-Core"
21-
s.dependency "Intercom", '~> 17.2.2'
21+
s.dependency "Intercom", '~> 18.1.0'
2222
end

ios/IntercomHelpCenterHelpers.h

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
+ (NSMutableArray<NSMutableDictionary *> *)parseCollectionsToArray:(NSArray<ICMHelpCenterCollection *> *)collections;
66
+ (NSMutableArray<NSMutableDictionary *> *)parseArticlesToArray:(NSArray<ICMHelpCenterArticle *> *)articlesArray;
77
+ (NSMutableDictionary *)parseHelpCenterCollectionToDictionary:(ICMHelpCenterCollectionContent *)collectionContent;
8-
+ (NSMutableArray<NSMutableDictionary *> *)parseHelpCenterSectionsToDictionary:(NSArray<ICMHelpCenterSection *> *)sectionArray;
98
+ (NSMutableArray<NSMutableDictionary *> *)parseHelpCenterArticleSearchResultToArray:(NSArray<ICMHelpCenterArticleSearchResult *>*)articleArray;
109

1110
@end

ios/IntercomHelpCenterHelpers.m

+1-14
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,11 @@ + (NSMutableDictionary *)parseHelpCenterCollectionToDictionary:(ICMHelpCenterCol
3636
[item setValue:[collectionContent title] forKey:@"title"];
3737
[item setValue:[collectionContent summary] forKey:@"summary"];
3838
[item setValue:[self parseArticlesToArray:[collectionContent articles]] forKey:@"articles"];
39-
[item setValue:[self parseHelpCenterSectionsToDictionary:[collectionContent sections]] forKey:@"sections"];
39+
[item setValue:[self parseCollectionsToArray:[collectionContent collections]] forKey:@"collections"];
4040

4141
return item;
4242
}
4343

44-
+ (NSMutableArray<NSMutableDictionary *> *)parseHelpCenterSectionsToDictionary:(NSArray<ICMHelpCenterSection *> *)sectionArray {
45-
46-
NSMutableArray *parsedSections = [NSMutableArray arrayWithCapacity:[sectionArray count]];
47-
for (ICMHelpCenterSection *sectionObject in sectionArray) {
48-
NSMutableDictionary *sectionItem = [NSMutableDictionary dictionary];
49-
[sectionItem setValue:[sectionObject title] forKey:@"title"];
50-
[sectionItem setValue:[self parseArticlesToArray:[sectionObject articles]] forKey:@"articles"];
51-
[parsedSections addObject:sectionItem];
52-
}
53-
54-
return parsedSections;
55-
}
56-
5744
+ (NSMutableArray<NSMutableDictionary *> *)parseHelpCenterArticleSearchResultToArray:(NSArray<ICMHelpCenterArticleSearchResult *>*)articleArray {
5845

5946
NSMutableArray *parsedArticles = [NSMutableArray arrayWithCapacity:[articleArray count]];

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@intercom/intercom-react-native",
3-
"version": "7.2.1",
3+
"version": "8.0.0",
44
"description": "React Native wrapper to bridge our iOS and Android SDK",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)