You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the default behavior of OneSignal is to link against its OneSignalLocation, which in turn importsCoreLocation. This means that, even if the said code path is never reached, Apple will prompt you with a warning when submitting the app to the App Store if the NSLocationWhenInUseUsageDescription is not in the app's Info.plist.
This is, in my opinion, unfortunate as one would have to come up with a reason for NSLocationWhenInUseUsageDescription even if the feature will never be used. Judging from the code in OneSignalLocationManager, the dynamic features of the Objective-C runtime are heavily employed, which leads me to believe one has tried to use CoreLocation without employing the types exposed via the framework's interface. That is, in a way where CoreLocation is possibly linked, but not necessarily. This leads me to believe an attempt to make use of CoreLocation only for certain conditions when it is linked has been made, possibly to for occasions where the app programmer does not want to link against CoreLocation and manage the privacy implications. CoreLocation is however imported unconditionally.
As location services for push notifications are not strictly needed, I believe the cleanest approach would be to conditionally link against OneSignalLocation only if such features are necessary for the app consuming the OneSignal SDK. That is, the app programmer explicitly adds OneSignalLocation to the Podfile as a dependency when this functionality is needed.
Are my assumptions correct? Please advise me if I have missed anything related to how to disable CoreLocation for OneSignal. For the record, I'm using the Expo plugin for React Native to add OneSignal as a dependency.
The text was updated successfully, but these errors were encountered:
Hi @hakonk, this is known to us. You are right, we did try to use the dynamic features of Objc to avoid this location detection by Apple. We have since ripped out OneSignalLocation from the native iOS SDK so clients can add the dependencies like this
target 'your_project_name' do
pod 'OneSignal/OneSignal', '>= 5.0.0', '< 6.0'
pod 'OneSignal/OneSignalInAppMessages', '>= 5.0.0', '< 6.0'
# If your app does not use CoreLocation, you can remove this:
pod 'OneSignal/OneSignalLocation', '>= 5.0.0', '< 6.0'
# Your other pods here
end
However, this is only available to clients using the native SDK directly - we do not have this available to cross-platform SDKs who import all the features at once.
This would be considered a new feature we would investigate how best to support, as on react native now it is a single import via something like yarn add react-native-onesignal.
It seems that the default behavior of OneSignal is to link against its
OneSignalLocation
, which in turn importsCoreLocation
. This means that, even if the said code path is never reached, Apple will prompt you with a warning when submitting the app to the App Store if theNSLocationWhenInUseUsageDescription
is not in the app's Info.plist.This is, in my opinion, unfortunate as one would have to come up with a reason for
NSLocationWhenInUseUsageDescription
even if the feature will never be used. Judging from the code in OneSignalLocationManager, the dynamic features of the Objective-C runtime are heavily employed, which leads me to believe one has tried to useCoreLocation
without employing the types exposed via the framework's interface. That is, in a way whereCoreLocation
is possibly linked, but not necessarily. This leads me to believe an attempt to make use ofCoreLocation
only for certain conditions when it is linked has been made, possibly to for occasions where the app programmer does not want to link againstCoreLocation
and manage the privacy implications.CoreLocation
is however imported unconditionally.As location services for push notifications are not strictly needed, I believe the cleanest approach would be to conditionally link against
OneSignalLocation
only if such features are necessary for the app consuming the OneSignal SDK. That is, the app programmer explicitly addsOneSignalLocation
to the Podfile as a dependency when this functionality is needed.Are my assumptions correct? Please advise me if I have missed anything related to how to disable
CoreLocation
forOneSignal
. For the record, I'm using the Expo plugin for React Native to add OneSignal as a dependency.The text was updated successfully, but these errors were encountered: