Skip to content

Commit ba734ca

Browse files
piotr pietruszewskipi0trpietruszewski
authored andcommitted
fix(android): fixed issue with package version name detection
1 parent 9bf64cb commit ba734ca

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

android/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
def packageJsonFile = file('../package.json')
22
def packageJson = new groovy.json.JsonSlurper().parseText(packageJsonFile.text)
3+
def packageVersion = '"' + packageJson.version + '"'
34

45

56
buildscript {
@@ -28,7 +29,8 @@ android {
2829
minSdkVersion safeExtGet('IntercomReactNative_minSdkVersion', 21)
2930
targetSdkVersion safeExtGet('IntercomReactNative_targetSdkVersion', 29)
3031
versionCode 1
31-
versionName packageJson.version
32+
versionName "1.0"
33+
buildConfigField 'String', 'INTERCOM_VERSION_NAME', packageVersion
3234

3335
}
3436

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ public void setBottomPadding(int paddingBottom, Promise promise) {
479479
}
480480

481481
public static synchronized void initialize(Application application, String apiKey, String appId) {
482-
String sdkVersion = BuildConfig.VERSION_NAME;
482+
String sdkVersion = BuildConfig.INTERCOM_VERSION_NAME;
483483
ReactNativeHeaderInterceptor.setReactNativeVersion(application.getApplicationContext(), sdkVersion);
484484
Intercom.initialize(application, apiKey, appId);
485485
}

0 commit comments

Comments
 (0)