Skip to content

Commit

Permalink
Merge pull request #19 from doximity/cd/feature/update-for-doximity-app
Browse files Browse the repository at this point in the history
Update to use Doximity app
  • Loading branch information
Chandlerdea committed Feb 4, 2020
2 parents 660ece6 + 0b096dd commit 96ceb54
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 47 deletions.
12 changes: 6 additions & 6 deletions CallWithDoxDialer.podspec
@@ -1,16 +1,16 @@
Pod::Spec.new do |s|
s.name = "CallWithDoxDialer"
s.version = "1.0.1"
s.summary = "A µLibrary for initiating calls through Doximity's Dialer app."
s.version = "1.0.2"
s.summary = "A µLibrary for initiating calls through the Doximity app."
s.description = <<-DESC
Doximity's Dialer app lets healthcare professionals make phone calls
Doximity lets healthcare professionals make phone calls
to patients while on the go -- without revealing personal phone numbers.
Calls are routed through Doximity's HIPPA-secure platform and relayed to the patient
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 Dialer is currently available to verified physicians, nurse practitioners,
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 Dialer app.
This µLibrary lets 3rd-party apps easily initiate calls through the Doximity app.
DESC
s.homepage = "https://github.com/doximity/CallWithDoxDialer/"
s.license = { :type => "Unlicense", :file => "LICENSE.MD" }
Expand Down
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions CallWithDoxDialer/DoxDialerCaller.h
Expand Up @@ -44,14 +44,14 @@
@return The icon as a UIImage.
*/
-(nonnull UIImage *)dialerIcon;
-(nonnull UIImage *)doximityIcon;

/**
The Doximity Dialer icon for use in tinted views.
@return The icon as a UIImage, with rendering mode `UIImageRenderingModeAlwaysTemplate`
*/
-(nonnull UIImage *)dialerIconAsTemplate;
-(nonnull UIImage *)doximityIconAsTemplate;


@end
62 changes: 31 additions & 31 deletions CallWithDoxDialer/DoxDialerCaller.m
Expand Up @@ -10,12 +10,12 @@
#import <UIKit/UIKit.h>

@interface DoxDialerCaller() {
NSURL *_dialerSchemeURL;
NSURL *_openDialerInAppStoreURL;
UIImage *_dialerIcon;
UIImage *_dialerIconAsTemplate;
NSURL *_doximitySchemeURL;
NSURL *_openDoximityInAppStoreURL;
UIImage *_doximityIcon;
UIImage *_doximityIconAsTemplate;
}
@property (nonnull, readonly) NSString *dialerScheme;
@property (nonnull, readonly) NSString *doximityScheme;

@end

