Skip to content

Commit

Permalink
Merged in release/17.0.0 (pull request #87)
Browse files Browse the repository at this point in the history
Release/17.0.0
  • Loading branch information
mstanic-shake committed May 29, 2024
2 parents 1078585 + 530e649 commit eca8fbd
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 76 deletions.
28 changes: 4 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,38 +39,18 @@ cd ios && pod install && cd ..
Call `Shake.start()` method in the *index.js* file.

```javascript title="index.js"
import {AppRegistry} from 'react-native';
import {AppRegistry, Platform} from 'react-native';
import App from './src/App';
import {name as appName} from './app.json';
import Shake from '@shakebugs/react-native-shake';

AppRegistry.registerComponent(appName, () => App);

Shake.start('client-id', 'client-secret');
const apiKey = Platform.OS === 'ios' ? 'ios-app-api-key' : 'android-app-api-key';
Shake.start(apiKey);
```

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
}
```
Replace `ios-app-api-key` and `android-app-api-key` with the actual values you have in your app settings.

## Resources

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ repositories {
dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules
api "$System.env.ANDROID_DEPENDENCY:16.2.+"
api "$System.env.ANDROID_DEPENDENCY:17.0.+"
}
6 changes: 3 additions & 3 deletions android/src/main/java/com/shakebugs/react/ShakeModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,18 @@ private ShakeInfo buildShakePlatformInfo() {
}

@ReactMethod
public void start(final String clientId, final String clientSecret, final Promise promise) {
public void start(final String apiKey, final Promise promise) {
getReactApplicationContext().runOnUiQueueThread(new Runnable() {
@Override
public void run() {
ShakeReflection.setShakeInfo(buildShakePlatformInfo());

Activity activity = getCurrentActivity();
if (activity != null) {
ShakeReflection.start(activity, clientId, clientSecret);
ShakeReflection.start(activity, apiKey);
} else {
Application app = (Application) getReactApplicationContext().getApplicationContext();
Shake.start(app, clientId, clientSecret);
Shake.start(app, apiKey);
}

startShakeCallbacksEmitter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
public class ShakeReflection {
private static final String CLASS_NAME = "com.shakebugs.shake.Shake";

public static void start(Activity activity, String clientId, String clientSecret) {
public static void start(Activity activity, String apiKey) {
try {
Method method = Reflection.getMethod(Class.forName(CLASS_NAME), "startFromWrapper", Activity.class, String.class, String.class);
Method method = Reflection.getMethod(Class.forName(CLASS_NAME), "startFromWrapper", Activity.class, String.class);
//noinspection ConstantConditions
method.invoke(null, activity, clientId, clientSecret);
method.invoke(null, activity, apiKey);
} catch (Exception e) {
Logger.e("Failed to start Shake", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
public class Constants {
public static final String PLATFORM = "ReactNative";
public static final String VERSION_CODE = "1";
public static final String VERSION_NAME = "16.2.0";
public static final String VERSION_NAME = "17.0.0";
}
11 changes: 6 additions & 5 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import Shake from 'react-native-shake';
import messaging from '@react-native-firebase/messaging';

const startShake = async () => {
const CLIENT_ID = 'HtTFUmUziF5Qjk1XLraAJXtVB1cL62yHWWqsDnrG';
const CLIENT_SECRET =
'IPRqEI2iSQhmUP6NGQcPNKCs7JQCJrpFUG0qDmLx4Yx2spd3caXnC3o';

Shake.setInvokeShakeOnScreenshot(true);
Shake.setInvokeShakeOnShakeDeviceEvent(true);
Shake.setShowFloatingReportButton(true);
Expand All @@ -30,7 +26,12 @@ const startShake = async () => {
console.log('Shake submitted!');
});

await Shake.start(CLIENT_ID, CLIENT_SECRET);
const apiKey =
Platform.OS === 'ios'
? 'Ny6x1eMCwSTNltepD8vLQ6iiYXqatEp2nWM7cFGM01opctfQfC802wf'
: 'K9CeeyYp8aWIIWrKnT63c9StRXQa05pWzP1rYruYsIvmg1q0brwuvGM';
await Shake.start(apiKey);

Shake.registerUser('test_user');
};

Expand Down
52 changes: 30 additions & 22 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ PODS:
- GoogleUtilities/Logger (~> 7.8)
- FirebaseCoreExtension (10.12.0):
- FirebaseCore (~> 10.0)
- FirebaseCoreInternal (10.18.0):
- FirebaseCoreInternal (10.25.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseInstallations (10.18.0):
- FirebaseInstallations (10.25.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
Expand All @@ -39,27 +39,35 @@ PODS:
- nanopb (< 2.30910.0, >= 2.30908.0)
- fmt (6.2.1)
- glog (0.3.5)
- GoogleDataTransport (9.2.5):
- GoogleDataTransport (9.4.1):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- nanopb (< 2.30911.0, >= 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/AppDelegateSwizzler (7.12.0):
- GoogleUtilities/AppDelegateSwizzler (7.13.3):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (7.12.0):
- GoogleUtilities/Privacy
- GoogleUtilities/Environment (7.13.3):
- GoogleUtilities/Privacy
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.12.0):
- GoogleUtilities/Logger (7.13.3):
- GoogleUtilities/Environment
- GoogleUtilities/Network (7.12.0):
- GoogleUtilities/Privacy
- GoogleUtilities/Network (7.13.3):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Privacy
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (7.12.0)"
- GoogleUtilities/Reachability (7.12.0):
- "GoogleUtilities/NSData+zlib (7.13.3)":
- GoogleUtilities/Privacy
- GoogleUtilities/Privacy (7.13.3)
- GoogleUtilities/Reachability (7.13.3):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (7.12.0):
- GoogleUtilities/Privacy
- GoogleUtilities/UserDefaults (7.13.3):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- hermes-engine (0.71.14):
- hermes-engine/Pre-built (= 0.71.14)
- hermes-engine/Pre-built (0.71.14)
Expand All @@ -69,7 +77,7 @@ PODS:
- nanopb/encode (= 2.30909.1)
- nanopb/decode (2.30909.1)
- nanopb/encode (2.30909.1)
- PromisesObjC (2.3.1)
- PromisesObjC (2.4.0)
- RCT-Folly (2021.07.22.00):
- boost
- DoubleConversion
Expand Down Expand Up @@ -329,7 +337,7 @@ PODS:
- ReactCommon/turbomodule/core
- react-native-shake (16.2.0):
- React
- Shake-Staging (~> 16.2.0-rc)
- Shake-Staging (~> 17.0.0-rc)
- react-native-slider (4.4.2):
- React-Core
- React-perflogger (0.71.14)
Expand Down Expand Up @@ -469,7 +477,7 @@ PODS:
- RNScreens (3.20.0):
- React-Core
- React-RCTImage
- Shake-Staging (16.2.2-rc.1586)
- Shake-Staging (17.0.0-rc.1603)
- Yoga (1.14.0)

DEPENDENCIES:
Expand Down Expand Up @@ -649,17 +657,17 @@ SPEC CHECKSUMS:
Firebase: 07150e75d142fb9399f6777fa56a187b17f833a0
FirebaseCore: f86a1394906b97ac445ae49c92552a9425831bed
FirebaseCoreExtension: 0ce5ac36042001cfa233ce7bfa28e5c313cf80f4
FirebaseCoreInternal: 8eb002e564b533bdcf1ba011f33f2b5c10e2ed4a
FirebaseInstallations: e842042ec6ac1fd2e37d7706363ebe7f662afea4
FirebaseCoreInternal: 910a81992c33715fec9263ca7381d59ab3a750b7
FirebaseInstallations: 91950fe859846fff0fbd296180909dd273103b09
FirebaseMessaging: bb2c4f6422a753038fe137d90ae7c1af57251316
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
hermes-engine: d7cc127932c89c53374452d6f93473f1970d8e88
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: e9df143e880d0e879e7a498dc06923d728809c79
RCTTypeSafety: c2d89c8308829c12c038ec1f431191eaa0d8c15c
Expand All @@ -675,7 +683,7 @@ SPEC CHECKSUMS:
React-jsinspector: 7bf923954b4e035f494b01ac16633963412660d7
React-logger: 655ff5db8bd922acfbe76a4983ffab048916343e
react-native-safe-area-context: 39c2d8be3328df5d437ac1700f4f3a4f75716acc
react-native-shake: 11bfe589c915b008a4c39e85965de8b604604c20
react-native-shake: 4a919b9b093747b790d35effd4f1b0d0d4958fa5
react-native-slider: 33b8d190b59d4f67a541061bb91775d53d617d9d
React-perflogger: 4987ad83731c23d11813c84263963b0d3028c966
React-RCTActionSheet: 5ad952b2a9740d87a5bd77280c4bc23f6f89ea0c
Expand All @@ -701,9 +709,9 @@ SPEC CHECKSUMS:
RNGestureHandler: 071d7a9ad81e8b83fe7663b303d132406a7d8f39
RNReanimated: f0dd6b881808e635ef0673f89642937d6c141314
RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f
Shake-Staging: fc62dde4ce849ae43ba6d932c42b75fe1be6c492
Shake-Staging: 923b41d9c902e1f02e87acbe5f6899d905b76e60
Yoga: e71803b4c1fff832ccf9b92541e00f9b873119b9

PODFILE CHECKSUM: 851bc641080bb227691dcf7987476de3f8a70a9e

COCOAPODS: 1.12.1
COCOAPODS: 1.14.3
20 changes: 20 additions & 0 deletions example/ios/example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,20 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreInternal/FirebaseCoreInternal_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations/FirebaseInstallations_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCoreInternal_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseInstallations_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleDataTransport_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleUtilities_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FBLPromises_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -446,10 +456,20 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreInternal/FirebaseCoreInternal_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations/FirebaseInstallations_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises_Privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseCoreInternal_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FirebaseInstallations_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleDataTransport_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleUtilities_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FBLPromises_Privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "example",
"version": "16.2.0",
"version": "17.0.0",
"private": true,
"config": {
"android": {
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module "react-native-shake" {
export function start(clientId: string, clientSecret: string): Promise<void>;
export function start(apiKey: string): Promise<void>;

export function show(): void;

Expand Down
9 changes: 4 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export { ShakeSubmitAction };
export { ChatNotification };

/**
* Interface for native methods.
* Shake SDK interface.
*/
class Shake {
static shake = NativeModules.RNShake;
Expand All @@ -73,11 +73,10 @@ class Shake {
/**
* Starts Shake SDK.
*
* @param clientId client id
* @param clientSecret client secret
* @param apiKey api key
*/
static async start(clientId, clientSecret) {
await this.shake.start(clientId, clientSecret);
static async start(apiKey) {
await this.shake.start(apiKey);
this.notificationTracker.setEnabled(true);
this.homeActionsTracker.setEnabled(true);
this.shakeCallbacks.startListening();
Expand Down
7 changes: 3 additions & 4 deletions ios/RNShake.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ - (dispatch_queue_t)methodQueue

RCT_EXPORT_MODULE()

RCT_REMAP_METHOD(start, clientId:(NSString*)clientId clientSecret:(NSString*)clientSecret startResolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
RCT_REMAP_METHOD(start, apiKey:(NSString*)apiKey startResolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
{
[SHKShake startWithClientId:clientId clientSecret:clientSecret];
[SHKShake startWithApiKey:apiKey];

/// Forward Shake callbacks to the RN
SHKShake.configuration.shakeOpenListener = ^() {
Expand Down Expand Up @@ -857,7 +856,7 @@ - (void)setPlatformInfo
{
NSDictionary *shakeInfo = @{
@"platform": @"ReactNative",
@"sdkVersion": @"16.2.0"
@"sdkVersion": @"17.0.0"
};
[SHKShake performSelector:sel_getUid(@"_setPlatformAndSDKVersion:".UTF8String) withObject:shakeInfo];
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-native-shake",
"title": "React Native Shake SDK",
"version": "16.2.0",
"version": "17.0.0",
"description": "Shake SDK wrapper",
"main": "index.js",
"scripts": {
Expand Down
10 changes: 5 additions & 5 deletions react-native-shake.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ Pod::Spec.new do |s|
s.version = package["version"]
s.summary = package["description"]
s.description = <<-DESC
react-native-shake
Bug reporting SDK for React Native apps
DESC
s.homepage = "https://github.com/github_account/react-native-shake"
s.homepage = "https://www.shakebugs.com"
# brief license entry:
s.license = "MIT"
# optional - use expanded license entry instead:
# s.license = { :type => "MIT", :file => "LICENSE" }
s.authors = { "Your Name" => "yourname@email.com" }
s.authors = { "Shakebugs" => "friends@shakebugs.com" }
s.platforms = { :ios => "9.0" }
s.source = { :git => "https://github.com/github_account/react-native-shake.git", :tag => "#{s.version}" }
s.source = { :git => "https://github.com/shakebugs/shake-react-native", :tag => "#{s.version}" }

s.source_files = "ios/**/*.{h,m,swift}"
s.requires_arc = true

s.dependency "React"
s.dependency "#{ENV['IOS_DEPENDENCY']}", "~> 16.2.0-rc"
s.dependency "#{ENV['IOS_DEPENDENCY']}", "~> 17.0.0-rc"
# ...
# s.dependency "..."
end
Expand Down

0 comments on commit eca8fbd

Please sign in to comment.