Skip to content

Commit

Permalink
Merge pull request #359 from heap/develop
Browse files Browse the repository at this point in the history
Cut 0.22.1 Release
  • Loading branch information
bnickel authored Dec 2, 2022
2 parents 9f144be + 2125a9f commit f2237fb
Show file tree
Hide file tree
Showing 17 changed files with 1,984 additions and 1,134 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,24 @@ __BEGIN_UNRELEASED__
### Security
__END_UNRELEASED__

## [0.22.1] - 2022-12-02

### Changed

- Switched repositories from jcenter to mavenCentral.

### Fixed

- Fixed Android compilation, moving log to `RNLog.w`.

## [0.22.0] - 2022-09-23

### Added

- Added tests for sending bad data to the native bridge

### Changed

- Changed track bridge to warn instead of throw an exception when bad data is sent.
- Upgraded iOS sdk from 8.2 to 9.0

Expand Down
3 changes: 1 addition & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def heapAppId(buildType) {

buildscript {
repositories {
jcenter()
mavenCentral()
google()
}

Expand Down Expand Up @@ -75,7 +75,6 @@ android {

repositories {
mavenCentral()
jcenter()
google()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableMapKeySetIterator;
import com.facebook.react.util.RNLog;
import com.heapanalytics.android.Heap;
import com.heapanalytics.android.internal.HeapImpl;

import java.util.HashMap;
import java.util.Map;

import android.util.Log;

public class RNHeapLibraryModule extends ReactContextBaseJavaModule {

private final ReactApplicationContext reactContext;
Expand Down Expand Up @@ -56,7 +55,7 @@ public void resetIdentity() {
Heap.resetIdentity();
}

private static Map<String, String> convertToStringMap(ReadableMap readableMap) {
private Map<String, String> convertToStringMap(ReadableMap readableMap, String method) {
if (readableMap == null) {
return null;
}
Expand All @@ -83,20 +82,20 @@ private static Map<String, String> convertToStringMap(ReadableMap readableMap) {
// The JS bridge will flatten maps and arrays in a uniform manner across both
// platforms.
// If we get them at this point, we shouldn't continue.
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");
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.");
}
}
return stringMap;
}

@ReactMethod
public void addUserProperties(ReadableMap properties) {
Heap.addUserProperties(convertToStringMap(properties));
Heap.addUserProperties(convertToStringMap(properties, "Heap.addUserProperties"));
}

@ReactMethod
public void addEventProperties(ReadableMap properties) {
Heap.addEventProperties(convertToStringMap(properties));
Heap.addEventProperties(convertToStringMap(properties, "Heap.addEventProperties"));
}

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

@ReactMethod
public void autocaptureEvent(String event, ReadableMap payload) {
HeapImpl.frameworkAutocaptureEvent(event, "react_native", convertToStringMap(payload));
HeapImpl.frameworkAutocaptureEvent(event, "react_native", convertToStringMap(payload, "Heap.autocaptureEvent"));
}

@ReactMethod
public void manuallyTrackEvent(String event, ReadableMap payload, ReadableMap contextualProps) {
HeapImpl.frameworkTrack(event, convertToStringMap(payload), "react_native", convertToStringMap(contextualProps));
HeapImpl.frameworkTrack(event, convertToStringMap(payload, "Heap.track"), "react_native", convertToStringMap(contextualProps, "Heap.track"));
}
}
6 changes: 3 additions & 3 deletions integration-tests/drivers/TestDriver063/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ buildscript {
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:3.5.3"
classpath "com.android.tools.build:gradle:3.5.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}

allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
Expand All @@ -35,7 +36,6 @@ allprojects {
}

google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ android.useAndroidX=true
android.enableJetifier=true

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.54.0
FLIPPER_VERSION=0.99.0
Loading

0 comments on commit f2237fb

Please sign in to comment.