TVOPreflightDelegate

Objective-C

@protocol TVOPreflightDelegate <NSObject>

Swift

protocol TVOPreflightDelegate : NSObjectProtocol

TVOPreflightDelegate provides callbacks when important changes to a TVOPreflightTest occur.

  • @brief Notifies the delegate that the preflight test is completed successfully.

    @discussion The state of the <TVOPreflightTest> will be TVOPreflightTestStatusCompleted at this point.

    Declaration

    Objective-C

    - (void)preflight:(nonnull TVOPreflightTest *)preflightTest
        didCompleteWithReport:(nonnull TVOPreflightReport *)report;

    Swift

    func preflight(_ preflightTest: TVOPreflightTest, didCompleteWith report: TVOPreflightReport)

    Parameters

    preflightTest

    The <TVOPreflightTest>.

    report

    The <TVOPreflightReport>.

  • @brief Notifies the delegate that the preflight test has failed.

    @discussion The state of the <TVOPreflightTest> will be TVOPreflightTestStatusFailed at this point.

    Declaration

    Objective-C

    - (void)preflight:(nonnull TVOPreflightTest *)preflightTest
        didFailWithError:(nonnull NSError *)error;

    Swift

    func preflight(_ preflightTest: TVOPreflightTest, didFailWithError error: any Error)

    Parameters

    preflightTest

    The <TVOPreflightTest> that failed.

    error

    The <NSError> that occurred.

  • @brief Notifies the delegate that the preflight test call has successfully connected to Twilio.

    @discussion The state of the <TVOPreflightTest> will be TVOPreflightTestStatusConnected at this point.

    Declaration

    Objective-C

    - (void)preflightDidConnect:(nonnull TVOPreflightTest *)preflightTest;

    Swift

    func preflightDidConnect(_ preflightTest: TVOPreflightTest)

    Parameters

    preflightTest

    The <TVOPreflightTest>.

  • @brief Notifies the delegate that network quality warnings have changed for the preflight test.

    @discussion The two sets will help the delegate find out what warnings have changed since the last callback was received.

    See

    TVOCall for more detail about <TVOCallQualityWarning>.

    Declaration

    Objective-C

    - (void)preflight:(nonnull TVOPreflightTest *)preflightTest
        didReceiveQualityWarnings:(nonnull NSSet<NSNumber *> *)currentWarnings
                 previousWarnings:(nonnull NSSet<NSNumber *> *)previousWarnings;

    Swift

    optional func preflight(_ preflightTest: TVOPreflightTest, didReceiveQualityWarnings currentWarnings: Set<NSNumber>, previousWarnings: Set<NSNumber>)

    Parameters

    preflightTest

    The <TVOPreflightTest> that received quality warning updates.

    currentWarnings

    An <NSSet> that contains the warnings at the instant of receiving this callback. Values in the <NSSet> are <NSNumber> with values of <TVOCallQualityWarning>.

    previousWarnings

    An <NSSet> that contains the warnings before receiving this callback. Values in the <NSSet> are <NSNumber> with values of <TVOCallQualityWarning>.

  • @brief Notifies the delegate that a new stats sample has been received.

    @discussion This callback will be raised every second once the preflight test has connected.

    Declaration

    Objective-C

    - (void)preflight:(nonnull TVOPreflightTest *)preflightTest
        didReceiveStatsSample:(nonnull TVOPreflightStatsSample *)statsSample;

    Swift

    optional func preflight(_ preflightTest: TVOPreflightTest, didReceive statsSample: TVOPreflightStatsSample)

    Parameters

    preflightTest

    The <TVOPreflightTest> that received the stats sample.

    statsSample

    The <TVOPreflightStatsSample>.