Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit f2237fb

Browse files
authored
Merge pull request #359 from heap/develop
Cut 0.22.1 Release
2 parents 9f144be + 2125a9f commit f2237fb

File tree

17 files changed

+1984
-1134
lines changed

17 files changed

+1984
-1134
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,24 @@ __BEGIN_UNRELEASED__
1515
### Security
1616
__END_UNRELEASED__
1717

18+
## [0.22.1] - 2022-12-02
19+
20+
### Changed
21+
22+
- Switched repositories from jcenter to mavenCentral.
23+
24+
### Fixed
25+
26+
- Fixed Android compilation, moving log to `RNLog.w`.
27+
1828
## [0.22.0] - 2022-09-23
29+
1930
### Added
31+
2032
- Added tests for sending bad data to the native bridge
33+
2134
### Changed
35+
2236
- Changed track bridge to warn instead of throw an exception when bad data is sent.
2337
- Upgraded iOS sdk from 8.2 to 9.0
2438

android/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def heapAppId(buildType) {
3737

3838
buildscript {
3939
repositories {
40-
jcenter()
40+
mavenCentral()
4141
google()
4242
}
4343

@@ -75,7 +75,6 @@ android {
7575

7676
repositories {
7777
mavenCentral()
78-
jcenter()
7978
google()
8079
}
8180

android/src/main/java/com/heapanalytics/reactnative/RNHeapLibraryModule.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
import com.facebook.react.bridge.ReactMethod;
77
import com.facebook.react.bridge.ReadableMap;
88
import com.facebook.react.bridge.ReadableMapKeySetIterator;
9+
import com.facebook.react.util.RNLog;
910
import com.heapanalytics.android.Heap;
1011
import com.heapanalytics.android.internal.HeapImpl;
1112

1213
import java.util.HashMap;
1314
import java.util.Map;
1415

15-
import android.util.Log;
16-
1716
public class RNHeapLibraryModule extends ReactContextBaseJavaModule {
1817

1918
private final ReactApplicationContext reactContext;
@@ -56,7 +55,7 @@ public void resetIdentity() {
5655
Heap.resetIdentity();
5756
}
5857

59-
private static Map<String, String> convertToStringMap(ReadableMap readableMap) {
58+
private Map<String, String> convertToStringMap(ReadableMap readableMap, String method) {
6059
if (readableMap == null) {
6160
return null;
6261
}
@@ -83,20 +82,20 @@ private static Map<String, String> convertToStringMap(ReadableMap readableMap) {
8382
// The JS bridge will flatten maps and arrays in a uniform manner across both
8483
// platforms.
8584
// If we get them at this point, we shouldn't continue.
86-
Log.w("Property objects must be flattened before being sent across the JS bridge. If you get this warning please inspect for non-flattenable objects being sent to Heap");
85+
RNLog.w(this.reactContext, method + " received an incompatible property named " + key + " which will be ignored. Heap only accepts JSON-compatible properties such as strings, numbers, and booleans.");
8786
}
8887
}
8988
return stringMap;
9089
}
9190

9291
@ReactMethod
9392
public void addUserProperties(ReadableMap properties) {
94-
Heap.addUserProperties(convertToStringMap(properties));
93+
Heap.addUserProperties(convertToStringMap(properties, "Heap.addUserProperties"));
9594
}
9695

9796
@ReactMethod
9897
public void addEventProperties(ReadableMap properties) {
99-
Heap.addEventProperties(convertToStringMap(properties));
98+
Heap.addEventProperties(convertToStringMap(properties, "Heap.addEventProperties"));
10099
}
101100

102101
@ReactMethod
@@ -111,11 +110,11 @@ public void removeEventProperty(String property) {
111110

112111
@ReactMethod
113112
public void autocaptureEvent(String event, ReadableMap payload) {
114-
HeapImpl.frameworkAutocaptureEvent(event, "react_native", convertToStringMap(payload));
113+
HeapImpl.frameworkAutocaptureEvent(event, "react_native", convertToStringMap(payload, "Heap.autocaptureEvent"));
115114
}
116115

117116
@ReactMethod
118117
public void manuallyTrackEvent(String event, ReadableMap payload, ReadableMap contextualProps) {
119-
HeapImpl.frameworkTrack(event, convertToStringMap(payload), "react_native", convertToStringMap(contextualProps));
118+
HeapImpl.frameworkTrack(event, convertToStringMap(payload, "Heap.track"), "react_native", convertToStringMap(contextualProps, "Heap.track"));
120119
}
121120
}

integration-tests/drivers/TestDriver063/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ buildscript {
1010
}
1111
repositories {
1212
google()
13-
jcenter()
13+
mavenCentral()
1414
}
1515
dependencies {
16-
classpath "com.android.tools.build:gradle:3.5.3"
16+
classpath "com.android.tools.build:gradle:3.5.4"
1717
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
1818
}
1919
}
2020

2121
allprojects {
2222
repositories {
23+
mavenCentral()
2324
mavenLocal()
2425
maven {
2526
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
@@ -35,7 +36,6 @@ allprojects {
3536
}
3637

3738
google()
38-
jcenter()
3939
maven { url 'https://www.jitpack.io' }
4040
}
4141
}

integration-tests/drivers/TestDriver063/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ android.useAndroidX=true
2626
android.enableJetifier=true
2727

2828
# Version of flipper SDK to use with React Native
29-
FLIPPER_VERSION=0.54.0
29+
FLIPPER_VERSION=0.99.0

0 commit comments

Comments
 (0)