Skip to content

Commit 5f51a1d

Browse files
committed
Update MockPushNotificationsManager
1 parent a2a28aa commit 5f51a1d

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- [*] Better support site credential login for sites with captcha plugins [https://github.com/woocommerce/woocommerce-ios/pull/16372]
77
- [*] Crash fix attempt to resolve the race condition in request authenticator swapping [https://github.com/woocommerce/woocommerce-ios/pull/16370]
88
- [*] Update products on the Top Performers card when there are changes made to displayed products [https://github.com/woocommerce/woocommerce-ios/pull/16380]
9+
- [*] Fixed issue unregistering device from push notifications [https://github.com/woocommerce/woocommerce-ios/pull/16386]
910
- [Internal] Fix broken navigation to a variable product selector [https://github.com/woocommerce/woocommerce-ios/pull/16363]
1011

1112
23.7

WooCommerce/Classes/ServiceLocator/PushNotesManager.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ protocol PushNotesManager {
5050
func registerForRemoteNotifications()
5151

5252
/// Unregisters the Application from WordPress.com Push Notifications Service.
53+
/// - Parameter onCompletion: Closure to be executed on completion.
5354
///
5455
func unregisterForRemoteNotifications(onCompletion: @escaping () -> Void)
5556

WooCommerce/Classes/Yosemite/DefaultStoresManager.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ class DefaultStoresManager: StoresManager {
299299

300300
// Unregister from remote notifications asynchronously
301301
pushNotesManager.unregisterForRemoteNotifications {
302-
// Release the strong reference to allow state cleanup
302+
DDLogInfo("📱 Push notification unregistration completed after logout")
303+
// Keep `currentState` until the end of the closure
303304
_ = currentState
304305
}
305306

WooCommerce/WooCommerceTests/Mocks/MockPushNotificationsManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ final class MockPushNotificationsManager: PushNotesManager {
7878

7979
}
8080

81-
func unregisterForRemoteNotifications() {
81+
func unregisterForRemoteNotifications(onCompletion: @escaping () -> Void) {
8282

8383
}
8484

0 commit comments

Comments
 (0)