ALL BUSINESS
COMIDA
DIRECTORIES
EDUCATIONAL
ENTERTAINMENT
FASHION TIPS
FINER THINGS
FREE CREATOR TOOLS
HEALTH
MARKETPLACE
MEMBER's ONLY
MONEY MATTER$
MOTIVATIONAL
NEWS & WEATHER
TECHNOLOGIA
TELEVISION NETWORKS
USA VOTES 2024
VIDEOS
INVESTOR RELATIONS
IN DEVELOPMENT
Posted by - Latinos MediaSyndication -
on - May 28, 2023 -
Filed in - Technology -
-
342 Views - 0 Comments - 0 Likes - 0 Reviews
I found this crash log in Firebase:
Crashed: com.apple.main-thread 0 libdispatch.dylib 0x4b20 dispatch_semaphore_signal + 8 1 GameCenterUI 0x9ebd8 __56-[GKNotificationBannerViewController hideBannerQuickly:]_block_invoke_2 + 40 2 libdispatch.dylib 0x3f88 _dispatch_client_callout + 20 3 libdispatch.dylib 0x7418 _dispatch_continuation_pop + 504 4 libdispatch.dylib 0x1aa58 _dispatch_source_invoke + 1588 5 libdispatch.dylib 0x12748 _dispatch_main_queue_drain + 756 6 libdispatch.dylib 0x12444 _dispatch_main_queue_callback_4CF + 44 7 CoreFoundation 0x9a6c8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 8 CoreFoundation 0x7c02c __CFRunLoopRun + 2036 9 CoreFoundation 0x80eb0 CFRunLoopRunSpecific + 612 10 GraphicsServices 0x1368 GSEventRunModal + 164 11 UIKitCore 0x3a1668 -[UIApplication _run] + 888 12 UIKitCore 0x3a12cc UIApplicationMain + 340 13 libswiftUIKit.dylib 0x35308 UIApplicationMain(_:_:_:_:) + 104 14 BinMinesweeper 0x7050 main + 4345163856 (AppSceneDelegate.swift:4345163856) 15 ??? 0x1e6d6c960 (Missing)
The above example came from iOS 16.3.1, iPhone XR. I can't reproduce this crash. It happens pretty rarely (less than 1% of users).
I assume GKNotificationBannerViewController is the top banner "Welcome user_abc" presented when you launch the app.
The only time I interact with Game Center is when user click a leaderboard button, I show the game center VC. Here are some code:
import GameKit public enum GameCenterUtil { private static var g_isEnabled: Bool = false public static func setupIfNeeded() { GKLocalPlayer.local.authenticateHandler = { loginVC, error in if loginVC != nil { // Nothing. Do not present login. // User generally don't use game center. It's annoying. return } if error != nil { g_isEnabled = false return } g_isEnabled = true } } public static func reportScore(_ score: Int, category: String) { guard g_isEnabled else { return } GKLeaderboard.submitScore(score, context: 0, player: GKLocalPlayer.local, leaderboardIDs: [category]) { error in // nothing } } public static func presentLeaderboard(in vc: UIViewController) { // when disabled, this will be an alert. let gameCenterVC = GKGameCenterViewController() gameCenterVC.gameCenterDelegate = LeaderboardDismisser.shared vc.present(gameCenterVC, animated: true, completion: nil) } } final class LeaderboardDismisser: NSObject, GKGameCenterControllerDelegate { static let shared = LeaderboardDismisser() func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) { // This is required. When user is not logged in, the alert prompts up. If we don't dismiss it, the game vc will be not responding. gameCenterViewController.dismiss(animated: true, completion: nil) } }
Then in didFinishLaunching, i call GameCenterUtil.setupIfNeeded(), and in leaderboard button callback, I call GameCenterUtil.presentLeaderboard(in: vc).
Edit: There is also a very similar crash, also unable to repro and happens rarely:
Crashed: com.apple.GameKit.banner 0 libdispatch.dylib 0x4a60 dispatch_semaphore_wait + 8 1 GameCenterUI 0x9abe4 __42+[GKNotificationBannerWindow enqueBanner:]_block_invoke_2 + 60 2 libdispatch.dylib 0x2320 _dispatch_call_block_and_release + 32 3 libdispatch.dylib 0x3eac _dispatch_client_callout + 20 4 libdispatch.dylib 0xb534 _dispatch_lane_serial_drain + 668 5 libdispatch.dylib 0xc0d8 _dispatch_lane_invoke + 436 6 libdispatch.dylib 0x16cdc _dispatch_workloop_worker_thread + 648 7 libsystem_pthread.dylib 0xddc _pthread_wqthread + 288 8 libsystem_pthread.dylib 0xb7c start_wqthread + 8