Skip to content

Commit

Permalink
fix: AndroidX, Autolink, Cocoapods (#613)
Browse files Browse the repository at this point in the history
* fix: AndroidX, Autolink, Cocoapods

* fix: Readd rnpm section in package.json to support older versions
  • Loading branch information
HazAT authored Jul 4, 2019
1 parent fd1c5ed commit 2ff3ab3
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 37 deletions.
23 changes: 23 additions & 0 deletions RNSentry.podspec
Original file line number Diff line number Diff line change
@@ -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
25 changes: 0 additions & 25 deletions SentryReactNative.podspec

This file was deleted.

2 changes: 0 additions & 2 deletions android/src/main/java/io/sentry/RNSentryModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")) {
Expand Down
2 changes: 1 addition & 1 deletion ios/Sentry
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
18 changes: 18 additions & 0 deletions react-native.config.js
Original file line number Diff line number Diff line change
@@ -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"
}
}
};
1 change: 1 addition & 0 deletions src/js/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export class ReactNativeBackend extends BaseBackend<BrowserOptions> {
private _isNativeTransportAvailable(): boolean {
return (
this._options.enableNative &&
RNSentry &&
RNSentry.nativeClientAvailable &&
RNSentry.nativeTransport
);
Expand Down
3 changes: 2 additions & 1 deletion src/js/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 2ff3ab3

Please sign in to comment.