From bca88e6c0f106582e0e30312e8378cab45afa5a3 Mon Sep 17 00:00:00 2001 From: Mitchell Date: Mon, 11 Oct 2021 23:01:40 +0200 Subject: [PATCH 001/330] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99c2366c..32a81388 100644 --- a/README.md +++ b/README.md @@ -347,7 +347,7 @@ Notifications.events().registerRemoteNotificationsRegistered(({ deviceToken }: R #import ``` -- Request notification permissions when app launches by adding the folloowing to `didFinishLaunchingWithOptions` before `return YES;`: +- Request notification permissions when app launches by adding the following to `didFinishLaunchingWithOptions` before `return YES;`: ```Objective-C - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions From 91d30250aa38c21e13f2b691adeeef428ddeefc8 Mon Sep 17 00:00:00 2001 From: Mitchell Date: Wed, 13 Oct 2021 08:11:25 +0200 Subject: [PATCH 002/330] docs: update path of files (android) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32a81388..11b76504 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ implementation project(':intercom-react-native') #### Android: Setup -- Add below lines to `MainApplication.java` inside `onCreate` method, replacing `apiKey` and `appId` which can be found in your [workspace settings](https://app.intercom.com/a/apps/_/settings/android). +- Add below lines to `android/app/src/main/java/com/YOUR_APP/app/MainApplication.java` inside `onCreate` method, replacing `apiKey` and `appId` which can be found in your [workspace settings](https://app.intercom.com/a/apps/_/settings/android). ```java import com.intercom.reactnative.IntercomModule; // <-- Add this line @@ -115,7 +115,7 @@ dependencies { #### Android: Permissions -You will need to include the [READ\_EXTERNAL\_STORAGE](http://developer.android.com/reference/android/Manifest.permission.html#READ_EXTERNAL_STORAGE) permission if you have enabled attachments: +You will need to include the [READ\_EXTERNAL\_STORAGE](http://developer.android.com/reference/android/Manifest.permission.html#READ_EXTERNAL_STORAGE) permission in `android/app/src/main/AndroidManifest.xml` if you have enabled attachments: ```xml From 756fb1d50eb5ec3d4b8480a3b362bfc3ed33af92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Tue, 30 Nov 2021 17:37:15 +0100 Subject: [PATCH 003/330] Allows specifying firebase messaging version --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 576b70c4..f4650e61 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -59,6 +59,6 @@ repositories { dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules - implementation 'com.google.firebase:firebase-messaging:20.2.+' + implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '20.2.+')}" implementation 'io.intercom.android:intercom-sdk:10.3.+' } From 2afdd95d6e2a43d302a7ec0e7f862b1dbcaa60b7 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Fri, 7 Jan 2022 17:24:12 -0500 Subject: [PATCH 004/330] Add ReactModule annotation to IntercomEventEmitter This will be needed in order to support the new TurboModules system. --- .../java/com/intercom/reactnative/IntercomEventEmitter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/intercom/reactnative/IntercomEventEmitter.java b/android/src/main/java/com/intercom/reactnative/IntercomEventEmitter.java index f0ab75a8..cdfa720a 100644 --- a/android/src/main/java/com/intercom/reactnative/IntercomEventEmitter.java +++ b/android/src/main/java/com/intercom/reactnative/IntercomEventEmitter.java @@ -7,6 +7,7 @@ import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.WritableMap; +import com.facebook.react.module.annotations.ReactModule; import com.facebook.react.modules.core.DeviceEventManagerModule; import javax.annotation.Nullable; @@ -17,9 +18,10 @@ import io.intercom.android.sdk.Intercom; import io.intercom.android.sdk.UnreadConversationCountListener; +@ReactModule(name = IntercomEventEmitter.NAME) public class IntercomEventEmitter extends ReactContextBaseJavaModule { - private static final String NAME = "IntercomEventEmitter"; + public static final String NAME = "IntercomEventEmitter"; private static final String UNREAD_COUNT_CHANGE_NOTIFICATION = "IntercomUnreadCountDidChange"; private int activeListenersCount = 0; private final UnreadConversationCountListener unreadConversationCountListener = new UnreadConversationCountListener() { From dc5c2ceb48dbc140a7cf9d83bac88bd6104b4d06 Mon Sep 17 00:00:00 2001 From: Pedro Pessoa Date: Wed, 12 Jan 2022 21:28:26 +0200 Subject: [PATCH 005/330] docs(troubleshooting): mock lib with jest --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 99c2366c..57022422 100644 --- a/README.md +++ b/README.md @@ -897,6 +897,14 @@ ___ implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha03' ``` + +- #### When tests with Jest fail mentioning "Cannot read property 'UNREAD_CHANGE_NOTIFICATION' of undefined" + - Make a `jest.mock` function with the library: + ``` + // jest/setup.ts + jest.mock('@intercom/intercom-react-native', () => jest.fn()); + ``` + ___ ## Author From 1d3a7d88a3a2f6aece9be55f8a9e0246b9e88414 Mon Sep 17 00:00:00 2001 From: Enrico Marugliano Date: Thu, 17 Feb 2022 12:44:11 +0000 Subject: [PATCH 006/330] Add FOSSA workflow to enable license scanning --- .github/workflows/fossa-license-scan.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/fossa-license-scan.yml diff --git a/.github/workflows/fossa-license-scan.yml b/.github/workflows/fossa-license-scan.yml new file mode 100644 index 00000000..26383465 --- /dev/null +++ b/.github/workflows/fossa-license-scan.yml @@ -0,0 +1,24 @@ +# More information on this workflow can be found here: https://stackoverflow.com/c/intercom/questions/1270 + +name: FOSSA License Scan + +on: + push: + branches: + - main + +jobs: + fossa: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Attempt build + uses: intercom/attempt-build-action@main + continue-on-error: true + - name: Run FOSSA + uses: intercom/fossa-action@main + with: + fossa-api-key: ${{ secrets.FOSSA_API_KEY }} + fossa-event-receiver-token: ${{ secrets.FOSSA_EVENT_RECEIVER_TOKEN }} + datadog-api-key: ${{ secrets.DATADOG_API_KEY }} From eef6edbf5c3258ec09e77e216642e668984f254b Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Fri, 18 Feb 2022 13:49:43 +0100 Subject: [PATCH 007/330] Update Android dependancies and release --- android/build.gradle | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 576b70c4..70207ea3 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -60,5 +60,5 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation 'com.google.firebase:firebase-messaging:20.2.+' - implementation 'io.intercom.android:intercom-sdk:10.3.+' + implementation 'io.intercom.android:intercom-sdk:10.6.+' } diff --git a/package.json b/package.json index 2669fb19..cdd74e8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@intercom/intercom-react-native", - "version": "2.0.2", + "version": "2.0.3", "description": "React Native wrapper to bridge our iOS and Android SDK", "main": "lib/commonjs/index", "module": "lib/module/index", From f6533e6b4b0f98dab1f42fc4c6de24640274ff76 Mon Sep 17 00:00:00 2001 From: prithivraj Date: Tue, 8 Mar 2022 10:46:23 +0000 Subject: [PATCH 008/330] Release 2.0.4 --- android/build.gradle | 2 +- example/ios/Podfile.lock | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 70207ea3..590be864 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -60,5 +60,5 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation 'com.google.firebase:firebase-messaging:20.2.+' - implementation 'io.intercom.android:intercom-sdk:10.6.+' + implementation 'io.intercom.android:intercom-sdk:10.6.2' } diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 331bf3cc..308d798e 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -73,7 +73,7 @@ PODS: - fmt (6.2.1) - glog (0.3.5) - Intercom (11.1.2) - - intercom-react-native (2.0.2): + - intercom-react-native (2.0.4): - Intercom (~> 11.1.2) - React-Core - libevent (2.1.12) diff --git a/package.json b/package.json index cdd74e8d..bc4d2857 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@intercom/intercom-react-native", - "version": "2.0.3", + "version": "2.0.4", "description": "React Native wrapper to bridge our iOS and Android SDK", "main": "lib/commonjs/index", "module": "lib/module/index", From 6e33e2cb9c9deda9946c2240aac79853581d7f91 Mon Sep 17 00:00:00 2001 From: prithivraj Date: Tue, 8 Mar 2022 12:16:06 +0000 Subject: [PATCH 009/330] Commented flaky test --- example/e2e/tests/mainIntercom.e2e.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/e2e/tests/mainIntercom.e2e.ts b/example/e2e/tests/mainIntercom.e2e.ts index 0a76bb3f..bc716a4d 100644 --- a/example/e2e/tests/mainIntercom.e2e.ts +++ b/example/e2e/tests/mainIntercom.e2e.ts @@ -135,9 +135,9 @@ describe('Intercom E2E', () => { await (await $('~authenticated')).waitForDisplayed({ timeout: 12000 }); }); - it('Should set logout ', async () => { + /* it('Should set logout ', async () => { await driver.scrollToElementByAccessibilityLabel('logout'); await (await $('~logout')).click(); await (await $('~unauthenticated')).waitForDisplayed({ timeout: 12000 }); - }); + }); */ }); From ecd2bd1911b22f57b0fd2154765265cd9ebb5477 Mon Sep 17 00:00:00 2001 From: niamh-coleman <92738247+niamh-coleman@users.noreply.github.com> Date: Fri, 4 Mar 2022 15:57:25 +0000 Subject: [PATCH 010/330] Release 2.1.0 --- example/ios/Podfile.lock | 10 +++++----- intercom-react-native.podspec | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 308d798e..aa5eee8d 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -72,9 +72,9 @@ PODS: - FlipperKit/FlipperKitNetworkPlugin - fmt (6.2.1) - glog (0.3.5) - - Intercom (11.1.2) - - intercom-react-native (2.0.4): - - Intercom (~> 11.1.2) + - Intercom (11.2.0) + - intercom-react-native (2.1.0): + - Intercom (~> 11.2.0) - React-Core - libevent (2.1.12) - OpenSSL-Universal (1.1.180) @@ -503,8 +503,8 @@ SPEC CHECKSUMS: FlipperKit: aec2d931adeee48a07bab1ea8bcc8a6bb87dfce4 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: 5337263514dd6f09803962437687240c5dc39aa4 - Intercom: 4137504754b8b082e45eda16b3e85d5c3d25dc73 - intercom-react-native: 65d984d37d28f19ba6702b616830cdf2bba9295a + Intercom: d17f915e5b840e4c5d9f55e4b7487358469463f9 + intercom-react-native: 448795b154c83c180bace4f8201d85fc7e727ae6 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b RCT-Folly: 0dd9e1eb86348ecab5ba76f910b56f4b5fef3c46 diff --git a/intercom-react-native.podspec b/intercom-react-native.podspec index ab7634f4..4e3719e7 100644 --- a/intercom-react-native.podspec +++ b/intercom-react-native.podspec @@ -17,5 +17,5 @@ Pod::Spec.new do |s| s.resource_bundles = { 'IntercomFramework' => ['ios/assets/*'] } s.dependency "React-Core" - s.dependency "Intercom", '~> 11.1.2' + s.dependency "Intercom", '~> 11.2.0' end From ecac9bc87717944273d19221470fee1eb58ee966 Mon Sep 17 00:00:00 2001 From: niamh-coleman <92738247+niamh-coleman@users.noreply.github.com> Date: Mon, 7 Mar 2022 14:18:36 +0000 Subject: [PATCH 011/330] Updating the UI tests to use the new modal close button where needed --- example/e2e/helpers.ts | 12 +++++++++++- example/e2e/tests/mainIntercom.e2e.ts | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/example/e2e/helpers.ts b/example/e2e/helpers.ts index 6de37da4..f38a1cba 100644 --- a/example/e2e/helpers.ts +++ b/example/e2e/helpers.ts @@ -45,7 +45,17 @@ const closeOverlay = async (customCloseButtonId?: string) => { await closeButton.waitForDisplayed({ timeout: 22000 }); await closeButton.click(); }; + +const closeModalOverlay = async (customCloseButtonId?: string) => { + const buttonId = browser.isAndroid ? `~Close` : customCloseButtonId || `~intercom modal close button`; + + const closeButton = await $(buttonId); + await closeButton.waitForDisplayed({ timeout: 22000 }); + await closeButton.click(); +}; + browser.addCommand('closeOverlay', closeOverlay); +browser.addCommand('closeModalOverlay', closeModalOverlay); const closeArticleOverlay = async () => { if (browser.isAndroid) { @@ -55,7 +65,7 @@ const closeArticleOverlay = async () => { await closeButton.waitForDisplayed({ timeout: 22000 }); await closeButton.click(); } else { - await closeOverlay(); + await closeModalOverlay(); } }; browser.addCommand('closeArticleOverlay', closeArticleOverlay); diff --git a/example/e2e/tests/mainIntercom.e2e.ts b/example/e2e/tests/mainIntercom.e2e.ts index bc716a4d..dc9190e0 100644 --- a/example/e2e/tests/mainIntercom.e2e.ts +++ b/example/e2e/tests/mainIntercom.e2e.ts @@ -70,7 +70,7 @@ describe('Intercom E2E', () => { it('Should display carousel', async () => { await driver.scrollToElementByAccessibilityLabel('display-carousel'); await (await $('~display-carousel')).click(); - await driver.closeOverlay(); + await driver.closeModalOverlay(); }); it('Should get unread messages count', async () => { From 01bbbfb6245b5c238846bdc9446697b168a91d79 Mon Sep 17 00:00:00 2001 From: prithivraj Date: Tue, 8 Mar 2022 14:13:34 +0000 Subject: [PATCH 012/330] Release 2.1.0 --- android/build.gradle | 2 +- example/android/app/src/main/AndroidManifest.xml | 1 + example/android/build.gradle | 4 ++-- package.json | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 590be864..170f4ebd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -60,5 +60,5 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation 'com.google.firebase:firebase-messaging:20.2.+' - implementation 'io.intercom.android:intercom-sdk:10.6.2' + implementation 'io.intercom.android:intercom-sdk:10.7.0' } diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index e91389a4..bda576af 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -14,6 +14,7 @@ diff --git a/example/android/build.gradle b/example/android/build.gradle index 3973ccbf..45570538 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -7,8 +7,8 @@ buildscript { ext { buildToolsVersion = "30.0.2" minSdkVersion = 21 - compileSdkVersion = 30 - targetSdkVersion = 30 + compileSdkVersion = 31 + targetSdkVersion = 31 ndkVersion = "20.1.5948944" } repositories { diff --git a/package.json b/package.json index bc4d2857..4b3b6ce2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@intercom/intercom-react-native", - "version": "2.0.4", + "version": "2.1.0", "description": "React Native wrapper to bridge our iOS and Android SDK", "main": "lib/commonjs/index", "module": "lib/module/index", From f0b72a5e0af9286d3838b624158cac6332a3083c Mon Sep 17 00:00:00 2001 From: prithivraj Date: Tue, 8 Mar 2022 15:15:20 +0000 Subject: [PATCH 013/330] Updated README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2371bf7b..e6d95a1d 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ public void onCreate() { } ``` -- Open `android/build.gradle` and change `minSdkVersion` to **21** +- Open `android/build.gradle` and change `minSdkVersion` to **21**, `compileSdkVersion` and `targetSdkVersion` to at least **31** ```Gradle buildscript { @@ -97,8 +97,8 @@ buildscript { ext { buildToolsVersion = "29.0.2" minSdkVersion = 21 // <-- Here - compileSdkVersion = 29 - targetSdkVersion = 29 + compileSdkVersion = 31 // <-- Here + targetSdkVersion = 31 // <-- Here } // ... } From f213eddbb51783c030326488b49d22da949131a8 Mon Sep 17 00:00:00 2001 From: Katherine Brennan Date: Tue, 29 Mar 2022 12:28:23 +0100 Subject: [PATCH 014/330] update to use version 12.0.0 of anroid and ios sdks --- android/build.gradle | 2 +- example/ios/Podfile.lock | 19 ++++++++++--------- intercom-react-native.podspec | 2 +- package.json | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 170f4ebd..8c461434 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -60,5 +60,5 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation 'com.google.firebase:firebase-messaging:20.2.+' - implementation 'io.intercom.android:intercom-sdk:10.7.0' + implementation 'io.intercom.android:intercom-sdk:12.0.0' } diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index aa5eee8d..c9b8c2a9 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -72,9 +72,9 @@ PODS: - FlipperKit/FlipperKitNetworkPlugin - fmt (6.2.1) - glog (0.3.5) - - Intercom (11.2.0) - - intercom-react-native (2.1.0): - - Intercom (~> 11.2.0) + - Intercom (12.0.0) + - intercom-react-native (3.0.0): + - Intercom (~> 12.0.0) - React-Core - libevent (2.1.12) - OpenSSL-Universal (1.1.180) @@ -404,6 +404,8 @@ DEPENDENCIES: - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: + https://cdn.cocoapods.org/: + - Intercom trunk: - boost-for-react-native - CocoaAsyncSocket @@ -417,7 +419,6 @@ SPEC REPOS: - Flipper-RSocket - FlipperKit - fmt - - Intercom - libevent - OpenSSL-Universal - YogaKit @@ -489,7 +490,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 + DoubleConversion: cde416483dac037923206447da6e1454df403714 FBLazyVector: 33c82491102f20ecddb6c6a2c273696ace3191e0 FBReactNativeSpec: df8f81d2a7541ee6755a047b398a5cb5a72acd0e Flipper: b1fddf9a17c32097b2b4c806ad158b2f36bb2692 @@ -502,9 +503,9 @@ SPEC CHECKSUMS: Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 FlipperKit: aec2d931adeee48a07bab1ea8bcc8a6bb87dfce4 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - glog: 5337263514dd6f09803962437687240c5dc39aa4 - Intercom: d17f915e5b840e4c5d9f55e4b7487358469463f9 - intercom-react-native: 448795b154c83c180bace4f8201d85fc7e727ae6 + glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 + Intercom: d706bc52b0e80758b38ceadce9143b76577100fb + intercom-react-native: 43841bfc8d4e4eb4acad9d860e9dd10c80b8ed4b libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b RCT-Folly: 0dd9e1eb86348ecab5ba76f910b56f4b5fef3c46 @@ -537,4 +538,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 1d6700a56b42f5d113c60bf174c5b9390544aece -COCOAPODS: 1.11.2 +COCOAPODS: 1.11.3 diff --git a/intercom-react-native.podspec b/intercom-react-native.podspec index 4e3719e7..f042a247 100644 --- a/intercom-react-native.podspec +++ b/intercom-react-native.podspec @@ -17,5 +17,5 @@ Pod::Spec.new do |s| s.resource_bundles = { 'IntercomFramework' => ['ios/assets/*'] } s.dependency "React-Core" - s.dependency "Intercom", '~> 11.2.0' + s.dependency "Intercom", '~> 12.0.0' end diff --git a/package.json b/package.json index 4b3b6ce2..032989cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@intercom/intercom-react-native", - "version": "2.1.0", + "version": "3.0.0", "description": "React Native wrapper to bridge our iOS and Android SDK", "main": "lib/commonjs/index", "module": "lib/module/index", From af0ed1f72dfc52187a8e27aa52132eacd3531bba Mon Sep 17 00:00:00 2001 From: Dawid van der Hoven Date: Wed, 13 Apr 2022 11:15:51 +0200 Subject: [PATCH 015/330] fix: event name for unread count listener --- .../java/com/intercom/reactnative/IntercomEventEmitter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/intercom/reactnative/IntercomEventEmitter.java b/android/src/main/java/com/intercom/reactnative/IntercomEventEmitter.java index f0ab75a8..a1a0d3b2 100644 --- a/android/src/main/java/com/intercom/reactnative/IntercomEventEmitter.java +++ b/android/src/main/java/com/intercom/reactnative/IntercomEventEmitter.java @@ -20,7 +20,7 @@ public class IntercomEventEmitter extends ReactContextBaseJavaModule { private static final String NAME = "IntercomEventEmitter"; - private static final String UNREAD_COUNT_CHANGE_NOTIFICATION = "IntercomUnreadCountDidChange"; + private static final String UNREAD_COUNT_CHANGE_NOTIFICATION = "IntercomUnreadConversationCountDidChangeNotification"; private int activeListenersCount = 0; private final UnreadConversationCountListener unreadConversationCountListener = new UnreadConversationCountListener() { @Override From 2ab4c3c7f5d3e6c3af1f6fe70d46b52325fcabc3 Mon Sep 17 00:00:00 2001 From: niamh-coleman <92738247+niamh-coleman@users.noreply.github.com> Date: Tue, 26 Apr 2022 10:14:10 +0100 Subject: [PATCH 016/330] updating android to sdk 12.1.1 --- .circleci/config.yml | 2 +- android/build.gradle | 6 +++--- example/metro.config.js | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d26a7f13..54560fab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ setup_env_file: &setup_env_file executors: default: docker: - - image: circleci/node:12 + - image: circleci/node:14 working_directory: ~/project orbs: diff --git a/android/build.gradle b/android/build.gradle index 8c461434..743dbee1 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -23,10 +23,10 @@ def safeExtGet(prop, fallback) { } android { - compileSdkVersion safeExtGet('IntercomReactNative_compileSdkVersion', 30) + compileSdkVersion safeExtGet('IntercomReactNative_compileSdkVersion', 31) defaultConfig { minSdkVersion safeExtGet('IntercomReactNative_minSdkVersion', 21) - targetSdkVersion safeExtGet('IntercomReactNative_targetSdkVersion', 30) + targetSdkVersion safeExtGet('IntercomReactNative_targetSdkVersion', 31) versionCode 1 versionName "1.0" buildConfigField 'String', 'INTERCOM_VERSION_NAME', packageVersion @@ -60,5 +60,5 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation 'com.google.firebase:firebase-messaging:20.2.+' - implementation 'io.intercom.android:intercom-sdk:12.0.0' + implementation 'io.intercom.android:intercom-sdk:12.1.1' } diff --git a/example/metro.config.js b/example/metro.config.js index d1f468ab..c64ca56d 100644 --- a/example/metro.config.js +++ b/example/metro.config.js @@ -1,5 +1,5 @@ const path = require('path'); -const blacklist = require('metro-config/src/defaults/blacklist'); +const blacklist = require('metro-config/src/defaults/exclusionList'); const escape = require('escape-string-regexp'); const pak = require('../package.json'); diff --git a/package.json b/package.json index 032989cd..90e42772 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@intercom/intercom-react-native", - "version": "3.0.0", + "version": "3.0.1", "description": "React Native wrapper to bridge our iOS and Android SDK", "main": "lib/commonjs/index", "module": "lib/module/index", From 22acb15ee546a2bd0d301300ea1ffe9358681171 Mon Sep 17 00:00:00 2001 From: Raj Date: Tue, 3 May 2022 07:06:25 +0100 Subject: [PATCH 017/330] Release 3.0.2 --- android/build.gradle | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 743dbee1..1cb79d81 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -60,5 +60,5 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation 'com.google.firebase:firebase-messaging:20.2.+' - implementation 'io.intercom.android:intercom-sdk:12.1.1' + implementation 'io.intercom.android:intercom-sdk:12.2.1' } diff --git a/package.json b/package.json index 90e42772..072e145c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@intercom/intercom-react-native", - "version": "3.0.1", + "version": "3.0.2", "description": "React Native wrapper to bridge our iOS and Android SDK", "main": "lib/commonjs/index", "module": "lib/module/index", From 08aa18fe97d0a912976e0860f490134ad11815e5 Mon Sep 17 00:00:00 2001 From: Raj Date: Thu, 5 May 2022 13:42:44 +0100 Subject: [PATCH 018/330] Release 3.0.3 --- android/build.gradle | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 1cb79d81..73d638d6 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -60,5 +60,5 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation 'com.google.firebase:firebase-messaging:20.2.+' - implementation 'io.intercom.android:intercom-sdk:12.2.1' + implementation 'io.intercom.android:intercom-sdk:12.2.2' } diff --git a/package.json b/package.json index 072e145c..da419111 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@intercom/intercom-react-native", - "version": "3.0.2", + "version": "3.0.3", "description": "React Native wrapper to bridge our iOS and Android SDK", "main": "lib/commonjs/index", "module": "lib/module/index", From cf95cbda08e5b6050f22565333b95a0af9c59a90 Mon Sep 17 00:00:00 2001 From: Vinesh Raju Date: Wed, 1 Jun 2022 17:49:20 +0100 Subject: [PATCH 019/330] Update android and ios sdks --- android/build.gradle | 2 +- .../reactnative/IntercomErrorCodes.java | 1 + .../intercom/reactnative/IntercomModule.java | 13 + example/.env.example | 1 + example/ios/Podfile.lock | 21 +- example/package.json | 2 +- example/src/App.tsx | 23 + example/yarn.lock | 1338 +++++++++-------- intercom-react-native.podspec | 2 +- ios/IntercomModule.m | 9 + package.json | 2 +- src/index.tsx | 3 + 12 files changed, 764 insertions(+), 653 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 73d638d6..d0401b46 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -60,5 +60,5 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation 'com.google.firebase:firebase-messaging:20.2.+' - implementation 'io.intercom.android:intercom-sdk:12.2.2' + implementation 'io.intercom.android:intercom-sdk:12.4.1' } diff --git a/android/src/main/java/com/intercom/reactnative/IntercomErrorCodes.java b/android/src/main/java/com/intercom/reactnative/IntercomErrorCodes.java index 4ca28314..16179e6e 100644 --- a/android/src/main/java/com/intercom/reactnative/IntercomErrorCodes.java +++ b/android/src/main/java/com/intercom/reactnative/IntercomErrorCodes.java @@ -19,6 +19,7 @@ public class IntercomErrorCodes { public static final String SET_LAUNCHER_VISIBILITY = "208"; public static final String SET_BOTTOM_PADDING = "209"; public static final String DISPLAY_HELP_CENTER_COLLECTIONS = "210"; + public static final String DISPLAY_SURVEY = "211"; public static final String HANDLE_PUSH_MESSAGE = "301"; public static final String SEND_TOKEN_TO_INTERCOM = "302"; public static final String FETCH_HELP_CENTER_COLLECTIONS = "901"; diff --git a/android/src/main/java/com/intercom/reactnative/IntercomModule.java b/android/src/main/java/com/intercom/reactnative/IntercomModule.java index f779387e..b2438eaf 100644 --- a/android/src/main/java/com/intercom/reactnative/IntercomModule.java +++ b/android/src/main/java/com/intercom/reactnative/IntercomModule.java @@ -413,6 +413,19 @@ public void displayCarousel(String carouselId, Promise promise) { } } + @ReactMethod + public void displaySurvey(String surveyId, Promise promise) { + try { + Intercom.client().displaySurvey(surveyId); + Log.d(NAME, "displaySurvey"); + promise.resolve(true); + } catch (Exception err) { + Log.e(NAME, "displaySurvey error:"); + Log.e(NAME, err.toString()); + promise.reject(IntercomErrorCodes.DISPLAY_SURVEY, err.toString()); + } + } + @ReactMethod public void displayArticle(String articleId, Promise promise) { try { diff --git a/example/.env.example b/example/.env.example index 41f03362..7209a16f 100644 --- a/example/.env.example +++ b/example/.env.example @@ -3,6 +3,7 @@ IOS_INTERCOM_KEY=$IOS_INTERCOM_KEY ANDROID_INTERCOM_APP_ID=$ANDROID_INTERCOM_APP_ID ANDROID_INTERCOM_KEY=$ANDROID_INTERCOM_KEY CAROUSEL_ID=$CAROUSEL_ID +SURVEY_ID=$SURVEY_ID EVENT_NAME=$EVENT_NAME ARTICLE_ID=$ARTICLE_ID USER_NAME=$USER_NAME diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index c9b8c2a9..2c4e5f7a 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -72,9 +72,9 @@ PODS: - FlipperKit/FlipperKitNetworkPlugin - fmt (6.2.1) - glog (0.3.5) - - Intercom (12.0.0) - - intercom-react-native (3.0.0): - - Intercom (~> 12.0.0) + - Intercom (12.4.0) + - intercom-react-native (3.0.4): + - Intercom (~> 12.4.0) - React-Core - libevent (2.1.12) - OpenSSL-Universal (1.1.180) @@ -341,7 +341,7 @@ PODS: - React-cxxreact (= 0.65.1) - React-jsi (= 0.65.1) - React-perflogger (= 0.65.1) - - RNCAsyncStorage (1.15.14): + - RNCAsyncStorage (1.17.6): - React-Core - Yoga (1.14.0) - YogaKit (1.18.1): @@ -404,8 +404,6 @@ DEPENDENCIES: - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) SPEC REPOS: - https://cdn.cocoapods.org/: - - Intercom trunk: - boost-for-react-native - CocoaAsyncSocket @@ -419,6 +417,7 @@ SPEC REPOS: - Flipper-RSocket - FlipperKit - fmt + - Intercom - libevent - OpenSSL-Universal - YogaKit @@ -490,7 +489,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - DoubleConversion: cde416483dac037923206447da6e1454df403714 + DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 FBLazyVector: 33c82491102f20ecddb6c6a2c273696ace3191e0 FBReactNativeSpec: df8f81d2a7541ee6755a047b398a5cb5a72acd0e Flipper: b1fddf9a17c32097b2b4c806ad158b2f36bb2692 @@ -503,9 +502,9 @@ SPEC CHECKSUMS: Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 FlipperKit: aec2d931adeee48a07bab1ea8bcc8a6bb87dfce4 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 - Intercom: d706bc52b0e80758b38ceadce9143b76577100fb - intercom-react-native: 43841bfc8d4e4eb4acad9d860e9dd10c80b8ed4b + glog: 5337263514dd6f09803962437687240c5dc39aa4 + Intercom: 43bbc1feee8192066601fd414d5e8ff381d8a4c8 + intercom-react-native: f4736830a2162d0e3bde175e030aaad1dd2aec13 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b RCT-Folly: 0dd9e1eb86348ecab5ba76f910b56f4b5fef3c46 @@ -532,7 +531,7 @@ SPEC CHECKSUMS: React-RCTVibration: 92d41c2442e5328cc4d342cd7f78e5876b68bae5 React-runtimeexecutor: 85187f19dd9c47a7c102f9994f9d14e4dc2110de ReactCommon: eafed38eec7b591c31751bfa7494801618460459 - RNCAsyncStorage: ea6b5c280997b2b32a587793163b1f10e580c4f7 + RNCAsyncStorage: 466b9df1a14bccda91da86e0b7d9a345d78e1673 Yoga: aa0cb45287ebe1004c02a13f279c55a95f1572f4 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a diff --git a/example/package.json b/example/package.json index 908d0983..64c54dcc 100644 --- a/example/package.json +++ b/example/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@babel/core": "^7.12.9", - "@babel/runtime": "^7.12.5", + "@babel/runtime": "^7.18.3", "@types/react-native": "^0.64.13", "babel-plugin-module-resolver": "^4.1.0", "metro-react-native-babel-preset": "^0.66.0", diff --git a/example/src/App.tsx b/example/src/App.tsx index 28b1f98e..535fa7fd 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -27,6 +27,7 @@ const AUTK_KEY = 'auth'; const COLLECTIONS: string[] = []; //Provide help center collections ids // To change, replace values in .env const CAROUSEL_ID = Config.CAROUSEL_ID; +const SURVEY_ID = Config.SURVEY_ID; const EVENT_NAME = Config.EVENT_NAME; const ARTICLE_ID = Config.ARTICLE_ID; const USER_NAME = Config.USER_NAME; @@ -48,6 +49,7 @@ export default function App() { const [articleId, setArticleId] = useState(ARTICLE_ID); const [carouselId, setCarouselId] = useState(CAROUSEL_ID); + const [surveyId, setSurveyId] = useState(SURVEY_ID); const [eventName, setEventName] = useState(EVENT_NAME); const [collectionId, setCollectionId] = useState( COLLECTION_ID @@ -353,6 +355,27 @@ export default function App() { } }} /> + { + setSurveyId(val); + }} + placeholder="Survey Id" + /> +