Skip to content

Commit d35f8d0

Browse files
Upgraded React-Native to 0.73.4 & dependencies in the Android.
1 parent 50f0650 commit d35f8d0

File tree

6 files changed

+3645
-3390
lines changed

6 files changed

+3645
-3390
lines changed

android/build.gradle

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
1-
def packageJsonFile = file('../package.json')
2-
def packageJson = new groovy.json.JsonSlurper().parseText(packageJsonFile.text)
3-
def packageVersion = '"' + packageJson.version + '"'
1+
def packageJsonFile = file('../package.json')
2+
def packageJson = new groovy.json.JsonSlurper().parseText(packageJsonFile.text)
3+
def packageVersion = '"' + packageJson.version + '"'
44

55

66
buildscript {
7-
if (project == rootProject) {
8-
repositories {
9-
google()
10-
mavenCentral()
11-
}
7+
ext {
8+
buildToolsVersion = "34.0.0"
9+
minSdkVersion = 21
10+
compileSdkVersion = 34
11+
targetSdkVersion = 34
12+
ndkVersion = "25.1.8937393"
13+
kotlinVersion = "1.8.0"
14+
}
15+
if (project == rootProject) {
16+
repositories {
17+
google()
18+
mavenCentral()
19+
}
1220

13-
dependencies {
14-
classpath 'com.android.tools.build:gradle:3.5.3'
15-
}
21+
dependencies {
22+
classpath("com.android.tools.build:gradle")
23+
classpath("com.facebook.react:react-native-gradle-plugin")
24+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
1625
}
26+
}
1727
}
1828

1929
apply plugin: 'com.android.library'
2030

2131
def safeExtGet(prop, fallback) {
22-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
32+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
2333
}
2434

2535
android {
26-
// Compatibility for AGP v. <4.2/Gradle 8
27-
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
28-
if (agpVersion >= 7) {
29-
namespace 'com.intercom.reactnative'
30-
}
36+
namespace 'com.intercom.reactnative'
37+
compileSdk rootProject.ext.compileSdkVersion
38+
buildToolsVersion rootProject.ext.buildToolsVersion
3139

32-
compileSdkVersion safeExtGet('IntercomReactNative_compileSdkVersion', 34)
33-
defaultConfig {
34-
minSdkVersion safeExtGet('IntercomReactNative_minSdkVersion', 21)
35-
targetSdkVersion safeExtGet('IntercomReactNative_targetSdkVersion', 34)
36-
versionCode 1
37-
versionName "1.0"
38-
buildConfigField 'String', 'INTERCOM_VERSION_NAME', packageVersion
39-
}
40+
defaultConfig {
41+
minSdkVersion rootProject.ext.minSdkVersion
42+
targetSdkVersion rootProject.ext.targetSdkVersion
43+
versionCode 1
44+
versionName "1.0"
45+
buildConfigField 'String', 'INTERCOM_VERSION_NAME', packageVersion
46+
}
4047

41-
buildTypes {
42-
release {
43-
minifyEnabled false
44-
}
45-
}
46-
lintOptions {
47-
disable 'GradleCompatible'
48-
}
49-
50-
if (agpVersion < 8) {
51-
compileOptions {
52-
sourceCompatibility JavaVersion.VERSION_1_8
53-
targetCompatibility JavaVersion.VERSION_1_8
54-
}
48+
buildTypes {
49+
release {
50+
minifyEnabled false
5551
}
52+
}
53+
lintOptions {
54+
disable 'GradleCompatible'
55+
}
5656
}
5757

5858
repositories {
59-
mavenCentral()
60-
mavenLocal()
61-
maven {
62-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
63-
url("$rootDir/../node_modules/react-native/android")
64-
}
65-
google()
59+
mavenCentral()
60+
mavenLocal()
61+
maven {
62+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
63+
url("$rootDir/../node_modules/react-native/android")
64+
}
65+
google()
6666
}
6767

6868
dependencies {
69-
//noinspection GradleDynamicVersion
70-
implementation "com.facebook.react:react-native:+" // From node_modules
71-
implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '20.2.+')}"
72-
implementation 'io.intercom.android:intercom-sdk:15.6.4'
69+
//noinspection GradleDynamicVersion
70+
implementation "com.facebook.react:react-native:+" // From node_modules
71+
implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '20.2.+')}"
72+
implementation 'io.intercom.android:intercom-sdk:15.7.0'
7373
}

package.json

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,25 @@
5454
"access": "public"
5555
},
5656
"devDependencies": {
57-
"@expo/config-plugins": "^7.8.4",
58-
"@react-native-community/eslint-config": "^2.0.0",
59-
"@types/jest": "^26.0.0",
60-
"@types/mocha": "^8.2.2",
61-
"@types/react": "^16.9.19",
62-
"@types/react-native": "0.62.13",
63-
"@wdio/mocha-framework": "^7.7.2",
64-
"eslint": "^7.2.0",
65-
"eslint-config-prettier": "^7.0.0",
66-
"eslint-plugin-prettier": "^3.1.3",
67-
"jest": "^26.0.1",
68-
"pod-install": "^0.1.0",
69-
"prettier": "^2.0.5",
70-
"react": "18.1.0",
71-
"react-native": "0.70.4",
72-
"react-native-builder-bob": "^0.18.0",
73-
"typescript": "^4.1.3",
74-
"webdriverio": "^7.7.2"
57+
"@expo/config-plugins": "7.8.4",
58+
"@react-native-community/eslint-config": "3.2.0",
59+
"@types/jest": "29.5.12",
60+
"@types/mocha": "10.0.6",
61+
"@types/react": "18.2.6",
62+
"@react-native/typescript-config": "0.73.1",
63+
"@wdio/mocha-framework": "8.33.1",
64+
"@wdio/globals": "8.33.1",
65+
"eslint": "8.19.0",
66+
"eslint-config-prettier": "8.10.0",
67+
"eslint-plugin-prettier": "5.1.3",
68+
"jest": "29.6.3",
69+
"pod-install": "0.2.0",
70+
"prettier": "3.0.0",
71+
"react": "18.2.0",
72+
"react-native": "0.73.4",
73+
"react-native-builder-bob": "0.23.2",
74+
"typescript": "5.0.4",
75+
"webdriverio": "8.33.0"
7576
},
7677
"peerDependencies": {
7778
"react": "*",
@@ -135,6 +136,9 @@
135136
]
136137
},
137138
"resolutions": {
138-
"@types/react": "^17.0.38"
139+
"@types/react": "18.2.6"
140+
},
141+
"engines": {
142+
"node": ">=18"
139143
}
140144
}

