Skip to content

Commit 8343157

Browse files
authored
Merge branch 'main' into main
2 parents 91d3025 + 517f2fd commit 8343157

File tree

516 files changed

+2256
-14245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

516 files changed

+2256
-14245
lines changed

.circleci/config.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version: 2.1
44
macos_config: &macos_config
55
macos:
66
xcode: 12.5.0
7+
resource_class: macos.x86.medium.gen2
78
shell: /bin/bash --login -eo pipefail
89

910
setup_env_file: &setup_env_file
@@ -15,16 +16,26 @@ setup_env_file: &setup_env_file
1516
executors:
1617
default:
1718
docker:
18-
- image: circleci/node:12
19+
- image: circleci/node:14
1920
working_directory: ~/project
2021

2122
orbs:
2223
android: circleci/[email protected]
2324

24-
run_on_master: &run_on_master
25+
# Always run job
26+
run_always: &run_always
2527
filters:
28+
tags:
29+
only: /.*/
30+
31+
# Only run on release
32+
run_on_release: &run_on_release
33+
filters:
34+
tags:
35+
only: /.*/
2636
branches:
27-
only: main
37+
ignore: /.*/
38+
2839

2940
commands:
3041
attach_project:
@@ -219,42 +230,50 @@ jobs:
219230
yarn install
220231
221232
- run:
222-
name: Release package
223-
command: npm run release --ci
233+
name: Publish the package
234+
command: npm publish
224235

225236

226237
workflows:
238+
version: 2.1
227239
build-and-test:
228240
jobs:
229-
- install-dependencies
241+
- install-dependencies:
242+
<<: *run_always
230243
- lint:
244+
<<: *run_always
231245
requires:
232246
- install-dependencies
233247
- typescript:
248+
<<: *run_always
234249
requires:
235250
- install-dependencies
236251
- unit-tests:
252+
<<: *run_always
237253
requires:
238254
- install-dependencies
239255
- build-package:
256+
<<: *run_always
240257
requires:
241258
- install-dependencies
242259
- android-e2e-test:
260+
<<: *run_always
243261
requires:
244262
- install-dependencies
245263
- lint
246264
- typescript
247265
- unit-tests
248266
- build-package
249267
- ios-e2e-test:
268+
<<: *run_always
250269
requires:
251270
- install-dependencies
252271
- lint
253272
- typescript
254273
- unit-tests
255274
- build-package
256275
- release-to-npm:
257-
<<: *run_on_master
276+
<<: *run_on_release
258277
context:
259278
- react-native-context
260279
requires:
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# More information on this workflow can be found here: https://stackoverflow.com/c/intercom/questions/1270
2+
3+
name: FOSSA License Scan
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
fossa:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
- name: Attempt build
17+
uses: intercom/attempt-build-action@main
18+
continue-on-error: true
19+
- name: Run FOSSA
20+
uses: intercom/fossa-action@main
21+
with:
22+
fossa-api-key: ${{ secrets.FOSSA_API_KEY }}
23+
fossa-event-receiver-token: ${{ secrets.FOSSA_EVENT_RECEIVER_TOKEN }}
24+
datadog-api-key: ${{ secrets.DATADOG_API_KEY }}

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ public void onCreate() {
8989
}
9090
```
9191

92-
- Open `android/build.gradle` and change `minSdkVersion` to **21**
92+
- Open `android/build.gradle` and change `minSdkVersion` to **21**, `compileSdkVersion` and `targetSdkVersion` to at least **31**
9393

9494
```Gradle
9595
buildscript {
9696
// ...
9797
ext {
9898
buildToolsVersion = "29.0.2"
9999
minSdkVersion = 21 // <-- Here
100-
compileSdkVersion = 29
101-
targetSdkVersion = 29
100+
compileSdkVersion = 31 // <-- Here
101+
targetSdkVersion = 31 // <-- Here
102102
}
103103
// ...
104104
}
@@ -177,6 +177,12 @@ import com.intercom.reactnative.IntercomModule;
177177

