diff --git a/RNSentry.podspec b/RNSentry.podspec new file mode 100644 index 0000000000..2d30600c2e --- /dev/null +++ b/RNSentry.podspec @@ -0,0 +1,23 @@ +require 'json' +version = JSON.parse(File.read('package.json'))["version"] + +Pod::Spec.new do |s| + s.name = 'RNSentry' + s.version = version + s.license = 'MIT' + s.summary = 'Official Sentry SDK for react-native' + s.author = 'Sentry' + s.homepage = "https://github.com/getsentry/sentry-react-native" + s.source = { :git => 'https://github.com/getsentry/sentry-react-native.git', :tag => "#{s.version}"} + + s.ios.deployment_target = "8.0" + s.tvos.deployment_target = "9.0" + + s.preserve_paths = '*.js' + + s.dependency 'React' + s.dependency 'Sentry', '~> 4.4.0' + + s.source_files = 'ios/RNSentry.{h,m}' + s.public_header_files = 'ios/RNSentry.h' +end diff --git a/SentryReactNative.podspec b/SentryReactNative.podspec deleted file mode 100644 index 1f7866ccd7..0000000000 --- a/SentryReactNative.podspec +++ /dev/null @@ -1,25 +0,0 @@ -require 'json' - -Pod::Spec.new do |s| - # NPM package specification - package = JSON.parse(File.read(File.join(File.dirname(__FILE__), 'package.json'))) - - s.name = 'SentryReactNative' - s.version = package['version'] - s.license = 'MIT' - s.summary = 'Official Sentry SDK for react-native' - s.author = 'Sentry' - s.homepage = "https://github.com/getsentry/react-native-sentry" - s.source = { :git => 'https://github.com/getsentry/react-native-sentry.git', :tag => "#{s.version}"} - - s.ios.deployment_target = "8.0" - s.tvos.deployment_target = "9.0" - - s.preserve_paths = '*.js' - - s.dependency 'React' - s.dependency 'Sentry', '~> 4.3.4' - - s.source_files = 'src/ios/RNSentry*.{h,m}' - s.public_header_files = 'src/ios/RNSentry.h' -end diff --git a/android/src/main/java/io/sentry/RNSentryModule.java b/android/src/main/java/io/sentry/RNSentryModule.java index 2bdbf4720d..dba5265cfa 100644 --- a/android/src/main/java/io/sentry/RNSentryModule.java +++ b/android/src/main/java/io/sentry/RNSentryModule.java @@ -3,7 +3,6 @@ import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; -import android.support.annotation.NonNull; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.Promise; @@ -249,7 +248,6 @@ public void sendEvent(ReadableMap event, Promise promise) { promise.resolve(true); } - @NonNull private UserBuilder getUserBuilder(ReadableMap user) { UserBuilder userBuilder = new UserBuilder(); if (user.hasKey("email")) { diff --git a/ios/Sentry b/ios/Sentry index 52f057f31c..3c7ff35cc0 160000 --- a/ios/Sentry +++ b/ios/Sentry @@ -1 +1 @@ -Subproject commit 52f057f31cceb326cb68ca1212ea96c2f0ad53db +Subproject commit 3c7ff35cc03bd05ce9d50a87b5c3162a5460a8b5 diff --git a/package.json b/package.json index e36aa65f94..3bfb04f81e 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,14 @@ "@sentry/utils": "^5.4.2", "@sentry/wizard": "^1.0.0" }, + "devDependencies": { + "@sentry/typescript": "5.*", + "@types/react-native": "^0.57.57", + "prettier": "^1.17.0", + "replace-in-file": "^4.0.0", + "rimraf": "^2.6.3", + "typescript": "^3.4.5" + }, "rnpm": { "commands": { "postlink": "node node_modules/@sentry/wizard/dist/bin.js -i reactNative -p ios android", @@ -50,13 +58,5 @@ "libz" ] } - }, - "devDependencies": { - "@sentry/typescript": "5.*", - "@types/react-native": "^0.57.57", - "prettier": "^1.17.0", - "replace-in-file": "^4.0.0", - "rimraf": "^2.6.3", - "typescript": "^3.4.5" } } diff --git a/react-native.config.js b/react-native.config.js new file mode 100644 index 0000000000..59801ea31a --- /dev/null +++ b/react-native.config.js @@ -0,0 +1,18 @@ +module.exports = { + dependency: { + platforms: { + ios: { + sharedLibraries: ["libz"] + }, + android: { + packageInstance: "new RNSentryPackage()" + } + }, + hooks: { + postlink: + "node node_modules/@sentry/wizard/dist/bin.js -i reactNative -p ios android", + postunlink: + "node node_modules/@sentry/wizard/dist/bin.js -i reactNative -p ios android --uninstall" + } + } +}; diff --git a/src/js/backend.ts b/src/js/backend.ts index fd57b99b32..e295ee027d 100644 --- a/src/js/backend.ts +++ b/src/js/backend.ts @@ -94,6 +94,7 @@ export class ReactNativeBackend extends BaseBackend { private _isNativeTransportAvailable(): boolean { return ( this._options.enableNative && + RNSentry && RNSentry.nativeClientAvailable && RNSentry.nativeTransport ); diff --git a/src/js/sdk.ts b/src/js/sdk.ts index 904740ee54..75d286fef2 100644 --- a/src/js/sdk.ts +++ b/src/js/sdk.ts @@ -39,7 +39,8 @@ export function init( i => !IGNORED_DEFAULT_INTEGRATIONS.includes(i.name) ), new Integrations.Breadcrumbs({ - fetch: false + fetch: false, + console: false // If this in enabled it causes problems to native calls on >= RN 0.60 }), new RewriteFrames({ iteratee: (frame: StackFrame) => {