bugsnag-js
bugsnag-js copied to clipboard
Add privacy manifest from bugsnag-cocoa to React Native
Hi! 👋
While adding privacy manifest to my project, I noticed that the one provided by Bugsnag wasn't included in the final bundle. It turns out that the podspec to integrate bugsnag-cocoa in a React Native project is different.
I had to update the podspecs from bugsnag-js to fix it. For now I am using patch-package but I think it would be great to have that change merged upstream.
Here is the diff that solved my problem:
diff --git a/node_modules/@bugsnag/react-native/BugsnagReactNative.podspec b/node_modules/@bugsnag/react-native/BugsnagReactNative.podspec
index 13f1617..9a3b1e3 100644
--- a/node_modules/@bugsnag/react-native/BugsnagReactNative.podspec
+++ b/node_modules/@bugsnag/react-native/BugsnagReactNative.podspec
@@ -18,6 +18,9 @@ Pod::Spec.new do |s|
s.public_header_files = "ios/vendor/bugsnag-cocoa/{#{bugsnag_cocoa_public_header_files.join(',')}}"
s.header_dir = 'Bugsnag'
s.requires_arc = true
+ s.resource_bundles = {
+ 'Bugsnag' => ['ios/vendor/bugsnag-cocoa/Bugsnag/resources/PrivacyInfo.xcprivacy'],
+ }
if ENV['RCT_NEW_ARCH_ENABLED'] == "1"
install_modules_dependencies(s)
Thank you!
Hi @sparga
Thanks for raising this with us.
Just to confirm, can you please let us know which version of the BugSnag React Native SDK you have installed in your app? Since the v7.22.3 release, the SDK should be using v6.28.0 of bugsnag-cocoa which is compliant with Apple's required reasons for API usage, and we've not received any other reports of this failing to work for React Native projects.
Are you also able to confirm how you installed the SDK? For example, did you follow the CLI setup steps? https://docs.bugsnag.com/platforms/react-native/react-native/#installation-and-configuration
Also, was your app rejected by Apple prior to you making this change, or did you simply just observe that the BugSnag privacy manifest seemed to be missing from the final bundle?
I am using bugsnag/js version 7.22.4 and I can confirm with the Podfile.lock that Bugsnag ReactNative is also using this version.
Bugsnag-Cocoa v6.28.0 is indeed compliant and correctly include the Privacy Manifest in the app bundle. But the React Native SDK seems to use a different podspec file which doesn't include the manifest.
The SDK was installed years ago so I cannot confirm how it was installed but the git history suggests that the CLI was used.
I haven't tried submitting an app without this change. I simply noticed that other 3rd party SDKs had their privacy manifest included in the final app bundle whereas Bugsnag didn't. Other libraries all seem to be using resource_bundles in the Podspec to include it.
Hi @sparga
Thanks for the additional information.
We've created a task to look into this and update the BugsnagReactNative.podspec. We will make sure to post any updates on this thread.
Hi @sparga
I'm just posting an update here to let you know that we have updated the podspec based on your suggestions. This has been included in the v7.24.0 release of bugsnag-js: https://github.com/bugsnag/bugsnag-js/releases/tag/v7.24.0
Thanks again for raising this with us.