src/expo-plugins/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
ConfigPlugin,
2+
type ConfigPlugin,
33
createRunOncePlugin,
44
withAppDelegate,
55
AndroidConfig,

src/index.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
NativeModules,
33
NativeEventEmitter,
44
Platform,
5-
EmitterSubscription,
5+
type EmitterSubscription,
66
} from 'react-native';
77

88
const { IntercomModule, IntercomEventEmitter } = NativeModules;
@@ -28,13 +28,13 @@ type LogLevelType = keyof typeof LogLevel;
2828

2929
export const IntercomEvents = {
3030
IntercomUnreadCountDidChange:
31-
IntercomEventEmitter.UNREAD_COUNT_CHANGE_NOTIFICATION,
31+
IntercomEventEmitter.UNREAD_COUNT_CHANGE_NOTIFICATION,
3232
IntercomWindowDidHide: IntercomEventEmitter.WINDOW_DID_HIDE_NOTIFICATION,
3333
IntercomWindowDidShow: IntercomEventEmitter.WINDOW_DID_SHOW_NOTIFICATION,
3434
IntercomHelpCenterWindowDidShow:
35-
IntercomEventEmitter.WINDOW_DID_SHOW_NOTIFICATION,
35+
IntercomEventEmitter.WINDOW_DID_SHOW_NOTIFICATION,
3636
IntercomHelpCenterWindowDidHide:
37-
IntercomEventEmitter.WINDOW_DID_HIDE_NOTIFICATION,
37+
IntercomEventEmitter.WINDOW_DID_HIDE_NOTIFICATION,
3838
};
3939

4040
type EventType =
@@ -200,7 +200,7 @@ export type IntercomType = {
200200
* @return {Promise<HelpCenterCollectionContent>} A {@link HelpCenterCollectionContent} object.
201201
*/
202202
fetchHelpCenterCollection: (
203-
id: string
203+
id: string,
204204
) => Promise<HelpCenterCollectionContent>;
205205

206206
/**
@@ -211,7 +211,7 @@ export type IntercomType = {
211211
* @return {Promise<HelpCenterArticleSearchResult>} An array of {@link HelpCenterArticleSearchResult} objects.
212212
*/
213213
searchHelpCenter: (
214-
term: string
214+
term: string,
215215
) => Promise<Array<HelpCenterArticleSearchResult>>;
216216

217217
/**
@@ -283,7 +283,7 @@ export type IntercomType = {
283283
*/
284284
addEventListener: (
285285
event: EventType,
286-
callback: (response: { count?: number; visible: boolean }) => void
286+
callback: (response: { count?: number; visible: boolean }) => void,
287287
) => EmitterSubscription;
288288
};
289289

@@ -332,15 +332,15 @@ const Intercom: IntercomType = {
332332

333333
addEventListener: (event, callback) => {
334334
event === IntercomEvents.IntercomUnreadCountDidChange &&
335-
Platform.OS === 'android' &&
336-
IntercomEventEmitter.startEventListener();
335+
Platform.OS === 'android' &&
336+
IntercomEventEmitter.startEventListener();
337337
const eventEmitter = new NativeEventEmitter(IntercomEventEmitter);
338338
const listener = eventEmitter.addListener(event, callback);
339339
const originalRemove = listener.remove;
340340
listener.remove = () => {
341341
event === IntercomEvents.IntercomUnreadCountDidChange &&
342-
Platform.OS === 'android' &&
343-
IntercomEventEmitter.removeEventListener();
342+
Platform.OS === 'android' &&
343+
IntercomEventEmitter.removeEventListener();
344344
originalRemove();
345345
};
346346
return listener;
@@ -389,7 +389,7 @@ export type IntercomContentType = {
389389
carouselWithCarouselId: (carouselId: string) => Carousel;
390390
surveyWithSurveyId: (surveyId: string) => Survey;
391391
helpCenterCollectionsWithIds: (
392-
collectionIds: string[]
392+
collectionIds: string[],
393393
) => HelpCenterCollections;
394394
conversationWithConversationId: (conversationId: string) => Conversation;
395395
};

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"paths": {
55
"@intercom/intercom-react-native": ["./src/index"],
66
},
7-
"types": ["node", "mocha", "webdriverio/async", "@wdio/mocha-framework"],
7+
"types": ["node", "mocha", "@wdio/globals/types", "@wdio/mocha-framework"],
88
"allowUnreachableCode": false,
99
"allowUnusedLabels": false,
1010
"esModuleInterop": true,
11-
"importsNotUsedAsValues": "error",
11+
"verbatimModuleSyntax": true,
1212
"forceConsistentCasingInFileNames": true,
1313
"jsx": "react",
1414
"lib": ["esnext"],

0 commit comments

Comments
 (0)