Skip to content

Add convinient helper for react native projects #22

Description

@HazAT
react-native init AwesomeProject
cd AwesomeProject
  • Change package.json add local file dependency in for sentry-react-native
"sentry-react-native": "file:../sentry-react-native"
  • npm install
  • react-native link sentry-react-native
  • open ios/AwesomeProject.xcodeproj
  • Do the stuff you see in the screenshots ... this will be the part that the sentry-cli should do
$(SRCROOT)/../node_modules/sentry-react-native/ios

screenshot 2016-11-30 16 15 48

screenshot 2016-11-30 16 16 47

screenshot 2016-11-30 16 17 07

awesomeproject_xcodeproj_and_sentryreactnative_xcodeproj

  • Open index.ios.js
import RNSentryClient from 'sentry-react-native';
  • Add RNSentryClient startWithDsnString somewhere in the code e.g.:
...
export default class AwesomeProject extends Component {
  render() {
    RNSentryClient.startWithDsnString("YOUR DSN");
    return (
...
  • Hit run in Xcode or run react-native run-ios
  • Profit

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions