Kickflip / kickflip-ios-sdk

Kickflip iOS SDK
http://kickflip.io
Apache License 2.0
346 stars 143 forks source link

Handle 'applicationDidEnterBackground' gracefully #36

Open zummenix opened 9 years ago

zummenix commented 9 years ago

User has broken streams due to this issue. Steps to reproduce:

  1. Start streaming, wait some time;
  2. Tap Home button of the device (the app becomes inactive), wait some time;
  3. Tap on icon of the app (the app becomes active);
  4. User sees that streaming continues, but there is an error writer error Operation Interrupted in the console.
Arlem commented 9 years ago

I did not find a way to record in background so I thought of ending the stream as soon as user tap the home button or locks the screen; this is what I've done:

Don't forget to remove the notification observer or the app will crash the second time you launch the broadcastView. Any idea on how to improve this flow?

zummenix commented 9 years ago

Maybe this is an appropriate solution in this case. I don't feel good about that fact that I need dive in the library to make this change.

@Arlem Do you have any issues related to streaming after this change?

Arlem commented 9 years ago

@zummenix No, I haven't encountered any issues so far.

zummenix commented 9 years ago

@Arlem Good to know, thanks.