Skip to content

Commit

Permalink
bump Android version (#250)
Browse files Browse the repository at this point in the history
* bump Android version

* add trackVerified() to example app

* expose fraud in initialize()

* change init

* update versionName, revert pk, update package-lock.json

* update iOS pods
  • Loading branch information
nickpatrick authored Aug 14, 2023
1 parent db21c04 commit 4bbb10c
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 18 deletions.
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {
minSdkVersion 16
targetSdkVersion 31
versionCode 1
versionName '3.8.2'
versionName '3.8.6'
}
lintOptions {
abortOnError false
Expand All @@ -45,5 +45,5 @@ repositories {

dependencies {
api 'com.facebook.react:react-native:+'
api 'io.radar:sdk:3.8.5'
api 'io.radar:sdk:3.8.6'
}
10 changes: 7 additions & 3 deletions android/src/main/java/io/radar/react/RNRadarModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ public String getName() {
}

@ReactMethod
public void initialize(String publishableKey) {
Radar.initialize(getReactApplicationContext(), publishableKey);
Radar.setReceiver(receiver);
public void initialize(String publishableKey, boolean fraud) {
if (fraud) {
Radar.initialize(getReactApplicationContext(), publishableKey, receiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud);
} else {
Radar.initialize(getReactApplicationContext(), publishableKey);
Radar.setReceiver(receiver);
}
}

@ReactMethod
Expand Down
15 changes: 14 additions & 1 deletion example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function App() {
const stringify = (obj) => JSON.stringify(obj, null, 2);

useEffect(() => {
Radar.initialize("prj_test_pk_4ce462a534c0f749af3fdaac6fff9f485d65e720");
Radar.initialize("prj_test_pk_0000000000000000000000000000000000000000", true);

Radar.setLogLevel("info");

Expand Down Expand Up @@ -479,6 +479,19 @@ export default function App() {
});
}}
/>

<ExampleButton
title="trackVerified"
onPress={() => {
Radar.trackVerified()
.then((result) => {
handlePopulateText("trackVerified:" + stringify(result));
})
.catch((err) => {
handlePopulateText("trackVerified:" + err);
});
}}
/>
</ScrollView>
</View>
</View>
Expand Down
1 change: 1 addition & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ dependencies {
strictly '1.3.1'
}
}
implementation 'com.google.android.play:integrity:1.0.2'
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ PODS:
- React-jsi (= 0.64.3)
- React-perflogger (= 0.64.3)
- React-jsinspector (0.64.3)
- react-native-radar (3.8.4):
- react-native-radar (3.8.5):
- RadarSDK (~> 3.8.4)
- React
- react-native-safe-area-context (3.3.2):
Expand Down Expand Up @@ -529,7 +529,7 @@ SPEC CHECKSUMS:
EXUpdates: 061b67c33f0e7f8fd335bbb48697c4a4fc8a5157
EXUpdatesInterface: e1c01b4f5ec76bd1d6cc714938f9edf5ef6379b9
FBLazyVector: c71c5917ec0ad2de41d5d06a5855f6d5eda06971
FBReactNativeSpec: d55cc83d9dc993d9832c60fb5343bf811f1cd092
FBReactNativeSpec: 0927ccb6f474e439386ebce65cccb07b9612e950
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
maplibre-react-native: f08cc1b867c4b3080b34955f8e2ce938361df4c2
RadarSDK: 00aac8132174517cd0de9b43af0aa168edaf5a4c
Expand All @@ -544,7 +544,7 @@ SPEC CHECKSUMS:
React-jsi: a8b09c29521c798f1783348b37b511ba7b3dbeb3
React-jsiexecutor: df6abc9fafbecb8e5b7a5fbc5e6d4bd017d594d5
React-jsinspector: 34e23860273a23695342f58eed3ffd3ba10c31e0
react-native-radar: 120e6fb7d2c87fe3ea917a5e83a86e53e36eee3c
react-native-radar: 387abf87eb20ad528ee5bd5cd81fa57e8a230475
react-native-safe-area-context: 584dc04881deb49474363f3be89e4ca0e854c057
React-perflogger: cc76a4254d19640f1d8ad1c66fdee800414b805c
React-RCTActionSheet: 7448f049318d8d7e8a9a1ebb742ada721757eea8
Expand All @@ -567,4 +567,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: ac3241f9540525d739bc6e1ec2f5381dee057b14

COCOAPODS: 1.11.3
COCOAPODS: 1.12.1
2 changes: 1 addition & 1 deletion example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7523,7 +7523,7 @@

"react-native-radar@../":
"resolved" "file:.."
"version" "3.8.4"
"version" "3.8.5"
dependencies:
"@babel/runtime" "^7.21.0"
"@react-native-community/netinfo" "^7.1.3"
Expand Down
2 changes: 1 addition & 1 deletion ios/RNRadar.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ - (void)didLogMessage:(NSString *)message {
}
}

RCT_EXPORT_METHOD(initialize:(NSString *)publishableKey) {
RCT_EXPORT_METHOD(initialize:(NSString *)publishableKey fraud:(BOOL)fraud) {
[Radar initializeWithPublishableKey:publishableKey];
}

Expand Down
4 changes: 2 additions & 2 deletions js/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ if (!NativeModules.RNRadar && (Platform.OS === 'ios' || Platform.OS === 'android

const eventEmitter = new NativeEventEmitter(NativeModules.RNRadar);

const initialize = (publishableKey) => {
NativeModules.RNRadar.initialize(publishableKey);
const initialize = (publishableKey, fraud) => {
NativeModules.RNRadar.initialize(publishableKey, fraud);
};

const setLogLevel = (level) => {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "React Native module for Radar, the leading geofencing and location tracking platform",
"homepage": "https://radar.com",
"license": "Apache-2.0",
"version": "3.8.4",
"version": "3.8.5",
"main": "js/index.js",
"files": [
"android",
Expand Down

0 comments on commit 4bbb10c

Please sign in to comment.