bugsnag-js icon indicating copy to clipboard operation
bugsnag-js copied to clipboard

Support iOS app extensions in react native app.

Open johnkiely1 opened this issue 5 years ago • 2 comments

Originally raised as PR

Description

Add dependency on Bugsnag itself if you use the core subspec

Noticed that if you use the 'Core' subspec with the Bugsnag pod included separately to bugsnag-react-native, then there's a build error, as the bugsnag-react-native files can't find the Bugsnag.h header, ie:

pod 'BugsnagReactNative', :path => '../node_modules/bugsnag-react-native/BugsnagReactNative.podspec', :subspecs => [
  'Core'
]

johnkiely1 avatar Sep 14 '20 11:09 johnkiely1

For those playing along with https://github.com/bugsnag/bugsnag-react-native/pull/419 and now this one carried over - I've reworked the excellent hack pointed out by @crafterm to get this working with the latest version - its pretty messy now that BugsnagReactNative vendors a complete version 😬 .

Podfile:

pod 'Bugsnag' # on extensions + main RN app
pod 'BugsnagReactNative', :path => '../node_modules/@bugsnag/react-native/BugsnagReactNative.podspec', :subspecs => [
    'Core'
  ] # On main RN app

Patch:

image

As the vendored version conflicts, many warnings in Xcode 11 + 12, to avoid this the s.header_dir of the podspec needs to be removed. I'm assuming the vendored version is there to lock the version, but odd its not done with pod dependencies (i'm not sure why this isn't the case 🤔 ), so I lock the Podfile references of pod 'Bugsnag' to the same version as the vendored version in the BugsnagReactNative repo (at time of writing this looks to be 6.1.4 https://github.com/bugsnag/bugsnag-js/blob/next/packages/react-native/ios/vendor/bugsnag-cocoa/Bugsnag.podspec.json#L3)

tommeier avatar Sep 24 '20 22:09 tommeier

What's the status on this? We're currently using the deprecated bugsnag-react-native library and are looking into migrating. We have both a Today and Overview extension so we have to be sure that these are working before doing the migration.

lundn avatar Mar 05 '21 14:03 lundn