Skip to content

doximity/CallWithDoxDialer

Repository files navigation

CallWithDoxDialer

A µLibrary for making calls using Doximity.


GitHub release platforms CircleCI

What is DoximityDialerSDK?

Doximity lets healthcare professionals make phone calls to patients while on the go -- without revealing personal phone numbers. Calls are routed through Doximity's HIPAA-secure platform and relayed to the patient who will see the doctor's office number in the Caller ID. Doximity is currently available to verified physicians, nurse practitioners, physician assistants and pharmacists in the United States.

This µLibrary lets 3rd-party apps easily initiate calls through the Doximity app.

Requirements: iOS 15.0+

⚠️ Required Configuration

Before using this SDK, you MUST configure your app's Info.plist:

Add doximity to your LSApplicationQueriesSchemes array, or the SDK will not work correctly.

In your app's Info.plist, add a new entry with key LSApplicationQueriesSchemes (or Queried URL Schemes) and value type Array if one does not already exist. Then add an element to the array of type String and value doximity.

Without this configuration:

  • isDoximityInstalled will always return false
  • Users will always be redirected to the App Store, even if Doximity is installed
  • Calls will not work

Integrating DoximityDialerSDK Into Your App

Swift Package Manager (SPM)

DoximityDialerSDK is distributed via Swift Package Manager. To use this library in your project, add the https://github.com/doximity/CallWithDoxDialer.git repository as a Swift Package.

Manually

To integrate DoximityDialerSDK without a package manager, download the following files and place them anywhere in your project:

  • Sources/DoximityDialerSDK/DoximityDialer.swift
  • Sources/DoximityDialerSDK/DoximityDialerSDK.bundle

Usage

All methods accept phone numbers in various formats:

  • Numbers only: 6502333444
  • Formatted: (650)233-3444

Core Functionality

To initiate a call using Doximity, simply call the dialPhoneNumber method on the shared DoximityDialer instance. If the Doximity app is not installed, this call will direct the user to Doximity on the App Store.

Swift

import DoximityDialerSDK

...

DoximityDialer.shared.dialPhoneNumber("4254443333")

Objective-C

@import DoximityDialerSDK;

...

[DoximityDialer dialPhoneNumber:@"4254443333"];

Auto-Starting Calls

You can automatically start a voice or video call instead of prefilling the number:

Swift

// Start a voice call immediately
DoximityDialer.shared.startVoiceCall("4254443333")

// Start a video call immediately
DoximityDialer.shared.startVideoCall("4254443333")

Objective-C

// Start a voice call immediately
[DoximityDialer startVoiceCall:@"4254443333"];

// Start a video call immediately
[DoximityDialer startVideoCall:@"4254443333"];

Checking Installation Status

You can check if the Doximity app is installed to conditionally show/hide UI elements:

Swift

if DoximityDialer.shared.isDoximityInstalled {
    // Show "Call with Doximity" button
} else {
    // Hide button or show "Install Doximity" prompt
}

Objective-C

if ([DoximityDialer isDoximityInstalled]) {
    // Show "Call with Doximity" button
} else {
    // Hide button or show "Install Doximity" prompt
}

Icons

The library includes the Doximity icon for use in buttons. These methods throw errors if the icon cannot be loaded, so use try/catch:

Swift

do {
    let icon = try DoximityDialer.shared.doximityIcon()
    // Or for tinted views:
    let templateIcon = try DoximityDialer.shared.doximityIconAsTemplate()
} catch {
    print("Failed to load Doximity icon: \(error)")
}

Objective-C

NSError *error = nil;
UIImage *icon = [DoximityDialer doximityIconAndReturnError:&error];
if (error) {
    NSLog(@"Failed to load Doximity icon: %@", error);
}

// Or for tinted views:
UIImage *templateIcon = [DoximityDialer doximityIconAsTemplateAndReturnError:&error];

Example App

A complete example application is available in the Examples/ directory:

DoximityDialerExample - A unified iOS app demonstrating the SDK in SwiftUI, UIKit (Swift), and UIKit (Objective-C).

The example includes:

  • Main menu to choose between SwiftUI, UIKit (Swift), or UIKit (Objective-C) examples
  • SwiftUI implementation - Modern declarative UI example
  • UIKit (Swift) implementation - Complete UIKit integration example
  • UIKit (Objective-C) implementation - Complete Objective-C example
  • SwiftUI/UIKit/ObjC interop - Shows how to mix all frameworks and languages
  • Proper Info.plist configuration
  • Installation status checking
  • All call types (prefill, voice, video)
  • Icon loading and display

Other Platforms

Have a question?

If you need any help, please reach out! [email protected].

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 8

Languages