178178
public class MainNotificationService extends FirebaseMessagingService {
179179

180+
@Override
181+
public void onNewToken(String refreshedToken) {
182+
IntercomModule.sendTokenToIntercom(getApplication(), refreshedToken);
183+
//DO LOGIC HERE
184+
}
185+
180186
public void onMessageReceived(RemoteMessage remoteMessage) {
181187
if (IntercomModule.isIntercomPush(remoteMessage)) {
182188
IntercomModule.handleRemotePushMessage(getApplication(), remoteMessage);

android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ def safeExtGet(prop, fallback) {
2323
}
2424

2525
android {
26-
compileSdkVersion safeExtGet('IntercomReactNative_compileSdkVersion', 30)
26+
compileSdkVersion safeExtGet('IntercomReactNative_compileSdkVersion', 31)
2727
defaultConfig {
2828
minSdkVersion safeExtGet('IntercomReactNative_minSdkVersion', 21)
29-
targetSdkVersion safeExtGet('IntercomReactNative_targetSdkVersion', 30)
29+
targetSdkVersion safeExtGet('IntercomReactNative_targetSdkVersion', 31)
3030
versionCode 1
3131
versionName "1.0"
3232
buildConfigField 'String', 'INTERCOM_VERSION_NAME', packageVersion
@@ -60,5 +60,5 @@ dependencies {
6060
//noinspection GradleDynamicVersion
6161
implementation "com.facebook.react:react-native:+" // From node_modules
6262
implementation 'com.google.firebase:firebase-messaging:20.2.+'
63-
implementation 'io.intercom.android:intercom-sdk:10.1.+'
63+
implementation 'io.intercom.android:intercom-sdk:12.1.1'
6464
}

docs/IOS-MANUAL-LINKING.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@
44

55
- In project root make `react-native link` command
66
- In Xcode open `YourApp.xcworkspace`, if there is no file with extension `xcworkspace` open `YourApp.xcodeproj`
7-
- In file browser open `./node_modules/intercom-react-native/ios`
8-
- From file browser drag `Intercom.xcframework` and drop in Xcode window under YourProject name
7+
- [Download intercom for iOS and extract the zip](https://github.com/intercom/intercom-ios/archive/master.zip)
8+
- Drag Intercom.xcframework into your project. Make sure **"Copy items if needed"** is selected and click Finish.
99

10-
![Xcode linking](xcode-linking.png)
10+
![Xcode linking](https://files.readme.io/51cf138-xcframework_drag.png)
1111

12-
___
13-
14-
- In popup mark `Copy items if needed`
15-
16-
![Xcode popup](xcode-popup.png)
12+
![Xcode popup](https://files.readme.io/031bc35-copy_items.png)
1713

1814
___
1915

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<activity
1515
android:name=".MainActivity"
1616
android:label="@string/app_name"
17+
android:exported="true"
1718
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
1819
android:launchMode="singleTask"
1920
android:windowSoftInputMode="adjustResize">

example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ buildscript {
77
ext {
88
buildToolsVersion = "30.0.2"
99
minSdkVersion = 21
10-
compileSdkVersion = 30
11-
targetSdkVersion = 30
10+
compileSdkVersion = 31
11+
targetSdkVersion = 31
1212
ndkVersion = "20.1.5948944"
1313
}
1414
repositories {

example/e2e/helpers.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@ const closeOverlay = async (customCloseButtonId?: string) => {
4545
await closeButton.waitForDisplayed({ timeout: 22000 });
4646
await closeButton.click();
4747
};
48+
49+
const closeModalOverlay = async (customCloseButtonId?: string) => {
50+
const buttonId = browser.isAndroid ? `~Close` : customCloseButtonId || `~intercom modal close button`;
51+
52+
const closeButton = await $(buttonId);
53+
await closeButton.waitForDisplayed({ timeout: 22000 });
54+
await closeButton.click();
55+
};
56+
4857
browser.addCommand('closeOverlay', closeOverlay);
58+
browser.addCommand('closeModalOverlay', closeModalOverlay);
4959

5060
const closeArticleOverlay = async () => {
5161
if (browser.isAndroid) {
@@ -55,7 +65,7 @@ const closeArticleOverlay = async () => {
5565
await closeButton.waitForDisplayed({ timeout: 22000 });
5666
await closeButton.click();
5767
} else {
58-
await closeOverlay();
68+
await closeModalOverlay();
5969
}
6070
};
6171
browser.addCommand('closeArticleOverlay', closeArticleOverlay);

example/e2e/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
"@wdio/cli": "^7.7.2",
1717
"appium": "^1.21.0",
1818
"chai": "^4.3.4",
19+
"webdriver": "^7.16.13",
1920
"webdriverio": "^7.7.2"
2021
},
2122
"devDependencies": {
22-
"@wdio/appium-service": "^7.7.3",
23+
"@wdio/appium-service": "^7.16.13",
2324
"@wdio/local-runner": "^7.7.3",
2425
"@wdio/mocha-framework": "^7.7.3",
2526
"@wdio/spec-reporter": "^7.7.3",

example/e2e/tests/mainIntercom.e2e.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('Intercom E2E', () => {
7070
it('Should display carousel', async () => {
7171
await driver.scrollToElementByAccessibilityLabel('display-carousel');
7272
await (await $('~display-carousel')).click();
73-
await driver.closeOverlay();
73+
await driver.closeModalOverlay();
7474
});
7575

7676
it('Should get unread messages count', async () => {
@@ -95,7 +95,7 @@ describe('Intercom E2E', () => {
9595

9696
const launcherId = driver.isAndroid
9797
? '~Intercom launcher'
98-
: '~launcher';
98+
: '~intercom launcher';
9999
await (await $(launcherId)).waitForDisplayed({ timeout: 12000 });
100100
await driver.clickWithDelay('~toggle-launcher-visibility', 12000);
101101
});
@@ -135,9 +135,9 @@ describe('Intercom E2E', () => {
135135
await (await $('~authenticated')).waitForDisplayed({ timeout: 12000 });
136136
});
137137

138-
it('Should set logout ', async () => {
138+
/* it('Should set logout ', async () => {
139139
await driver.scrollToElementByAccessibilityLabel('logout');
140140
await (await $('~logout')).click();
141141
await (await $('~unauthenticated')).waitForDisplayed({ timeout: 12000 });
142-
});
142+
}); */
143143
});

0 commit comments

Comments
 (0)