Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
641 views
in Technique[技术] by (71.8m points)

objective c - iOS Chromecast sender app getting disconnected when app goes to background

I have been stuck on this issue for quite a while now. My iOS music app is getting disconnected from the chromecast receiver with an error "Network not reachable" 90-100 seconds after going in background. I am using CastSDK version 4.5.0. This is only happening on an iphone and works fine on iphone simulators. I have implemented this options.suspendSessionsWhenBackgrounded = false;.

I am attaching some logs related to this crash.

2021-01-27 13:20:33.807620+0530 -[ChromecastManager remoteMediaClient:didUpdateMediaStatus:] [Line 741] --------------2-2
2021-01-27 13:20:33.808298+0530 -[ChromecastManager updatePlayerUI] [Line 858] GCKMediaPlayerStateIdle - 0
2021-01-27 13:20:33.809001+0530 -[ChromecastManager updatePlayerUI] [Line 930] CURRENT ITEM ID- 20
2021-01-27 13:20:33.809528+0530 -[ChromecastManager updatePlayerUI] [Line 931] REMOTE SONG INDEX - 0
2021-01-27 13:20:33.810023+0530 -[ChromecastManager updatePlayerUI] [Line 932] LOCAL SONGS INDEX - 0
2021-01-27 13:20:33.810575+0530 -[ChromecastManager updatePlayerUI] [Line 933] SONG PID - abX7pJh
2021-01-27 13:20:33.811191+0530 -[ChromecastManager updatePlayerUI] [Line 934] GCKMediaPlayerState - 2
2021-01-27 13:20:33.811747+0530 -[ChromecastManager handleQueueUI] [Line 1026] handleStreamerPlay
2021-01-27 13:20:59.485036+0530 [ProcessSuspension] 0x28095af60 - WKProcessAssertionBackgroundTaskManager: Ignored request to start a new background task because RunningBoard has already started the expiration timer
2021-01-27 13:20:59.550896+0530 BackgroundSession <4C4A9365-975D-4B51-91DD-C0D76CB44481> connection to background transfer daemon interrupted
2021-01-27 13:20:59.551223+0530 BackgroundSession <4C4A9365-975D-4B51-91DD-C0D76CB44481> connection to background transfer daemon invalidated
2021-01-27 13:20:59.554585+0530 [WC] -[WCSession onqueue_handleUpdateSessionState:]_block_invoke dropping as pairingIDs no longer match. pairingID (null), client pairingID: (null)
2021-01-27 13:20:59.555616+0530 [WC] WCSession is not paired
2021-01-27 13:20:59.556550+0530 [WC] -[WCSession xpcConnectionRestoredWithState:]_block_invoke dropping as pairingIDs no longer match. pairingID (null), client pairingID: (null)
2021-01-27 13:20:59.571981+0530 Interruption started
2021-01-27 13:21:30.319932+0530 [connection] nw_read_request_report [C22] Receive failed with error "Software caused connection abort"
2021-01-27 13:21:30.403541+0530 ChromecastManager: session ended with error: Error Domain=com.google.cast.GCKError Code=17 "Network not reachable" UserInfo={NSLocalizedDescription=Network not reachable}

Will I have to create background tasks for this? If anyone of you have implemented this or anything similar to this please feel free to reply.

question from:https://stackoverflow.com/questions/66062667/ios-chromecast-sender-app-getting-disconnected-when-app-goes-to-background

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...