Skip to content

Commit d592eef

Browse files
committed
Allow adding push subscription observer before privacy consent
* Even though the User namespace is invoked when calling `OneSignal.User.pushSubscription.addObserver()`, this is ok. We want them to be able to add it at startup before consent may be granted.
1 parent 944d758 commit d592eef

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

iOS_SDK/OneSignalSDK/OneSignalUser/Source/OneSignalUserManagerImpl.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,7 @@ extension OneSignalUserManagerImpl: OSUser {
674674
extension OneSignalUserManagerImpl: OSPushSubscription {
675675

676676
public func addObserver(_ observer: OSPushSubscriptionObserver) {
677-
guard !OneSignalConfigManager.shouldAwaitAppIdAndLogMissingPrivacyConsent(forMethod: "pushSubscription.addObserver") else {
678-
return
679-
}
677+
// This is a method in the User namespace that doesn't require privacy consent first
680678
self.pushSubscriptionStateChangesObserver.addObserver(observer)
681679
}
682680

0 commit comments

Comments
 (0)