Skip to content

Commit

Permalink
Merged in release/15.1.0 (pull request #58)
Browse files Browse the repository at this point in the history
Release/15.1.0
  • Loading branch information
mstanic-shake committed Dec 24, 2021
2 parents 7b6307f + 14041b2 commit b68b8d4
Show file tree
Hide file tree
Showing 20 changed files with 767 additions and 592 deletions.
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# Shake for React Native
# Shake React Native SDK

[Shake](https://www.shakebugs.com) plugin for React Native.
[![npm version](https://badge.fury.io/js/@shakebugs%2Freact-native-shake.svg)](https://badge.fury.io/js/@shakebugs%2Freact-native-shake)

React Native plugin for [bug reporting](https://www.shakebugs.com).

## Features

| Feature | Available |
|:-----------------:|:-----------:|
| Bug reporting ||
| Crash reporting ||
| Users ||

## Requirements

| Platform | Version |
|:--------------:|:---------:|
| React Native | 0.56 |
| Android | 5.0 |
| iOS | 12.0 |

## How to use

Expand All @@ -26,7 +44,7 @@ Install pods from the project root directory:
cd ios && pod install && cd ..
```

## Start Shake
### Start Shake
Call `Shake.start()` method in the *index.js* file.

```javascript title="index.js"
Expand All @@ -42,6 +60,6 @@ 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).

## Documentation
## Resources

Visit [documentation](https://www.shakebugs.com/docs) for more details.
- [Official docs](https://www.shakebugs.com/docs/)
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ repositories {
dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules
api "$System.env.ANDROID_DEPENDENCY:15.0.+"
api "$System.env.ANDROID_DEPENDENCY:15.1.+"
}

def configureReactNativePom(def pom) {
Expand Down
33 changes: 31 additions & 2 deletions android/src/main/java/com/shakebugs/react/ShakeModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import com.shakebugs.shake.ShakeInfo;
import com.shakebugs.shake.ShakeReportConfiguration;
import com.shakebugs.shake.ShakeScreen;
import com.shakebugs.shake.internal.data.NetworkRequest;
import com.shakebugs.shake.internal.data.NotificationEvent;
import com.shakebugs.shake.internal.domain.models.NetworkRequest;
import com.shakebugs.shake.internal.domain.models.NotificationEvent;
import com.shakebugs.shake.privacy.NotificationEventEditor;
import com.shakebugs.shake.privacy.NotificationEventsFilter;
import com.shakebugs.shake.report.FeedbackType;
Expand Down Expand Up @@ -195,6 +195,25 @@ public void run() {
});
}

@ReactMethod
public void getDefaultScreen(Promise promise) {
ShakeScreen shakeScreen = Shake.getReportConfiguration().getDefaultScreen();
String shakeScreenStr = shakeScreen.toString();

promise.resolve(shakeScreenStr);
}

@ReactMethod
public void setDefaultScreen(final ReadableMap shakeScreenMap) {
runOnUiThread(new Runnable() {
@Override
public void run() {
ShakeScreen shakeScreen = mapper.mapToShakeScreen(shakeScreenMap);
Shake.getReportConfiguration().setDefaultScreen(shakeScreen);
}
});
}

@ReactMethod
public void isScreenshotIncluded(Promise promise) {
promise.resolve(Shake.getReportConfiguration().isScreenshotIncluded());
Expand Down Expand Up @@ -355,6 +374,16 @@ public void run() {
});
}

@ReactMethod
public void clearMetadata() {
runOnUiThread(new Runnable() {
@Override
public void run() {
Shake.clearMetadata();
}
});
}

@ReactMethod
public void setShakeReportData(final ReadableArray filesArray) {
runOnUiThread(new Runnable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import com.shakebugs.react.utils.Logger;
import com.shakebugs.react.utils.Reflection;
import com.shakebugs.shake.ShakeInfo;
import com.shakebugs.shake.internal.data.NetworkRequest;
import com.shakebugs.shake.internal.data.NotificationEvent;
import com.shakebugs.shake.internal.domain.models.NetworkRequest;
import com.shakebugs.shake.internal.domain.models.NotificationEvent;

import java.lang.reflect.Method;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.shakebugs.shake.internal.data.NotificationEvent;
import com.shakebugs.shake.internal.domain.models.NotificationEvent;

public class Emitter {
private static final String EVENT_NOTIFICATION = "EventNotification";
Expand Down
13 changes: 9 additions & 4 deletions android/src/main/java/com/shakebugs/react/utils/Mapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import com.shakebugs.shake.LogLevel;
import com.shakebugs.shake.ShakeReportConfiguration;
import com.shakebugs.shake.ShakeScreen;
import com.shakebugs.shake.internal.data.NetworkRequest;
import com.shakebugs.shake.internal.data.NotificationEvent;
import com.shakebugs.shake.internal.domain.models.NetworkRequest;
import com.shakebugs.shake.internal.domain.models.NotificationEvent;
import com.shakebugs.shake.report.FeedbackType;
import com.shakebugs.shake.report.ShakeFile;

Expand Down Expand Up @@ -63,12 +63,14 @@ public ShakeReportConfiguration mapToConfiguration(ReadableMap configurationMap)
boolean blackBoxData = configurationMap.getBoolean("blackBoxData");
boolean activityHistoryData = configurationMap.getBoolean("activityHistoryData");
boolean screenshot = configurationMap.getBoolean("screenshot");
boolean video = configurationMap.getBoolean("video");
boolean showReportSentMessage = configurationMap.getBoolean("showReportSentMessage");

ShakeReportConfiguration configuration = new ShakeReportConfiguration();
configuration.blackBoxData = blackBoxData;
configuration.activityHistoryData = activityHistoryData;
configuration.screenshot = screenshot;
configuration.video = video;
configuration.showReportSentMessage = showReportSentMessage;

return configuration;
Expand Down Expand Up @@ -233,10 +235,13 @@ private Map<String, Object> toMap(ReadableMap readableMap) {
map.put(key, readableMap.getString(key));
break;
case Map:
map.put(key, toMap(readableMap.getMap(key)));
ReadableMap m = readableMap.getMap(key);
if (m != null) map.put(key, toMap(m));

break;
case Array:
map.put(key, toArray(readableMap.getArray(key)));
ReadableArray a = readableMap.getArray(key);
if (a != null) map.put(key, toArray(a));
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Shake</string>
<string name="app_name">Shake RN</string>
</resources>
6 changes: 2 additions & 4 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source 'https://github.com/CocoaPods/Specs.git'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
platform :ios, '12.0'

project 'example',
'DevelopmentDebug' => :debug,
Expand All @@ -15,6 +15,7 @@ project 'example',
'ProductionRelease' => :release

target 'example' do

pod 'RNFS', :path => '../node_modules/react-native-fs'
pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'

Expand All @@ -39,8 +40,5 @@ target 'example' do

post_install do |installer|
react_native_post_install(installer)
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
13 changes: 7 additions & 6 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ PODS:
- React
- react-native-shake (14.1.0):
- React
- Shake (~> 15.0.0)
- Shake-Staging (~> 15.1.0-rc.1447)
- react-native-slider (2.0.9):
- React
- react-native-webview (9.3.0):
Expand Down Expand Up @@ -362,7 +362,7 @@ PODS:
- React
- RNScreens (2.7.0):
- React
- Shake (15.0.0)
- Shake-Staging (15.1.0-rc.1447)
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)
Expand Down Expand Up @@ -435,6 +435,8 @@ DEPENDENCIES:
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
"[email protected]:shakebugs/Specs.git":
- Shake-Staging
https://github.com/CocoaPods/Specs.git:
- boost-for-react-native
- CocoaAsyncSocket
Expand All @@ -450,7 +452,6 @@ SPEC REPOS:
- fmt
- libevent
- OpenSSL-Universal
- Shake
- YogaKit

EXTERNAL SOURCES:
Expand Down Expand Up @@ -572,7 +573,7 @@ SPEC CHECKSUMS:
react-native-checkbox: 2d04aeb0c7e2c2cbd9a9a902ca6a5cf642688d09
react-native-maps: f4b89da81626ad7f151a8bfcb79733295d31ce5c
react-native-safe-area-context: 8260e5157617df4b72865f44006797f895b2ada7
react-native-shake: 91238bed6328fc1bbdefa922c1605acce7a81313
react-native-shake: 9b00818158045abdb40f16e8ce3c039e39c9f8b4
react-native-slider: b34d943dc60deb96d952ba6b6b249aa8091e86da
react-native-webview: bdde2a3c4cbdc0122bc2bfba13603db193f0cc5c
React-perflogger: fd28ee1f2b5b150b00043f0301d96bd417fdc339
Expand All @@ -595,10 +596,10 @@ SPEC CHECKSUMS:
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNReanimated: 955cf4068714003d2f1a6e2bae3fb1118f359aff
RNScreens: cf198f915f8a2bf163de94ca9f5bfc8d326c3706
Shake: c5032f2a9dbfa2a8c33002609567f44a42176525
Shake-Staging: 1e48bab5826b8192d7c0a3917f3e1e7d44d6b02e
Yoga: aa0cb45287ebe1004c02a13f279c55a95f1572f4
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: f74bd3ae7cb43084c3aa4afe2dc911740679de66
PODFILE CHECKSUM: 3d68bab78d41ff5c76df688461c486e9826619d6

COCOAPODS: 1.11.2
Loading

0 comments on commit b68b8d4

Please sign in to comment.