Skip to content

Commit

Permalink
fix(android): fixed issue with package version name detection
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr pietruszewski authored and pi0trpietruszewski committed Jun 29, 2021
1 parent 9bf64cb commit ba734ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
def packageJsonFile = file('../package.json')
def packageJson = new groovy.json.JsonSlurper().parseText(packageJsonFile.text)
def packageVersion = '"' + packageJson.version + '"'


buildscript {
Expand Down Expand Up @@ -28,7 +29,8 @@ android {
minSdkVersion safeExtGet('IntercomReactNative_minSdkVersion', 21)
targetSdkVersion safeExtGet('IntercomReactNative_targetSdkVersion', 29)
versionCode 1
versionName packageJson.version
versionName "1.0"
buildConfigField 'String', 'INTERCOM_VERSION_NAME', packageVersion

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public void setBottomPadding(int paddingBottom, Promise promise) {
}

public static synchronized void initialize(Application application, String apiKey, String appId) {
String sdkVersion = BuildConfig.VERSION_NAME;
String sdkVersion = BuildConfig.INTERCOM_VERSION_NAME;
ReactNativeHeaderInterceptor.setReactNativeVersion(application.getApplicationContext(), sdkVersion);
Intercom.initialize(application, apiKey, appId);
}
Expand Down

0 comments on commit ba734ca

Please sign in to comment.