Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 8.0.0 #229

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -1022,11 +1022,6 @@ type HelpCenterArticle = {
title: string;
};

type HelpCenterSection = {
name: string;
articles: HelpCenterArticle;
};

type HelpCenterCollectionItem = {
id: string;
title: string;
Expand All @@ -1038,7 +1033,7 @@ type HelpCenterCollectionContent = {
name: string;
summary: string;
articles: HelpCenterArticle[];
sections: HelpCenterSection[];
collections: HelpCenterCollectionItem[];
};

type HelpCenterArticleSearchResult = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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<HelpCenterSection> 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<HelpCenterCollection> helpCenterCollections) {
HelpCenterCollection[] collectionsArray = new HelpCenterCollection[helpCenterCollections.size()];
collectionsArray = helpCenterCollections.toArray(collectionsArray);
Expand Down
15 changes: 2 additions & 13 deletions example/ios/IntercomReactNativeExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 = "<group>"; };
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 = "<group>"; };
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>"; };
EAC2E03D0DF529027F412E05 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = IntercomReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
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 */
Expand Down Expand Up @@ -121,7 +118,6 @@
83CBBA001A601CBA00E9B192 /* Products */,
2D16E6871FA4F8E400B85C8A /* Frameworks */,
6B9684456A2045ADE5A6E47E /* Pods */,
EAC2E03D0DF529027F412E05 /* PrivacyInfo.xcprivacy */,
);
indentWidth = 2;
sourceTree = "<group>";
Expand Down Expand Up @@ -237,7 +233,6 @@
files = (
7D95B168267240E3008096E0 /* LaunchScreen.storyboard in Resources */,
7D95B169267240E3008096E0 /* Images.xcassets in Resources */,
F1076432ED80A4D786051E17 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion intercom-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion ios/IntercomHelpCenterHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
+ (NSMutableArray<NSMutableDictionary *> *)parseCollectionsToArray:(NSArray<ICMHelpCenterCollection *> *)collections;
+ (NSMutableArray<NSMutableDictionary *> *)parseArticlesToArray:(NSArray<ICMHelpCenterArticle *> *)articlesArray;
+ (NSMutableDictionary *)parseHelpCenterCollectionToDictionary:(ICMHelpCenterCollectionContent *)collectionContent;
+ (NSMutableArray<NSMutableDictionary *> *)parseHelpCenterSectionsToDictionary:(NSArray<ICMHelpCenterSection *> *)sectionArray;
+ (NSMutableArray<NSMutableDictionary *> *)parseHelpCenterArticleSearchResultToArray:(NSArray<ICMHelpCenterArticleSearchResult *>*)articleArray;

@end
15 changes: 1 addition & 14 deletions ios/IntercomHelpCenterHelpers.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSMutableDictionary *> *)parseHelpCenterSectionsToDictionary:(NSArray<ICMHelpCenterSection *> *)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<NSMutableDictionary *> *)parseHelpCenterArticleSearchResultToArray:(NSArray<ICMHelpCenterArticleSearchResult *>*)articleArray {

NSMutableArray *parsedArticles = [NSMutableArray arrayWithCapacity:[articleArray count]];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down