
A µLibrary for making calls using Doximity.
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+
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:
isDoximityInstalledwill always returnfalse- Users will always be redirected to the App Store, even if Doximity is installed
- Calls will not work
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.
To integrate DoximityDialerSDK without a package manager, download the following files and place them anywhere in your project:
Sources/DoximityDialerSDK/DoximityDialer.swiftSources/DoximityDialerSDK/DoximityDialerSDK.bundle
All methods accept phone numbers in various formats:
- Numbers only:
6502333444 - Formatted:
(650)233-3444
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.
import DoximityDialerSDK
...
DoximityDialer.shared.dialPhoneNumber("4254443333")@import DoximityDialerSDK;
...
[DoximityDialer dialPhoneNumber:@"4254443333"];You can automatically start a voice or video call instead of prefilling the number:
// Start a voice call immediately
DoximityDialer.shared.startVoiceCall("4254443333")
// Start a video call immediately
DoximityDialer.shared.startVideoCall("4254443333")// Start a voice call immediately
[DoximityDialer startVoiceCall:@"4254443333"];
// Start a video call immediately
[DoximityDialer startVideoCall:@"4254443333"];You can check if the Doximity app is installed to conditionally show/hide UI elements:
if DoximityDialer.shared.isDoximityInstalled {
// Show "Call with Doximity" button
} else {
// Hide button or show "Install Doximity" prompt
}if ([DoximityDialer isDoximityInstalled]) {
// Show "Call with Doximity" button
} else {
// Hide button or show "Install Doximity" prompt
}The library includes the Doximity icon for use in buttons. These methods throw errors if the icon cannot be loaded, so use try/catch:
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)")
}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];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
If you need any help, please reach out! [email protected].
