Skip to content

Commit

Permalink
Merged in release/16.2.1 (pull request #83)
Browse files Browse the repository at this point in the history
Release/16.2.1
  • Loading branch information
mstanic-shake committed Dec 12, 2023
2 parents 7449990 + 24374ab commit 1078585
Show file tree
Hide file tree
Showing 21 changed files with 1,602 additions and 5,217 deletions.
12 changes: 12 additions & 0 deletions .run/iOS.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="iOS" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/example/package.json" />
<command value="run" />
<scripts>
<script value="ios" />
</scripts>
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>
59 changes: 21 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,44 +34,6 @@ Install pods from the project root directory:
cd ios && pod install && cd ..
```

### Set compileSdkVersion version in the build.gradle file

Since Shake requires `compileSdkVersion` 29 or greater, verify that `compileSdkVersion` is correctly set in the *build.gradle* file:

```groovy title="android/build.gradle"
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "20.1.5948944"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.1")
}
}
```

### Set multidexEnabled flag in the build.gradle file

If you do not have *multiDexEnabled* flag set, update app-level *build.gradle* like below:

```groovy title="app/build.gradle"
defaultConfig {
applicationId "com.shakebugs.react.example"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0.0"
multiDexEnabled true
}
```

### Start Shake

Call `Shake.start()` method in the *index.js* file.
Expand All @@ -89,6 +51,27 @@ Shake.start('client-id', 'client-secret');

Replace `client-id` and `client-secret` with the actual values you have in [your workspace settings](https://app.shakebugs.com/settings/workspace#general).

## Troubleshooting

If you get the following error during the build time:

```
Execution failed for task ':app:mergeDexDebug'.
```

You should set *multiDexEnabled* flag in app-level *build.gradle* like below:

```groovy title="app/build.gradle"
defaultConfig {
applicationId "com.shakebugs.react.example"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0.0"
multiDexEnabled true
}
```

## Resources

- [Official docs](https://www.shakebugs.com/docs/)
263 changes: 0 additions & 263 deletions android/src/development/google-services.json

This file was deleted.

5 changes: 5 additions & 0 deletions android/src/main/java/com/shakebugs/react/ShakeModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ public void run() {
});
}

@ReactMethod
public void setTags(final ReadableArray tagsArray) {
Shake.getReportConfiguration().setTags(mapper.mapToTagsList(tagsArray));
}

/*
* Callbacks starters.
*/
Expand Down
10 changes: 10 additions & 0 deletions android/src/main/java/com/shakebugs/react/utils/Mapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,16 @@ public ChatNotification mapToChatNotification(ReadableMap notificationData) {
return chatNotification;
}

public List<String> mapToTagsList(ReadableArray tagsArray) {
if (tagsArray == null) return null;

ArrayList<String> tags = new ArrayList<>();
for (int i = 0; i < tagsArray.size(); i++) {
tags.add(tagsArray.getString(i));
}
return tags;
}

private Map<String, Object> toMap(ReadableMap readableMap) {

Map<String, Object> map = new HashMap<>();
Expand Down
Loading

0 comments on commit 1078585

Please sign in to comment.