-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
iOS screen broadcast freezes after the app is moved to the background for a few minutes. #1641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It is working on debug mode while developing but not for release app. |
I will look into that.
|
Thank you @vendroid12 |
Can you please explain a little bit more like what steps do I need to do? @lambiengcode |
When broadcasting my phone screen, if I switch to other apps for a few minutes without starting CallKit, the system assumes my app is using unnecessary energy. I noticed that apps like Jitsi and Google Meet start CallKit to avoid this issue. After implementing CallKit in my app, it worked correctly as well. You can use: https://pub.dev/packages/flutter_callkit_incoming and implement some code in native iOS: import Flutter
import UIKit
import waterbus_callkit_incoming
public class WaterbusSdkPlugin: NSObject, FlutterPlugin {
var uuidCall: String = ""
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "waterbus-sdk/native-plugin", binaryMessenger: registrar.messenger())
let instance = WaterbusSdkPlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
}
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
switch call.method {
case "getPlatformVersion":
result("" + UIDevice.current.systemVersion)
break
case "startCallKit":
let arguments = call.arguments as? [String: Any] ?? [String: Any]()
let uuidCallPartner = NSUUID().uuidString
self.uuidCall = uuidCallPartner
let nameCall = arguments["nameCaller"] as? String ?? "Waterbus"
var info = [String:Any?]()
info["id"] = uuidCallPartner
info["nameCaller"] = nameCall
info["handle"] = "0123456789"
info["type"] = 1
SwiftFlutterCallkitIncomingPlugin.sharedInstance?.startCall(waterbus_callkit_incoming.Data(args: info), fromPushKit: true)
result(true)
break
case "getCurrentUuid":
result(self.uuidCall)
break
default:
result(FlutterMethodNotImplemented)
}
}
} After call connected, call |
Thanks @lambiengcode |
I am not using incoming and outgoing calls in our app, so you mean we just need to show that we are using call, Is that right? |
My app does not use incoming calls. I implemented CallKit solely for screen sharing. Is is clear? |
@lambiengcode Thanks, now your solution is working for me.
|
@lambiengcode Do you have any idea about that issue #1631? |
@lambiengcode Thx bro!! |
After moving background, open any app like gmail etc and then leave it for some seconds and now screen streaming is frozen in IOS. Once you back into foreground, it is working again.
Any suggestion/solution here?
The text was updated successfully, but these errors were encountered: