Skip to content

Commit cf95cbd

Browse files
committed
Update android and ios sdks
1 parent 3db9b1a commit cf95cbd

File tree

12 files changed

+764
-653
lines changed

12 files changed

+764
-653
lines changed

Diff for: android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -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:12.2.2'
63+
implementation 'io.intercom.android:intercom-sdk:12.4.1'
6464
}

Diff for: android/src/main/java/com/intercom/reactnative/IntercomErrorCodes.java

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class IntercomErrorCodes {
1919
public static final String SET_LAUNCHER_VISIBILITY = "208";
2020
public static final String SET_BOTTOM_PADDING = "209";
2121
public static final String DISPLAY_HELP_CENTER_COLLECTIONS = "210";
22+
public static final String DISPLAY_SURVEY = "211";
2223
public static final String HANDLE_PUSH_MESSAGE = "301";
2324
public static final String SEND_TOKEN_TO_INTERCOM = "302";
2425
public static final String FETCH_HELP_CENTER_COLLECTIONS = "901";

Diff for: android/src/main/java/com/intercom/reactnative/IntercomModule.java

+13
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,19 @@ public void displayCarousel(String carouselId, Promise promise) {
413413
}
414414
}
415415

416+
@ReactMethod
417+
public void displaySurvey(String surveyId, Promise promise) {
418+
try {
419+
Intercom.client().displaySurvey(surveyId);
420+
Log.d(NAME, "displaySurvey");
421+
promise.resolve(true);
422+
} catch (Exception err) {
423+
Log.e(NAME, "displaySurvey error:");
424+
Log.e(NAME, err.toString());
425+
promise.reject(IntercomErrorCodes.DISPLAY_SURVEY, err.toString());
426+
}
427+
}
428+
416429
@ReactMethod
417430
public void displayArticle(String articleId, Promise promise) {
418431
try {

Diff for: example/.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ IOS_INTERCOM_KEY=$IOS_INTERCOM_KEY
33
ANDROID_INTERCOM_APP_ID=$ANDROID_INTERCOM_APP_ID
44
ANDROID_INTERCOM_KEY=$ANDROID_INTERCOM_KEY
55
CAROUSEL_ID=$CAROUSEL_ID
6+
SURVEY_ID=$SURVEY_ID
67
EVENT_NAME=$EVENT_NAME
78
ARTICLE_ID=$ARTICLE_ID
89
USER_NAME=$USER_NAME

Diff for: example/ios/Podfile.lock

+10-11
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ PODS:
7272
- FlipperKit/FlipperKitNetworkPlugin
7373
- fmt (6.2.1)
7474
- glog (0.3.5)
75-
- Intercom (12.0.0)
76-
- intercom-react-native (3.0.0):
77-
- Intercom (~> 12.0.0)
75+
- Intercom (12.4.0)
76+
- intercom-react-native (3.0.4):
77+
- Intercom (~> 12.4.0)
7878
- React-Core
7979
- libevent (2.1.12)
8080
- OpenSSL-Universal (1.1.180)
@@ -341,7 +341,7 @@ PODS:
341341
- React-cxxreact (= 0.65.1)
342342
- React-jsi (= 0.65.1)
343343
- React-perflogger (= 0.65.1)
344-
- RNCAsyncStorage (1.15.14):
344+
- RNCAsyncStorage (1.17.6):
345345
- React-Core
346346
- Yoga (1.14.0)
347347
- YogaKit (1.18.1):
@@ -404,8 +404,6 @@ DEPENDENCIES:
404404
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
405405

406406
SPEC REPOS:
407-
https://cdn.cocoapods.org/:
408-
- Intercom
409407
trunk:
410408
- boost-for-react-native
411409
- CocoaAsyncSocket
@@ -419,6 +417,7 @@ SPEC REPOS:
419417
- Flipper-RSocket
420418
- FlipperKit
421419
- fmt
420+
- Intercom
422421
- libevent
423422
- OpenSSL-Universal
424423
- YogaKit
@@ -490,7 +489,7 @@ EXTERNAL SOURCES:
490489
SPEC CHECKSUMS:
491490
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
492491
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
493-
DoubleConversion: cde416483dac037923206447da6e1454df403714
492+
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
494493
FBLazyVector: 33c82491102f20ecddb6c6a2c273696ace3191e0
495494
FBReactNativeSpec: df8f81d2a7541ee6755a047b398a5cb5a72acd0e
496495
Flipper: b1fddf9a17c32097b2b4c806ad158b2f36bb2692
@@ -503,9 +502,9 @@ SPEC CHECKSUMS:
503502
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
504503
FlipperKit: aec2d931adeee48a07bab1ea8bcc8a6bb87dfce4
505504
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
506-
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3
507-
Intercom: d706bc52b0e80758b38ceadce9143b76577100fb
508-
intercom-react-native: 43841bfc8d4e4eb4acad9d860e9dd10c80b8ed4b
505+
glog: 5337263514dd6f09803962437687240c5dc39aa4
506+
Intercom: 43bbc1feee8192066601fd414d5e8ff381d8a4c8
507+
intercom-react-native: f4736830a2162d0e3bde175e030aaad1dd2aec13
509508
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
510509
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
511510
RCT-Folly: 0dd9e1eb86348ecab5ba76f910b56f4b5fef3c46
@@ -532,7 +531,7 @@ SPEC CHECKSUMS:
532531
React-RCTVibration: 92d41c2442e5328cc4d342cd7f78e5876b68bae5
533532
React-runtimeexecutor: 85187f19dd9c47a7c102f9994f9d14e4dc2110de
534533
ReactCommon: eafed38eec7b591c31751bfa7494801618460459
535-
RNCAsyncStorage: ea6b5c280997b2b32a587793163b1f10e580c4f7
534+
RNCAsyncStorage: 466b9df1a14bccda91da86e0b7d9a345d78e1673
536535
Yoga: aa0cb45287ebe1004c02a13f279c55a95f1572f4
537536
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
538537

Diff for: example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"devDependencies": {
1818
"@babel/core": "^7.12.9",
19-
"@babel/runtime": "^7.12.5",
19+
"@babel/runtime": "^7.18.3",
2020
"@types/react-native": "^0.64.13",
2121
"babel-plugin-module-resolver": "^4.1.0",
2222
"metro-react-native-babel-preset": "^0.66.0",

Diff for: example/src/App.tsx

+23
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const AUTK_KEY = 'auth';
2727
const COLLECTIONS: string[] = []; //Provide help center collections ids
2828
// To change, replace values in .env
2929
const CAROUSEL_ID = Config.CAROUSEL_ID;
30+
const SURVEY_ID = Config.SURVEY_ID;
3031
const EVENT_NAME = Config.EVENT_NAME;
3132
const ARTICLE_ID = Config.ARTICLE_ID;
3233
const USER_NAME = Config.USER_NAME;
@@ -48,6 +49,7 @@ export default function App() {
4849

4950
const [articleId, setArticleId] = useState<string | undefined>(ARTICLE_ID);
5051
const [carouselId, setCarouselId] = useState<string | undefined>(CAROUSEL_ID);
52+
const [surveyId, setSurveyId] = useState<string | undefined>(SURVEY_ID);
5153
const [eventName, setEventName] = useState<string | undefined>(EVENT_NAME);
5254
const [collectionId, setCollectionId] = useState<string | undefined>(
5355
COLLECTION_ID
@@ -353,6 +355,27 @@ export default function App() {
353355
}
354356
}}
355357
/>
358+
<Input
359+
title="Survey Id"
360+
accessibilityLabel="survey-id"
361+
value={surveyId}
362+
onChangeText={(val) => {
363+
setSurveyId(val);
364+
}}
365+
placeholder="Survey Id"
366+
/>
367+
<Button
368+
accessibilityLabel="display-survey"
369+
disabled={!loggedUser}
370+
title={'Display Survey'}
371+
onPress={() => {
372+
if (surveyId) {
373+
Intercom.displaySurvey(surveyId);
374+
} else {
375+
showEmptyAlertMessage('Survey Id');
376+
}
377+
}}
378+
/>
356379
<Button
357380
accessibilityLabel="get-unreads"
358381
disabled={!loggedUser}

0 commit comments

Comments
 (0)