DialOnce

@interface DialOnce : NSObject

Facade for DialOnce SDK functionality

  • Interceptable schemes

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull)
        NSArray<NSString *> *intercaptableUrlSchemes;

    Swift

    var intercaptableUrlSchemes: [String] { get }
  • Setup service for handling phone calls from application

    Declaration

    Objective-C

    + (instancetype _Nonnull)sharedInstance;

    Swift

    class func sharedInstance() -> Self

    Return Value

    instance of DialOnce

  • Setup service for handling phone calls from application

    Declaration

    Objective-C

    + (void)setupWithApiKey:(nonnull NSString *)apiKey;

    Swift

    class func setup(withApiKey apiKey: String)

    Parameters

    apiKey

    Key for api

  • Setup service for handling phone calls from application

    Declaration

    Objective-C

    + (void)setupWithApiKey:(nonnull NSString *)apiKey
                   logLevel:(DOLogLevel)logLevel
           isServiceEnabled:(BOOL)isServiceEnabled
            servicesLocator:(nullable id<DOServiceLocator>)servicesLocator;

    Swift

    class func setup(withApiKey apiKey: String, logLevel: DOLogLevel, isServiceEnabled: Bool, servicesLocator: DOServiceLocator?)

    Parameters

    apiKey

    Key for api

    logLevel

    Level for logs see DOLogLevelError

    isServiceEnabled

    Should enable service or not, by default is true

    servicesLocator

    Servie config must be empty for production apps

  • Internal method for service initialization

    Declaration

    Objective-C

    - (nullable instancetype)initWithApiKey:(nonnull NSString *)apiKey
                           isServiceEnabled:(BOOL)serviceEnabled
                            servicesLocator:
                                (nullable id<DOServiceLocator>)serviceLocator;

    Swift

    init?(apiKey: String, isServiceEnabled serviceEnabled: Bool, servicesLocator serviceLocator: DOServiceLocator?)

    Parameters

    apiKey

    Key for api

    serviceEnabled

    Should enable service or not

    Return Value

    DialOnce instance

  • Display custom screen for handling phone call

    Declaration

    Objective-C

    - (void)displayScreenEngineForPhoneNumber:(nonnull const NSString *)phoneNumber
                                       action:(nonnull const NSString *)action
                                      callUid:(nonnull NSString *)callUid;

    Swift

    func displayScreenEngine(forPhoneNumber phoneNumber: String, action: String, callUid: String)

    Parameters

    phoneNumber

    phoneNumber which was called

    action

    Action, that shows .OutgoingCall or .PostOutgoingCall by default will be .OutgoingCall

    callUid

    id for call

  • Enable/disable service

    Declaration

    Objective-C

    - (BOOL)setServiceEnabledCheck:(BOOL)enabled;

    Swift

    func setServiceEnabledCheck(_ enabled: Bool) -> Bool

    Parameters

    enabled

    new state of service

    Return Value

    @YES if service state was successfully changed

  • Check if service was enabled and methods swizzled

    Declaration

    Objective-C

    - (BOOL)isServiceEnabledCheck;

    Swift

    func isServiceEnabledCheck() -> Bool

    Return Value

    @YES if service enabled, @NO if not

  • Unlock phone number for digitization

    Declaration

    Objective-C

    - (void)unlockPhoneNumbersWithPassword:(nullable NSString *)password
                                  callback:
                                      (void (^_Nullable)(BOOL))completionHandler;

    Swift

    func unlockPhoneNumbers(withPassword password: String?, callback completionHandler: ((Bool) -> Void)? = nil)

    Parameters

    password

    password to unlock

    completionHandler

    called once unlock operation was finished

  • Disable digitiztion for phone numbers

    Declaration

    Objective-C

    - (void)lockPhoneNumbersWithCallback:(void (^_Nullable)(BOOL))completionHandler;

    Swift

    func lockPhoneNumbers(callback completionHandler: ((Bool) -> Void)? = nil)

    Parameters

    completionHandler

    called once unlock operation was finished

  • Display Interstitial

    Declaration

    Objective-C

    - (void)displayInterstitial;

    Swift

    func displayInterstitial()
  • Unique identifier for device

    Declaration

    Objective-C

    - (nonnull NSString *)deviceId;

    Swift

    func deviceId() -> String

    Return Value

    Unique identifier in String format

  • Get SDK version

    Declaration

    Objective-C

    - (nonnull NSString *)sdkVersion;

    Swift

    func sdkVersion() -> String

    Return Value

    SDK version

  • Sent analytics data for processing

    Declaration

    Objective-C

    - (void)forceSync;

    Swift

    func forceSync()