listen_call

support background listen call phone event in android

Permission

    /// requestPhonePermission
    ListenCall.requestPhonePermission;

background listen

    ///  callback function
    int a = 0;
    Future onPhoneCall(e) async {
        print(["onPhoneCall", e, a++]);
        print([
            callPhoneInfo["state"] as int,
            callPhoneInfo["incomingNumber"] as String,
            callPhoneInfo["deviceName"] as String
        ]);
    }

    /// init
    ListenCall.initBackgroundCall(onPhoneCall);

Libraries

listen_call
protocol