Expand All @@ -39,75 +39,75 @@ +(instancetype _Nonnull)shared {

#pragma mark Methods
-(void)dialPhoneNumber:(nonnull NSString *)phoneNumber {
if (self.isDialerInstalled) {
if (self.isDoximityInstalled) {

NSURLComponents *launchDialerURLComponents = [[NSURLComponents alloc] init];
launchDialerURLComponents.scheme = self.dialerScheme;
launchDialerURLComponents.scheme = self.doximityScheme;
launchDialerURLComponents.host = @"doximity";
launchDialerURLComponents.path = @"/call";
launchDialerURLComponents.path = @"/dialer";
launchDialerURLComponents.queryItems = @[
[[NSURLQueryItem alloc] initWithName:@"target_number" value:phoneNumber]
];
[self openURL:launchDialerURLComponents.URL];
}
else {
[self openURL:self.openDialerInAppStoreURL];
[self openURL:self.openDoximityInAppStoreURL];
}
}



#pragma mark Icons
-(nonnull UIImage *)dialerIcon {
if(!_dialerIcon) {
-(nonnull UIImage *)doximityIcon {
if(!_doximityIcon) {
NSBundle *libraryBundle = [NSBundle bundleForClass:[DoxDialerCaller class]];
NSURL *assetsBundleUrl = [libraryBundle URLForResource:@"CallWithDoxDialer" withExtension:@"bundle"];
NSBundle *assetsBundle = [NSBundle bundleWithURL:assetsBundleUrl];

_dialerIcon = [UIImage imageNamed:@"doximity-dialer-icon"
_doximityIcon = [UIImage imageNamed:@"doximity-icon-black"
inBundle:assetsBundle
compatibleWithTraitCollection:nil];
}
return _dialerIcon;
return _doximityIcon;
}

-(nonnull UIImage *)dialerIconAsTemplate {
if(!_dialerIconAsTemplate) {
_dialerIconAsTemplate = [self.dialerIcon imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
-(nonnull UIImage *)doximityIconAsTemplate {
if(!_doximityIconAsTemplate) {
_doximityIconAsTemplate = [self.doximityIcon imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}
return _dialerIconAsTemplate;
return _doximityIconAsTemplate;
}


#pragma mark - Private Internal Properties -

#pragma mark Lazy Properties
-(nonnull NSString *)dialerScheme {
return @"doximitydialer";
-(nonnull NSString *)doximityScheme {
return @"doximity";
}
-(nonnull NSURL *)dialerSchemeURL {
if(!_dialerSchemeURL) {
-(nonnull NSURL *)doximitySchemeURL {
if(!_doximitySchemeURL) {
NSURLComponents *dialerSchemeURLComponents = [[NSURLComponents alloc] init];
dialerSchemeURLComponents.scheme = self.dialerScheme;
dialerSchemeURLComponents.scheme = self.doximityScheme;
dialerSchemeURLComponents.host = @"";
_dialerSchemeURL = dialerSchemeURLComponents.URL;
_doximitySchemeURL = dialerSchemeURLComponents.URL;
}
return _dialerSchemeURL;
return _doximitySchemeURL;
}

-(nonnull NSURL *)openDialerInAppStoreURL {
if(!_openDialerInAppStoreURL) {
-(nonnull NSURL *)openDoximityInAppStoreURL {
if(!_openDoximityInAppStoreURL) {
NSString *appIdentifyingName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] ?: @"Unknown";

_openDialerInAppStoreURL = [NSURL URLWithString:
[NSString stringWithFormat:@"https://app.appsflyer.com/id1157770564?pid=third_party_app&c=%@", appIdentifyingName]];
_openDoximityInAppStoreURL = [NSURL URLWithString:
[NSString stringWithFormat:@"https://app.appsflyer.com/id393642611?pid=third_party_app&c=%@", appIdentifyingName]];
}
return _openDialerInAppStoreURL;
return _openDoximityInAppStoreURL;
}

#pragma mark Private Helpers
-(BOOL)isDialerInstalled {
return [UIApplication.sharedApplication canOpenURL:self.dialerSchemeURL];
-(BOOL)isDoximityInstalled {
return [UIApplication.sharedApplication canOpenURL:self.doximitySchemeURL];
}


Expand Down
16 changes: 8 additions & 8 deletions README.md
@@ -1,6 +1,6 @@
<p align="center">
<a href="https://github.com/doximity/CallWithDoxDialer/"><img src="ReadmeResources/logo.png" width="200" alt="CallWithDoxDialer" /></a><br /><br />
A µLibrary for making calls using <a href="https://www.doximity.com/clinicians/download/dialer/">Doximity Dialer</a>.<br /><br />
A µLibrary for making calls using <a href="https://www.doximity.com">Doximity</a>.<br /><br />
</p>
<br />

Expand All @@ -9,9 +9,9 @@

## What is CallWithDoxDialer?

Doximity's [Dialer][] app lets healthcare professionals make phone calls to patients while on the go -- without revealing personal phone numbers. Calls are routed through Doximity's HIPPA-secure platform and relayed to the patient who will see the doctor's office number in the Caller ID. Doximity Dialer is currently available to verified physicians, nurse practitioners, physician assistants and pharmacists in the United States.
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 Dialer app.
This µLibrary lets 3rd-party apps easily initiate calls through the Doximity app.

## Other Platforms

Expand All @@ -20,8 +20,8 @@ This µLibrary lets 3rd-party apps easily initiate calls through the Doximity Di
## Usage

### Core Functionality
To initiate a call using Doximity Dialer, simply call the `dialPhoneNumber` method on the shared `DoxDialerCaller` instance.
If the Doximity Dialer app is not installed, this call will direct the user to Doximity Dialer on the App Store.
To initiate a call using Doximity, simply call the `dialPhoneNumber` method on the shared `DoxDialerCaller` instance.
If the Doximity app is not installed, this call will direct the user to Doximity on the App Store.

Most reasonable phone number formats are accepted by the `dialPhoneNumber` method, e.g.:
- using numbers only: `6502333444`
Expand All @@ -47,7 +47,7 @@ DoxDialerCaller.shared().dialPhoneNumber("4254443333")
```

### Icons
The library also includes a version of the Doximity Dialer icon appropriate for use inside buttons.
The library also includes a version of the Doximity icon appropriate for use inside buttons.
It's available through
- `DoxDialerCaller.shared().dialerIcon()`
- `DoxDialerCaller.shared().dialerIconAsTemplate()` (for use in tinted views)
Expand All @@ -58,12 +58,12 @@ It's available through

CallWithDoxDialer supports iOS 8.0+.

First, you must give your app permission to open the Dialer app.
First, you must give your app permission to open the Doximity app.

<img src="ReadmeResources/InfoPlistExample.png" height="100"/>

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


#### Carthage
Expand Down
Binary file modified ReadmeResources/InfoPlistExample.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ReadmeResources/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 96ceb54

Please sign in to comment.