Skip to content

Commit 4932bd5

Browse files
authored
feat: remove automatic APNs registration when requesting permissions (#15)
1 parent 9ed81a1 commit 4932bd5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Sources/AmplifyUtilsNotifications/AUNotificationPermissions.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ public class AUNotificationPermissions {
4444
options: options
4545
)
4646

47-
if notificationsAllowed {
48-
// Register with Apple Push Notification service
49-
await Application.shared.registerForRemoteNotifications()
50-
}
51-
5247
return notificationsAllowed
5348
}
49+
50+
/// Register device with APNs
51+
public static func registerForRemoteNotifications() async {
52+
await MainActor.run {
53+
Application.shared.registerForRemoteNotifications()
54+
}
55+
}
5456
}

0 commit comments

Comments
 (0)