-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Location sharing with OneSignal now defaults to false #1352
Conversation
* Location sharing with OneSignal will default to NO, regardless of prompting or location permission on the device
Details: * Use constants for the 2 class names for the Location and IAM modules that are used by NSClassFromString: `OneSignalLocationManager` and `OneSignalInAppMessages` Motivation: * These can be easily missed. When the class `OneSignalLocation` was renamed to `OneSignalLocationManager`, some of the hardcoded strings were missed in `NSClassFromString` calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we update the migration guide to call out the new default as well?
Done. We will also need to update our docs calling this out for v5.1.0 and above. |
994ee3e
to
ad5e7f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Confirmed that isShared
now defaults to false.
Description
One Line Summary
Location sharing with OneSignal now defaults to
false
regardless of device permissions, so developers must explicitly set sharing totrue
.Details
Motivation
It may be a poor developer experience to be opted-in by default. Previously, as long as device has location permission, we shared location with the OneSignal server. Now, sharing must be explicitly enabled. This aligns with recent similar Android behavior changes OneSignal/OneSignal-Android-SDK#1942.
Scope
OneSignal.Location.isShared = true
(Swift) or[OneSignal.Location setShared:true]
to share location with OneSignal regardless of permission or prompting for location.Fix location module bug
NSClassFromString
:OneSignalLocationManager
andOneSignalInAppMessages
OneSignalLocation
was renamed toOneSignalLocationManager
, some of the strings were missed inNSClassFromString
calls. One consequence of this is the location module'sstart
method never ran and location not shared.Testing
Unit testing
None
Manual testing
iPhone 13 on iOS 17.1.2
Something that is not working is mid-session disabling and enabling doesn't drive location sharing until next cold start.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)