File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,14 @@ struct UpdateUtil {
8383 }
8484 DispatchQueue . main. async {
8585 UIApplication . shared. open ( url) { _ in
86- exit ( 0 )
86+ // Post notification event before closing the app
87+ NotificationCenter . default. post ( name: UIApplication . willTerminateNotification, object: nil )
88+
89+ // Close the app after a slight delay so it has time to execute code for the notification
90+ DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.3 ) {
91+ // We need to exit since iOS doesn't start the install until the app exits
92+ exit ( 0 )
93+ }
8794 }
8895 }
8996 }
Original file line number Diff line number Diff line change @@ -276,8 +276,14 @@ public final class ETDistribution: NSObject {
276276 return
277277 }
278278 UIApplication . shared. open ( url) { _ in
279- // We need to exit since iOS doesn't start the install until the app exits
280- exit ( 0 )
279+ // Post notification event before closing the app
280+ NotificationCenter . default. post ( name: UIApplication . willTerminateNotification, object: nil )
281+
282+ // Close the app after a slight delay so it has time to execute code for the notification
283+ DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.3 ) {
284+ // We need to exit since iOS doesn't start the install until the app exits
285+ exit ( 0 )
286+ }
281287 }
282288 }
283289
You can’t perform that action at this time.
0 commit comments