Skip to content

Commit cafb5c6

Browse files
author
Jaesung
committed
Add comments to inform the situation on applicationWillTerminate(_:)
1 parent d1b40ec commit cafb5c6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

QuickStart/AppDelegate.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
4343
}
4444

4545
func applicationWillTerminate(_ application: UIApplication) {
46-
// End all ongoing calls when application is going to terminate
46+
// This method will be called when the app is forcefully terminated.
47+
// End all ongoing calls in this method.
4748
let callManager = CXCallManager.shared
4849
let ongoingCalls = callManager.currentCalls.compactMap { SendBirdCall.getCall(forUUID: $0.uuid) }
4950

@@ -59,6 +60,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
5960
callManager.endCall(for: uuid, endedAt: Date(), reason: .none)
6061
}
6162
}
63+
// However, because iOS gives a limited time to perform remaining tasks,
64+
// There might be some calls failed to be ended
65+
// In this case, I recommend that you register local notification to notify the unterminated calls.
6266
}
6367
}
6468

0 commit comments

Comments
 (0)