Skip to content

Commit 0e74c95

Browse files
Merge pull request #23 from intercom/refactor/android-rn-0-59-support-fixes
Refactor/android rn 0 59 support fixes
2 parents 306834f + 5978bb3 commit 0e74c95

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![Version](https://img.shields.io/npm/v/intercom-react-native.svg)](https://www.npmjs.com/package/intercom-react-native)
44
[![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](https://github.com/intercom/intercom-react-native#readme)
55
[![License: Apache--2.0](https://img.shields.io/badge/License-Apache--2.0-yellow.svg)](https://github.com/intercom/intercom-react-native#readme)
6+
[![CircleCi](https://circleci.com/gh/intercom/intercom-react-native.svg?style=shield)](https://github.com/intercom/intercom-react-native#readme)
67

78
> React Native wrapper to bridge our iOS and Android SDK
89
@@ -56,14 +57,14 @@ $ react-native link @intercom/intercom-react-native
5657
- Add below code to `android/settings.gradle`
5758

5859
```Gradle
59-
include ':intercomreactnative'
60-
project(':intercomreactnative').projectDir = new File(rootProject.projectDir, '../../android')
60+
include ':intercom-react-native'
61+
project(':intercom-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@intercom/intercom-react-native/android')
6162
```
6263

6364
- Then edit `android/app/build.gradle`, inside `dependencies` at very bottom add
6465

6566
```Gradle
66-
implementation project(':intercomreactnative')
67+
implementation project(':intercom-react-native')
6768
```
6869

6970
#### Android: Setup

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
public class IntercomHelpCenterHelpers {
2020

21-
public static ReadableArray parseArticlesToReadableArray(List<HelpCenterArticle> itemArticles) {
21+
public static WritableArray parseArticlesToReadableArray(List<HelpCenterArticle> itemArticles) {
2222
WritableArray articles = Arguments.createArray();
2323

2424
HelpCenterArticle[] articlesArray = new HelpCenterArticle[itemArticles.size()];
@@ -33,7 +33,7 @@ public static ReadableArray parseArticlesToReadableArray(List<HelpCenterArticle>
3333
return articles;
3434
}
3535

36-
public static ReadableArray parseHelpCenterArticleSearchToReadableArray(List<HelpCenterArticleSearchResult> helpCenterArticleSearchResultList) {
36+
public static WritableArray parseHelpCenterArticleSearchToReadableArray(List<HelpCenterArticleSearchResult> helpCenterArticleSearchResultList) {
3737
WritableArray articles = Arguments.createArray();
3838

3939
HelpCenterArticleSearchResult[] articlesArray = new HelpCenterArticleSearchResult[helpCenterArticleSearchResultList.size()];
@@ -50,35 +50,35 @@ public static ReadableArray parseHelpCenterArticleSearchToReadableArray(List<Hel
5050
return articles;
5151
}
5252

53-
public static ReadableMap parseHelpCenterCollectionsContentToReadableMap(HelpCenterCollectionContent helpCenterCollectionContent) {
53+
public static WritableMap parseHelpCenterCollectionsContentToReadableMap(HelpCenterCollectionContent helpCenterCollectionContent) {
5454
WritableMap helpCenterCollection = Arguments.createMap();
5555
helpCenterCollection.putString("id", helpCenterCollectionContent.getCollectionId());
5656
helpCenterCollection.putString("title", helpCenterCollectionContent.getTitle());
5757
helpCenterCollection.putString("summary", helpCenterCollectionContent.getSummary());
5858

59-
ReadableArray articles = parseArticlesToReadableArray(helpCenterCollectionContent.getHelpCenterArticles());
59+
WritableArray articles = parseArticlesToReadableArray(helpCenterCollectionContent.getHelpCenterArticles());
6060
helpCenterCollection.putArray("articles", articles);
6161

62-
ReadableArray sections = parseHelpCenterSectionsToReadableArray(helpCenterCollectionContent.getHelpCenterSections());
62+
WritableArray sections = parseHelpCenterSectionsToReadableArray(helpCenterCollectionContent.getHelpCenterSections());
6363
helpCenterCollection.putArray("sections", sections);
6464

6565

6666
return helpCenterCollection;
6767
}
6868

69-
public static ReadableMap parseHelpCenterSectionToReadableMap(HelpCenterSection helpCenterSection) {
69+
public static WritableMap parseHelpCenterSectionToReadableMap(HelpCenterSection helpCenterSection) {
7070
WritableMap section = Arguments.createMap();
7171
section.putString("title", helpCenterSection.getTitle());
7272

7373

74-
ReadableArray articles = parseArticlesToReadableArray(helpCenterSection.getHelpCenterArticles());
74+
WritableArray articles = parseArticlesToReadableArray(helpCenterSection.getHelpCenterArticles());
7575
section.putArray("articles", articles);
7676

7777

7878
return section;
7979
}
8080

81-
public static ReadableArray parseHelpCenterSectionsToReadableArray(List<HelpCenterSection> helpCenterSectionList) {
81+
public static WritableArray parseHelpCenterSectionsToReadableArray(List<HelpCenterSection> helpCenterSectionList) {
8282
WritableArray sections = Arguments.createArray();
8383

8484
HelpCenterSection[] sectionsArray = new HelpCenterSection[helpCenterSectionList.size()];
@@ -91,7 +91,7 @@ public static ReadableArray parseHelpCenterSectionsToReadableArray(List<HelpCent
9191
return sections;
9292
}
9393

94-
public static ReadableArray parseHelpCenterCollectionsToReadableArray(List<HelpCenterCollection> helpCenterCollections) {
94+
public static WritableArray parseHelpCenterCollectionsToReadableArray(List<HelpCenterCollection> helpCenterCollections) {
9595
HelpCenterCollection[] collectionsArray = new HelpCenterCollection[helpCenterCollections.size()];
9696
collectionsArray = helpCenterCollections.toArray(collectionsArray);
9797
WritableArray collections = Arguments.createArray();

0 commit comments

Comments
 (0)