From 436294bb48857ee685fd3df32a8a90434a63fc34 Mon Sep 17 00:00:00 2001 From: Nan Date: Thu, 12 Jan 2023 13:04:27 -0800 Subject: [PATCH] fix bug in firing push subscription observer * calculateIsOptedIn and calculateIsEnabled were not actually using the passed in arguments --- .../OneSignalUser/Source/OSSubscriptionModel.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSSubscriptionModel.swift b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSSubscriptionModel.swift index 0fab2106f..8551ba7a3 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSSubscriptionModel.swift +++ b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSSubscriptionModel.swift @@ -293,13 +293,13 @@ extension OSSubscriptionModel { // Calculates if the device is opted in to push notification. // Must have permission and not be opted out. func calculateIsOptedIn(accepted: Bool, isDisabled: Bool) -> Bool { - return _accepted && !_isDisabled + return accepted && !isDisabled } // Calculates if push notifications are enabled on the device. // Does not consider the existence of the subscription_id, as we send this in the request to create a push subscription. func calculateIsEnabled(address: String?, accepted: Bool, isDisabled: Bool) -> Bool { - return (self.address != nil) && _accepted && !_isDisabled + return address != nil && accepted && !isDisabled } func updateNotificationTypes() {