Closed lachenmayer closed 2 years ago
I'm inexperienced with extensions on the iOS side but I do have multiple targets in my react-native app as my strategy for handling multiple firebase backends (I use one target per backend)
I have an abstract pod target in my Podfile with all the pods I want, then specific pod targets for each Xcode target, where I tune things - perhaps this is a way to enable or disable notifee? I'm unsure how to exclude something form auto-linking and then only include it in one target but Podfiles do allow full control via ruby etc so might be possible?
abstract_target 'Komp.ai' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => true
)
# Required by react-native-permissions
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Permission-Calendars', :path => "#{permissions_path}/Calendars"
pod 'Permission-Contacts', :path => "#{permissions_path}/Contacts"
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
pod 'Permission-Motion', :path => "#{permissions_path}/Motion"
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
pod 'Permission-Reminders', :path => "#{permissions_path}/Reminders"
# Use pre-compiled FirebaseFirestore
pod 'FirebaseFirestore/WithLeveldb', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => $FirebaseSDKVersion
$RNFirebaseAnalyticsWithoutAdIdSupport = true
target 'Komp.aiTests' do
inherit! :search_paths
# Pods for testing
end
target 'Komp.aiDev' do
end
target 'Komp.aiTest' do
end
that said, perhaps something may be done about the crash, and/or something is not correct about how the app is doing things with shared extensions
I seem to remember there was something fishy there - it is still unresolved:
https://github.com/invertase/notifee/issues/242
None of this is a solution really but perhaps it gets you closer to one?
in your share extension, do you need all your react-native deps excluding notifee? If you don't need them, I'd say exclude all from your share extension.
Thanks both for your quick help!
@helenaford We don't need Notifee at all, and I'm sure it would help to remove other unused dependencies from the target as well - I'm just not sure how! use_native_modules!
adds each podspec defined by a node module as a pod
rule. From what I can tell, there's no way of disabling any modules here. Do you know if there's any other way of doing this?
@mikehardy We are already using config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
in our podfile, we needed it to get React Native running at all in the share extension (probably due to similar issues).
The best bet might be to have the share extension be completely different podfile target to keep it separate from the react-native auto-ilnker
@lachenmayer I posted the other day an example of how to keep dependencies separate using targets here, if that helps at all? Hard to say exactly what you need to do without seeing your Podfile and your workspace
I believe the issue is resolved. Please re-open if you're still experiencing it
Hi there, we are using Notifee in our app, and we separately also have a share extension target on iOS. Whenever I try to launch the share extension in the simulator (by attaching it to Safari & trying to share a URL), the following crash occurs:
You can see the crash clearly here:
Versions:
Our share extension does not use/need any Notifee features at all -- is there some way of disabling the Notifee native dependency, eg. by removing the pod from the share extension target?
Thanks a lot!