ios - Cast session getting suspended due to "GCKConnectionSuspendReasonNetworkNotReachable" -




observed behavior: after starting casting of music files, user enters background. after few minutes of playing music file through cast, session gets suspended reason gckconnectionsuspendreasonnetworknotreachable, though sender device , cast device both connected working wi-fi connection

expected behavior: session should continue sender app has background capability of playing audio , gckcastoptions have set property suspendsessionswhenbackgrounded no.

you may want check resuming after app backgrounding in gckremotedisplaychannel class

it's stated that,

normally when ios app goes background, network connections closed , hardware encoder access terminated. means without special handling remote display session end upon app backgrounding.

a session can kept alive in background doing following:

  • initialize gckdevicemanager initwithdevice:clientpackagename:ignoreappstatenotifications:, specifying yes ignoreappstatenotifications argument.
  • register background task using uiapplication beginbackgroundtaskwithexpirationhandler: keep app running if backgrounded amount of time controlled ios.

for more information, may want check playing media while in background using av foundation on ios.





wiki

Comments