├── .gitattributes ├── APIPassword-for-offline-login.md ├── Auto-update-cached-templates.md ├── CHANGELOG.md ├── Compose-Envelope.md ├── DocuSign-framework.podspec ├── DocuSign.podspec ├── Embedded-Signing.md ├── LICENSE.txt ├── MigrationGuidev4.0.0.md ├── Package.swift ├── README.md ├── SwiftPackageManager.md ├── Using-Envelope-Defaults.md ├── docusign-sdk-sample-objc ├── AlluraTemplate.pdf ├── Podfile ├── README.md ├── docusign-sdk-sample-objc.xcodeproj │ └── project.pbxproj └── docusign-sdk-sample-objc │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x-1.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x-1.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x-1.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ ├── Contents.json │ ├── Icon-App-76x76.imageset │ │ ├── Contents.json │ │ └── Icon-App-76x76@2x.png │ ├── Icon-App-76x76@1x.imageset │ │ ├── Contents.json │ │ └── Icon-App-76x76@1x.png │ ├── bt_auto.imageset │ │ ├── Contents.json │ │ └── bt_auto.png │ ├── bt_health.imageset │ │ ├── Contents.json │ │ └── bt_health.png │ ├── bt_home.imageset │ │ ├── Contents.json │ │ └── home.png │ ├── bt_retail.imageset │ │ ├── Contents.json │ │ └── bt_retail.png │ ├── button_auto.imageset │ │ ├── Contents.json │ │ └── button_auto.png │ ├── button_health.imageset │ │ ├── Contents.json │ │ └── button_health.png │ ├── button_home.imageset │ │ ├── Contents.json │ │ └── button_home.png │ ├── button_retail.imageset │ │ ├── Contents.json │ │ └── button_retail.png │ ├── circle_w_plus.imageset │ │ ├── Contents.json │ │ └── circle_w_plus.png │ ├── download.imageset │ │ ├── Contents.json │ │ └── bitmapCopy@3x.png │ └── download_done.imageset │ │ ├── Contents.json │ │ └── download_done.png │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Categories │ ├── NSString+Additions.h │ └── NSString+Additions.m │ ├── ConfigurationConstants.h │ ├── Controllers │ ├── AttachmentViewController.h │ ├── AttachmentViewController.m │ ├── ClaimsViewController.h │ ├── ClaimsViewController.m │ ├── DamageViewController.h │ ├── DamageViewController.m │ ├── DocuSignViewController.h │ ├── DocuSignViewController.m │ ├── DownloadsViewController.h │ ├── DownloadsViewController.m │ ├── LoginViewController.h │ ├── LoginViewController.m │ ├── MainContainerViewController.h │ ├── MainContainerViewController.m │ ├── PolicyViewController.h │ ├── PolicyViewController.m │ ├── TemplatesViewController.h │ └── TemplatesViewController.m │ ├── Images │ └── beach.jpg │ ├── Info.plist │ ├── Managers │ ├── EnvelopesManager.h │ ├── EnvelopesManager.m │ ├── ProfileManager.h │ ├── ProfileManager.m │ ├── TemplatesManager.h │ └── TemplatesManager.m │ ├── Protocols │ └── ContainerWithTableView.h │ ├── Resources │ ├── AccidentChecklist.pdf │ └── LICENSE.txt │ ├── Views │ ├── CustomNavTitle.xib │ ├── DownloadTemplateCell.h │ ├── DownloadTemplateCell.m │ └── DownloadTemplateCell.xib │ ├── docusign_sdk_sample_objc.xcdatamodeld │ ├── .xccurrentversion │ └── docusign_sdk_sample_objc.xcdatamodel │ │ └── contents │ └── main.m ├── docusign-sdk-sample-swift ├── Podfile ├── README.md ├── TGK-Capital-Template.pdf ├── docusign-sdk-sample-swift.xcodeproj │ └── project.pbxproj └── docusign-sdk-sample-swift │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AddAttachment.imageset │ │ ├── AddAttachment.png │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024-1.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x-1.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x-1.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x-1.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ ├── ClientGraph.imageset │ │ ├── ClientGraph.png │ │ └── Contents.json │ ├── Contents.json │ ├── download.imageset │ │ ├── Contents.json │ │ └── download.png │ ├── download_done.imageset │ │ ├── Contents.json │ │ └── download_done.png │ └── graphs.imageset │ │ ├── Contents.json │ │ └── graphs.png │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Controllers │ ├── AgreementsViewController.swift │ ├── AttachmentViewController.swift │ ├── ClientViewController.swift │ ├── ContactViewController.swift │ ├── DocuSignViewController.swift │ ├── InvestmentViewController.swift │ ├── LoginViewController.swift │ ├── MainContainerViewController.swift │ ├── OverviewViewController.swift │ ├── PortfolioViewController.swift │ └── TemplatesViewController.swift │ ├── Extensions │ └── NSString+Extensions.swift │ ├── Images │ └── tgk-financial.jpg │ ├── Info.plist │ ├── Managers │ ├── EnvelopesManager.swift │ ├── ProfileManager.swift │ └── TemplatesManager.swift │ ├── Protocols │ └── ContainerWithTableView.swift │ ├── Resources │ ├── LICENSE.txt │ ├── Portfolio.pdf │ ├── TGK_Capital_Logo.png │ └── UtilityBill.pdf │ ├── Views │ ├── AppointmentTableViewCell.swift │ ├── AppointmentTableViewCell.xib │ ├── CustomNavTitle.xib │ ├── TemplateTableViewCell.swift │ └── TemplateTableViewCell.xib │ └── docusign_sdk_sample_swift.xcdatamodeld │ ├── .xccurrentversion │ └── docusign_sdk_sample_swift.xcdatamodel │ └── contents ├── docusign-sdk-sample-swiftui ├── Podfile ├── README.md ├── SwiftUIApp.xcodeproj │ └── project.pbxproj ├── SwiftUIApp.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── SwiftUIApp │ ├── Assets.xcassets │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── ContentView.swift │ ├── Info.plist │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ ├── SwiftUIApp.swift │ └── SwiftUIAppApp.swift ├── SwiftUIAppTests │ ├── Info.plist │ └── SwiftUIAppTests.swift └── SwiftUIAppUITests │ ├── Info.plist │ └── SwiftUIAppUITests.swift ├── images └── docusign.svg └── support-files ├── Auto_Insurance_Claims-without-tab-defaults.png ├── Auto_Insurance_Claims.json ├── Car_insurance_claim_adjuster_template-with-tab-defaults.png ├── Document-Custom-Fields-in-Certificate-of-Completion.png ├── Embedded-Signing-Details.md ├── Home_insurance_claim_adjuster_template-with-tab-defaults.png ├── Home_insurance_claim_adjuster_template.json ├── Integration-Troubleshooting.md ├── Investment_Agreement.pdf ├── Localization.md ├── Permissions-Requirements.md ├── Summary.pdf ├── Telemetry-Details.md ├── captive-signing-postman ├── Add command postman.png ├── DocuSign Captive Recipient - mobile SDK.postman_collection.json ├── Get capacitive url.png ├── postman-config.png ├── postman-env-config.png └── postman-post-envelopes.png ├── docusignsdk-binary-via-pods.png ├── docusignsdk-undefined-symbol.png ├── objc-offline-signing-with-and-without-tab-defaults.mov ├── offline-signing-with-and-without-tab-defaults.mov ├── online-signing-upload-your-signature.jpeg ├── simulator-build-excluded-architectures-arm64.png ├── simulator-build-release-archieve-issue.png └── template-editing-signer-roleName.png /.gitattributes: -------------------------------------------------------------------------------- 1 | DocuSignSDK.xcframework/ios-arm64_armv7/DocuSignSDK.framework/DocuSignSDK filter=lfs diff=lfs merge=lfs -text 2 | DocuSignSDK.xcframework/ios-arm64_i386_x86_64-simulator/DocuSignSDK.framework/DocuSignSDK filter=lfs diff=lfs merge=lfs -text 3 | docusign-sdk-sample-swift/Pods/DocuSign/DocuSignSDK.framework/DocuSignSDK filter=lfs diff=lfs merge=lfs -text 4 | docusign-sdk-sample-swiftui/Pods/DocuSign/DocuSignSDK.framework/DocuSignSDK filter=lfs diff=lfs merge=lfs -text 5 | DocuSignSDK.zip filter=lfs diff=lfs merge=lfs -text 6 | **/DocuSignAPI.framework/Frameworks/libswiftCore.dylib filter=lfs diff=lfs merge=lfs -text 7 | **/DocuSignAPI.framework/DocuSignAPI filter=lfs diff=lfs merge=lfs -text 8 | -------------------------------------------------------------------------------- /APIPassword-for-offline-login.md: -------------------------------------------------------------------------------- 1 | # How to use AccountInfo for offline login when the device has no network connectivity 2 | 3 | At times, client apps don't have network connectivity and the flow to use templates or envelopes in offline mode is blocked until user is logged in with SDK. This section has details on how to enable client app to login with DocuSign Mobile SDK when the device is offline 4 | 5 | Solution using `apiPassword`: `DSMManager` login method `loginWithUserId` should be used first while online to get valid login information returned via `accountInfo` parameter of completion block. Once a successful online login is done, client code should persist the `accountInfo`, and use persisted `apiPassword` to do offline SDK login when device has no network connectivity. 6 | 7 | ## Implementation Details 8 | 9 | ### Existing Login methods availabe with the `DSMManager` 10 | 11 | * `loginWithAccessToken` is the recommended solution for online and offline login 12 | ** As per current SDK implementation, in order to use `loginWithAccessToken`, OAuth2 Code Grant should be implemented to receive `accessToken` to be used for `online` or `offline` SDK login. 13 | ** Link to DocuSign ESign REST API Guide using OAuth2 Code Grant: https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-code-grant 14 | * `loginWithUserId` is online only login method that goes through the legacy authentication API using `username` and `password` combination 15 | * `loginWithAPIPassword` is online and offline login method that goes through the legacy authentication API using `apiPassword` retrieved via `loginWithUserId` method 16 | ** Link to online documentation: https://developers.docusign.com/esign-rest-api/reference/Authentication/Authentication/login 17 | 18 | 19 | `DSMAccountInfo` object is retuned with the completion `completion:^(DSMAccountInfo *accountInfo, NSError *error)` for following login methods exposed in `DSMManager`: 20 | * `loginWithUserId:password:integratorKey:host:completion:` 21 | * `loginWithAccessToken:accountId:userId:userName:email:host:integratorKey:networkMode:completion:` 22 | * `loginWithAPIPassword:accountId:userId:userName:email:host:integratorKey:networkMode:completion:` 23 | 24 | 25 | ### Using `DSMAccountInfo` 26 | 27 | `DSMAccountInfo` composition: 28 | 29 | * `accountId` 30 | * `accountName` 31 | * `apiPassword` nil when `accessToken` is used 32 | * `authenticationMethod` 33 | * `email` 34 | * `host` 35 | * `integratorKey` 36 | * `accessToken` nil when `apiPassword` is used 37 | * `userId` 38 | * `userName` 39 | 40 | When a successful login is done when online, `accountInfo` can be persisted securly in the client app for future use. Apple's Keychain Services (https://developer.apple.com/documentation/security/keychain_services) can be used for securely persisting sensitive information. If the network is unavailable, client app may use `loginWithAccessToken` or `loginWithAPIPassword` to continue the login process when device is offline. All of the offline functionality will be available when offline login is done. Some of the online methods would result in errors, and to resolve those, client app is required to use the online login methods to proceed with online functionalities. 41 | 42 | ### Note: Avoid logging and exposing any of the sensitive data returned with `DSMAccountInfo` object. 43 | 44 | -------------------------------------------------------------------------------- /Auto-update-cached-templates.md: -------------------------------------------------------------------------------- 1 | 2 | # How to auto update the cached templates 3 | 4 | ### How to only update the templates which have been cached earlier and were changed on DocuSign web? 5 | 6 | Solution: Compare `lastModified` and `cachedDateTime` to selectively download modified templates 7 | 8 | ### Implementation details 9 | 10 | Rather than relying on users to remove the cached template and download the updated templates again, following solution can be used for automatically updating the cached templates download. This can be done on client side by issuing a `cacheTemplateWithId` call for only templates which were changed after caching was done. It can be deduced after the comparision of modified and cached datetime for templates. 11 | 12 | ### Template's last modified datetime 13 | 14 | `DSMEnvelopeTemplateDefinition` is the lightweight object; its array is returned with the `[DSMTemplateManager listTemplatesWithCompletion:..]` method. It has a property `lastModified` that refers to modified time on the remote (on server) template. 15 | 16 | ``` 17 | @interface DSMEnvelopeTemplateDefinition : NSObject 18 | 19 | /*! 20 | * @brief The date and time the item was last modified. [optional] 21 | */ 22 | @property(nonatomic, copy) NSDate *lastModified; 23 | 24 | @end 25 | ``` 26 | 27 | Sample `lastModified` 28 | 29 | ``` 30 | (lldb) po templateDefinition.lastModified 31 | 2018-10-30 15:05:21 +0000 32 | ``` 33 | 34 | 35 | ### Template's last cached datetime 36 | 37 | `DSMEnvelopeTemplate` is the cached copy of the template. It has a property `cachedDateTime` that stores the last time the template was stored successfully on device. 38 | 39 | 40 | ``` 41 | @interface DSMEnvelopeTemplate : NSObject 42 | 43 | /*! 44 | * @brief The date and time the envelope or template was cached. 45 | */ 46 | @property (nonatomic, copy) NSDate *cachedDateTime; 47 | 48 | @end 49 | ``` 50 | 51 | Sample `cachedDateTime` 52 | ``` 53 | (lldb) po cachedTemplate.cachedDateTime 54 | 2018-10-30 15:04:57 +0000 55 | ``` 56 | 57 | ### Sample code 58 | 59 | Code snippet to auto download a template if it was modified. It compares the lastModified datetime on remote template vs cached template. 60 | 61 | ``` 62 | - (void)autoUpdateCacheForTemplates:(NSArray *)envelopeTemplateDefinitions { 63 | 64 | // array containing all cached templates 65 | NSArray *cachedTemplates = [self.templatesManager cachedTemplates]; 66 | 67 | // iterate over the cached templates array 68 | for (DSMEnvelopeTemplate *cachedTemplate in cachedTemplates) { 69 | 70 | // cached template Id is used to filter the updated envelope template definition (unique template id) 71 | NSString *templateId = cachedTemplate.envelopeTemplateDefinition.templateId; 72 | 73 | // updated (remote) envelope template definition reference. Filter the list of templates with a matching cached templates id. 74 | DSMEnvelopeTemplateDefinition *updatedTemplateDefinition = 75 | [[envelopeTemplateDefinitions filteredArrayUsingPredicate:[NSPredicate predicateWithBlock: 76 | ^BOOL(DSMEnvelopeTemplateDefinition *envelopeTemplateDefinition, NSDictionary *bindings) { 77 | return [templateId isEqualToString:envelopeTemplateDefinition.templateId]; 78 | } 79 | ]] firstObject]; 80 | 81 | // cache (download) template again if it was modified after the last time it was cached 82 | if ([cachedTemplate.cachedDateTime compare:[updatedTemplateDefinition lastModified]] == NSOrderedAscending) { 83 | [self.templatesManager cacheTemplateWithId:templateId completion:^(NSError *error) { 84 | // handle error and reload view 85 | } 86 | }]; 87 | } 88 | } 89 | } 90 | 91 | - (void)fetchTemplates { 92 | // get list of templates when online 93 | [self.templatesManager listTemplatesWithCompletion:^(NSArray *envelopeTemplateDefinitions, NSError *error) { 94 | if (error) { 95 | // handle error 96 | } else { 97 | // try to auto download the updated templates 98 | [self autoUpdateCacheForTemplates:envelopeTemplateDefinitions]; 99 | // reload view 100 | [self.tableView reloadData]; 101 | } 102 | }]; 103 | } 104 | ``` 105 | 106 | 107 | -------------------------------------------------------------------------------- /DocuSign-framework.podspec: -------------------------------------------------------------------------------- 1 | # Be sure to run `pod lib lint DocuSign.podspec' to ensure this is a 2 | # valid spec before submitting. 3 | Pod::Spec.new do |s| 4 | s.name = 'DocuSign-framework' 5 | s.version = '2.7.0' 6 | s.summary = 'DocuSign Native iOS Framework to sign and send in your iOS apps' 7 | 8 | s.description = <<-DESC 9 | DocuSign Native iOS Framework to sign and send in your iOS apps: 10 | - The DocuSign Native iOS SDK is compatible with both Swift and Objective-C applications. 11 | - Easily integrate DocuSign’s platform into your app with access to existing templates. 12 | - Sign and complete any document-based transaction, whether you’re online or where connectivity may be unreliable or nonexistent. 13 | - Custom fields in your templates are seamlessly populated with your own app’s data, which could include customer or contact information. 14 | DESC 15 | 16 | s.homepage = 'https://github.com/docusign/native-ios-sdk' 17 | s.screenshots = 'https://developers.docusign.com/docs/ios-sdk/images/signature-phone.png', 'https://developers.docusign.com/docs/ios-sdk/images/fields.png' 18 | s.license = { :type => 'DOCUSIGN SOFTWARE LICENSE AGREEMENT', :file => 'LICENSE.txt' } 19 | s.author = { 'DocuSign' => 'devcenter@docusign.com' } 20 | s.social_media_url = 'https://twitter.com/DocuSignAPI' 21 | 22 | s.platform = :ios, '10.0' 23 | s.ios.deployment_target = '10.0' 24 | s.requires_arc = true 25 | s.preserve_paths = 'DocuSignSDK.framework' 26 | s.public_header_files = 'DocuSignSDK.framework/Headers/*.h' 27 | s.vendored_frameworks = 'DocuSignSDK.framework' 28 | s.resource = 'DocuSignSDK.framework/DocuSignSDK.bundle' 29 | # Update the source path for new release 30 | s.source = { :http => "https://github.com/docusign/native-ios-sdk/raw/release/2.7/DocuSignSDK-framework.zip"} 31 | s.source_files = 'DocuSignSDK.framework/Headers/*.h' 32 | 33 | end 34 | -------------------------------------------------------------------------------- /DocuSign.podspec: -------------------------------------------------------------------------------- 1 | # Be sure to run `pod lib lint DocuSign.podspec' to ensure this is a 2 | # valid spec before submitting. 3 | 4 | Pod::Spec.new do |s| 5 | s.name = 'DocuSign' 6 | s.version = '4.0.1' 7 | s.summary = 'Docusign Native iOS Framework to sign and send in your iOS apps' 8 | 9 | s.description = <<-DESC 10 | Docusign Native iOS Framework to sign and send in your iOS apps: 11 | - The Docusign Native iOS SDK is compatible with both Swift and Objective-C applications. 12 | - Easily integrate Docusign’s platform into your app with access to existing templates. 13 | - Sign and complete any document-based transaction, whether you’re online or where connectivity may be unreliable or nonexistent. 14 | - Custom fields in your templates are seamlessly populated with your own app’s data, which could include customer or contact information. 15 | DESC 16 | 17 | s.homepage = 'https://github.com/docusign/native-ios-sdk' 18 | s.screenshots = 'https://developers.docusign.com/docs/ios-sdk/images/signature-phone.png', 'https://developers.docusign.com/docs/ios-sdk/images/fields.png' 19 | s.license = { :type => 'DOCUSIGN SOFTWARE LICENSE AGREEMENT', :file => 'LICENSE.txt' } 20 | s.author = { 'Docusign' => 'devcenter@docusign.com' } 21 | s.social_media_url = 'https://twitter.com/DocusignAPI' 22 | 23 | s.platform = :ios, '12.0' 24 | s.ios.deployment_target = '12.0' 25 | s.requires_arc = true 26 | s.preserve_paths = ['DocuSignSDK.xcframework', 'DocuSignAPI.xcframework'] 27 | s.vendored_frameworks = [ 28 | "DocuSignSDK.xcframework", 29 | "DocuSignAPI.xcframework"] 30 | s.resource = 'DocuSignSDK.xcframework/**/DocuSignSDK.bundle' 31 | # Update the source path for new release 32 | s.source = { :http => "https://docucdn-a.akamaihd.net/prod/docusigniossdk/4.0.1/DocuSignCombined.zip"} 33 | end 34 | -------------------------------------------------------------------------------- /MigrationGuidev4.0.0.md: -------------------------------------------------------------------------------- 1 | # Docusign iOS SDK version 4.0 Migration guide 2 | 3 | ## Summary 4 | 5 | This guide is for customers who are using Docusign iOS SDK version below 4.0 in their mobile apps. Please refer to this guide to migrate from an older version of Docusign SDK to version 4.0 (and above). 6 | 7 | With this new version of SDK, v4.0, we have moved our Envelope offline signing and Template offline Sending to use modern components, with better performance and smaller footprint. 8 | 9 | Due to these changes and in our attempt to modularize our SDK, we introduced a new Framework **DocusignNative**. It is still within the same **DocuSignSDK package**, so there are no changes in how you integrate with our SDK either through Cocoapods or through SPM. However, there are some breaking changes when calling methods from `DSMEnvelopesManager` and `DSMTemplatedManager`. These methods have now moved to `NativeSigningManager` in the DocusignNative Module. Here are the steps to migrate these flows. 10 | 11 | ### Replaced Functionality: 12 | 13 | 1. **Offline envelope signing** 14 | The method `resumeSigningEnvelope(withPresenting:, envelopeId:, completion:)` inside `DSMEnvelopesManager`, is now simply replaced with a very similar method `resumeSigning(presentingVC:, envelopeId:)` from `NativeSigningManager`. The parameters are still the same, only change is that it’s from a different Manager now and it supports new swift concurrency 15 | 16 | 17 | ``` 18 | do { 19 | let vc = try await NativeSigningManager().resumeSigning(presentingVC: presentingController, envelopeId: id) 20 | } catch let error { 21 | print(error) 22 | } 23 | ``` 24 | 25 | 2. **Offline Template Sending (and Signing)** 26 | The method `presentSendTemplateControllerWithTemplate(withId:, envelopeDefaults:, pdfToInsert:, insertAtPosition: , signingMode: , presenting:, animated:, completion:)` inside `DSMTemplatesManager`, is now simply replaced with a very similar method `presentSendTemplate(presentingViewController:, templateId:, envelopeDefaults:, insertAtPosition:, pdfToInsert:, animated:)` from `NativeSigningManager`. The parameters are still the same, only change is that it’s from a different Manager now and it **supports new swift concurrency**. 27 | 28 | 29 | ``` 30 | do { 31 | let vc = try await self.mNativeSigningManager?.presentSendTemplate(presentingViewController: presentingVC, templateId: templateId, envelopeDefaults: envelopeDefaults, insertAtPosition: .beginning, pdfToInsert: nil, animated: true) 32 | completion(vc, nil) 33 | } catch { 34 | completion(nil, error) 35 | } 36 | ``` 37 | 38 | ### Deprecated Functionality: 39 | 40 | - Compose Envelope, UI Flow to create envelopes from scratch, has been fully deprecated. 41 | 42 | ``` 43 | presentComposeEnvelopeControllerWithPresentingController 44 | ``` 45 | 46 | - Non-PDF File conversion: Creating `DSMEnvelopeDefinition` with documents that are non-PDF type will cause an error of type `invalidDocumentFormat`. 47 | 48 | ### Added Functionality: 49 | 50 | - New configuration to allow SDK to detect page rotation on documents and adjust it to ensure tags are rendered upright, default value is `false`. Set to `true` in case tags are showing rotated on documents. 51 | 52 | ``` 53 | DSM_SETUP_ENABLE_OFFLINE_NORMALIZE_ROTATED_DOCUMENTS_KEY 54 | ``` 55 | 56 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 6.0 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "Docusign", 8 | products: [ 9 | .library(name: "DocuSignSDK", targets: ["DocuSignSDK"]), 10 | .library(name: "DocuSignAPI", targets: ["DocuSignAPI"]), 11 | .library(name: "DocusignNative", targets: ["DocusignNative"]), 12 | ], 13 | targets: [ 14 | .binaryTarget(name: "DocuSignSDK", url: "https://docucdn-a.akamaihd.net/prod/docusigniossdk/4.0.1/DocuSignSDK.zip", checksum: "0834d3764c18d9538288ac379778172451b1e13646608d47ffd8f6a54f91094e"), 15 | .binaryTarget(name: "DocuSignAPI", url: "https://docucdn-a.akamaihd.net/prod/docusigniossdk/4.0.1/DocuSignAPI.zip", checksum: "839c637dba1e11961b9c92073364505332019aa742711554685349c84cd1dd6d"), 16 | .binaryTarget(name: "DocusignNative", url: "https://docucdn-a.akamaihd.net/prod/docusigniossdk/4.0.1/DocusignNative.zip", checksum: "1ae049dfc42973d4ae3de498b329dad8b5dd9987d0e79ef1ca1936de90acebb8"), 17 | ] 18 | ) 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Docusign Logo 3 |

4 | 5 | # Docusign Native iOS SDK 6 | 7 | The Docusign Native iOS SDK is a framework for Objective-C and Swift projects. Using the SDK, you can integrate Docusign's online and offline signing features into your iOS application. Leverage native iOS UI components to integrate with the Docusign ecosystem and use various features in your app. 8 | 9 | Please refer to the [official site](https://developers.docusign.com/docs/mobile-sdks/ios-sdk/) for detailed instructions and getting started with Docusign Sandbox. 10 | 11 | Requirements 12 | ============ 13 | - Requires iOS 13 or later. 14 | - It is recommended that developers use Xcode 12.0 or later. 15 | 16 | Installation 17 | ============= 18 | 19 | **SPM** 20 | 21 | Instructions for [Swift Package Manager](https://www.swift.org/documentation/package-manager/) support can be found in the S[wiftPackageManager.md](https://github.com/docusign/native-ios-sdk/blob/feature/spm-support/SwiftPackageManager.md) Markdown file. 22 | 23 | **CocoaPods** 24 | 25 | Refer to [Getting Started Guide](https://guides.cocoapods.org/using/getting-started.html) to install CocoaPods via `gem install cocoapods` command and initialize the project. 26 | 27 | * Add `pod 'DocuSign'` to podfile to target(s) in your project. Example: [Swift Sample App Podfile](docusign-sdk-sample-swift/Podfile) 28 | * Run `pod install` in the same directory as your `Podfile` to get the Docusign Native iOS SDK pod. This should result in `Installing DocuSign `[Latest Release](https://github.com/docusign/native-ios-sdk/releases) output on the console and corresponding changes in the `Podfile.lock`. 29 | * In case of an existing project that uses an older version of 'DocuSign' pod, run `pod update 'DocuSign'` command on the terminal to update 'DocuSign' pod to the latest version from a previous version. 30 | * Launch modified `.xcworkspace` project file with Xcode and use workspace going forward instead of `.xcodeproj` file. 31 | * Refer to [Integration Troubleshooting](support-files/Integration-Troubleshooting.md) in case of any issues. 32 | 33 | Additional information related to cocoapods is also avaiable with [swift app](docusign-sdk-sample-swift/), [objective-c app](docusign-sdk-sample-objc/) and [swiftUI app](docusign-sdk-sample-swiftui/). 34 | 35 | **Manual Integration Guide** 36 | 37 | Use these steps to manually integrate the DocuSign framework in case your project doesn't use CocoaPods. 38 | 39 | * Download the [DocuSignSDKCombined.zip](./DocuSignSDKCombined.zip) from the path [here](./DocuSign.podspec#L32) and unarchive it. 40 | * Copy the extracted folder to your project and add `DocuSignSDK.xcframework` and `DocuSignAPI.xcframework` to your dependencies. 41 | 42 | Support 43 | =========== 44 | 45 | * Refer the [Getting Started](https://developers.docusign.com/ios_sdk/developer.html) and [Integration](https://developers.docusign.com/ios_sdk/developer.html) section on the **Developer's Site** for more details on creating Docusign Sandbox Account, Integration and using SDK Core Interfaces. 46 | * [Reference Docs](https://docusign.github.io/native-ios-sdk/documentation/docusignsdk/) to browse the latest developer documentation including API reference and public header files. 47 | * Review [Change Log](CHANGELOG.md) 48 | 49 | Guides: 50 | * [Integration Troubleshooting](support-files/Integration-Troubleshooting.md) 51 | * [Using Envelope Defaults](Using-Envelope-Defaults.md) 52 | * [Privacy - Usage Permissions](support-files/Permissions-Requirements.md) for Camera, Photo Library, Contacts and Location Access. 53 | * [Telemetry Details](support-files/Telemetry-Details.md) 54 | * [Embedded Signing](Embedded-Signing.md) 55 | * [Composing Envelopes](Compose-Envelope.md) 56 | 57 | Sample apps: 58 | * For SDK version `2.6.0` and above refer our latest: [TGK Financial Sample App](https://github.com/docusign/sample-app-tgk-financial-ios/) 59 | [Deprecated] Sample Apps for reference with different languages 60 | * [swift](docusign-sdk-sample-swift/): Templates, Offline Envelopes, Events 61 | * [objective-c](docusign-sdk-sample-objc/): Templates, Offline Envelopes, Events 62 | * [swiftUI](docusign-sdk-sample-swiftui/): Captive (Embedded) Signing 63 | 64 | Reaching out: 65 | * Open an [issue](https://github.com/docusign/native-ios-sdk/issues). 66 | * Docusign also have an active developer community on Stack Overflow, search the [DocuSignAPI](http://stackoverflow.com/questions/tagged/docusignapi) tag. 67 | 68 | License 69 | ======= 70 | 71 | The Docusign Native iOS SDK is licensed under the following [License](LICENSE.docx). 72 | -------------------------------------------------------------------------------- /SwiftPackageManager.md: -------------------------------------------------------------------------------- 1 | # Integrating with Docusign via Swift Package Manager (SPM) 2 | 3 | ## Installation 4 | 5 | ### Using Xcode 6 | 7 | 1. **Open your project** in Xcode 16.x. 8 | 2. Navigate to **File** → **Add Package Dependency**. 9 | 3. In the dialog that appears, enter the following **Docusign GitHub repository URL** for this library: `https://github.com/docusign/native-ios-sdk.git` 10 | 4. Xcode will automatically fetch the repository and prompt you to select the version <= `3.5.0` you want to use. 11 | 5. After that, Xcode will integrate the package into your project and you’ll be able to import the library. 12 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/AlluraTemplate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/AlluraTemplate.pdf -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '10.0' 3 | 4 | target 'docusign-sdk-sample-objc' do 5 | 6 | # Pods for docusign-sdk-sample-objc 7 | pod 'ProgressHUD' 8 | pod 'DocuSign' 9 | 10 | end 11 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/README.md: -------------------------------------------------------------------------------- 1 | # docusign-sdk-app-objc 2 | DocuSign Native iOS SDK - Sample App in Objective-C 3 | 4 | Install 5 | ============= 6 | * Launch Terminal and change directory to `docusign-sdk-sample-objc` 7 | * Perform `pod install` to fetch latest `DocuSign` pod. 8 | * Or run `pod update 'DocuSign'` command on terminal to update 'DocuSign' pod to the latest version from a previous version. 9 | * Launch `docusign-sdk-sample-objc.xcworkspace` with XCode 10 | * Please see the [Getting Started](https://developers.docusign.com/ios_sdk/developer.html) and [Integration](https://developers.docusign.com/ios_sdk/developer.html) section on the **Developer's Site** for more details. 11 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @property (readonly, strong) NSPersistentContainer *persistentContainer; 16 | 17 | // manage if app is allowed to rotate orientation per screen 18 | @property () BOOL restrictRotation; 19 | 20 | - (void)saveContext; 21 | 22 | @end 23 | 24 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-40x40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-60x60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "20x20", 53 | "idiom" : "ipad", 54 | "filename" : "Icon-App-20x20@1x.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@2x-1.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-29x29@1x.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@2x-1.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-40x40@1x.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@2x-1.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "76x76", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-76x76@1x.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@2x.png", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "size" : "83.5x83.5", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-83.5x83.5@2x.png", 103 | "scale" : "2x" 104 | } 105 | ], 106 | "info" : { 107 | "version" : 1, 108 | "author" : "xcode" 109 | } 110 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/Icon-App-76x76.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Icon-App-76x76@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/Icon-App-76x76.imageset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/Icon-App-76x76.imageset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/Icon-App-76x76@1x.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Icon-App-76x76@1x.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/Icon-App-76x76@1x.imageset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/Icon-App-76x76@1x.imageset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_auto.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bt_auto.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_auto.imageset/bt_auto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_auto.imageset/bt_auto.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_health.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bt_health.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_health.imageset/bt_health.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_health.imageset/bt_health.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "home.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_home.imageset/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_home.imageset/home.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_retail.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bt_retail.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_retail.imageset/bt_retail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/bt_retail.imageset/bt_retail.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_auto.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "button_auto.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_auto.imageset/button_auto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_auto.imageset/button_auto.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_health.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "button_health.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_health.imageset/button_health.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_health.imageset/button_health.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "button_home.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_home.imageset/button_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_home.imageset/button_home.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_retail.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "button_retail.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_retail.imageset/button_retail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/button_retail.imageset/button_retail.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/circle_w_plus.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "circle_w_plus.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/circle_w_plus.imageset/circle_w_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/circle_w_plus.imageset/circle_w_plus.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/download.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bitmapCopy@3x.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/download.imageset/bitmapCopy@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/download.imageset/bitmapCopy@3x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/download_done.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "download_done.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/download_done.imageset/download_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Assets.xcassets/download_done.imageset/download_done.png -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Categories/NSString+Additions.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | NS_ASSUME_NONNULL_BEGIN 4 | 5 | @interface NSString (Additions) 6 | 7 | + (NSString *)titleWithSDKVersion:(BOOL)withSDKVersion; 8 | 9 | @end 10 | 11 | NS_ASSUME_NONNULL_END 12 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Categories/NSString+Additions.m: -------------------------------------------------------------------------------- 1 | #import "NSString+Additions.h" 2 | @import DocuSignSDK; 3 | 4 | @implementation NSString (Additions) 5 | 6 | + (NSString *)titleWithSDKVersion:(BOOL)withSDKVersion { 7 | if (withSDKVersion) { 8 | return [NSString stringWithFormat:@"Developer's Notes (%@)", [DSMManager buildVersion]]; 9 | } 10 | return [NSString stringWithFormat:@"Developer's Notes"]; 11 | }; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/ConfigurationConstants.h: -------------------------------------------------------------------------------- 1 | #ifndef ConfigurationConstants_h 2 | #define ConfigurationConstants_h 3 | 4 | /** Configuration constant to show the damage attachment screen. Setting it to NO will skip the damage attachement entirely. 5 | */ 6 | static BOOL const CONFIGURATION_SHOW_DAMAGE_ATTACHMENT = YES; 7 | 8 | /** Configuration constant to show the (developer) dialog to choose between offline vs online signing. 9 | */ 10 | static BOOL const CONFIGURATION_SHOW_OFFLINE_ONLINE_SIGNING_DEV_PROMPT = YES; 11 | 12 | /** Configuration constant to use "offline signing" mode as default when (developer) dialog to choose between offline vs online signing is disabled via the CONFIGURATION_SHOW_OFFLINE_ONLINE_SIGNING_DEV_PROMPT (set as NO). 13 | */ 14 | static BOOL const CONFIGURATION_DEFAULT_TO_OFFLINE_SIGNING = YES; 15 | 16 | /** Configuration constant to show the sync confirmation (developer) dialog when user completes the signing 17 | * process. Sync confirmation is shown again when a pending envelope for sync is tapped. 18 | */ 19 | static BOOL const CONFIGURATION_SHOW_SYNC_DEV_PROMPT = YES; 20 | 21 | #endif /* ConfigurationConstants_h */ 22 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/AttachmentViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AttachmentViewController.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface AttachmentViewController : UIViewController 11 | @end 12 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/AttachmentViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AttachmentViewController.m 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import "AttachmentViewController.h" 9 | 10 | #import "AppDelegate.h" 11 | #import "ProfileManager.h" 12 | #import "NSString+Additions.h" 13 | 14 | @interface AttachmentViewController () 15 | 16 | // ui elements 17 | @property (nonatomic, strong) IBOutlet UIBarButtonItem * bt_skip; 18 | @property (nonatomic, strong) IBOutlet UIButton * bt_attachDoc; 19 | @property (nonatomic, strong) IBOutlet UIWebView * wv_document; 20 | 21 | @end 22 | 23 | 24 | @implementation AttachmentViewController 25 | 26 | 27 | #pragma mark - UI Lifecycle Methods 28 | 29 | - (void) viewDidLoad 30 | { 31 | [super viewDidLoad]; 32 | [self styleUIElements]; 33 | } 34 | 35 | 36 | - (void) viewWillAppear:(BOOL)animated 37 | { 38 | // allow only portrait orientation 39 | AppDelegate* appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate; 40 | appDelegate.restrictRotation = TRUE; 41 | } 42 | 43 | 44 | #pragma mark - IBAction Methods 45 | 46 | - (IBAction)addAttachment:(id)sender 47 | { 48 | // display PDF attachment 49 | NSString * path = [[NSBundle mainBundle] pathForResource:@"AccidentChecklist" ofType:@"pdf"]; 50 | NSURL * targetURL = [NSURL fileURLWithPath:path]; 51 | NSURLRequest * request = [NSURLRequest requestWithURL:targetURL]; 52 | [self.wv_document loadRequest:request]; 53 | [self.wv_document setHidden:FALSE]; 54 | 55 | // hide attach button 56 | [self.bt_attachDoc setHidden:TRUE]; 57 | 58 | // update navigation button 59 | self.bt_skip.title = @"Next"; 60 | 61 | // capture attachment url 62 | [[ProfileManager sharedInstance] setAttachmentPath:path]; 63 | 64 | // display developer's prompt 65 | if ([ProfileManager displayDeveloperNotes]) { 66 | [self promptAttachmentIncluded]; 67 | } 68 | } 69 | 70 | 71 | #pragma mark - Private Methods 72 | 73 | - (void) styleUIElements 74 | { 75 | // add custom nav title 76 | UIView * navTitleView = [[[NSBundle mainBundle] loadNibNamed:@"CustomNavTitle" owner:self options:nil] lastObject]; 77 | self.navigationItem.titleView = navTitleView; 78 | 79 | // border for attachment button 80 | UIColor * borderColor = [UIColor colorWithRed:7.0/255.0 green:62.0/255.0 blue:87.0/255.0 alpha:1.0]; 81 | [self.bt_attachDoc.layer setBorderWidth:1.0]; 82 | [self.bt_attachDoc.layer setBorderColor:[borderColor CGColor]]; 83 | } 84 | 85 | 86 | - (void) promptAttachmentIncluded 87 | { 88 | // display developer's notes regarding PDF attachment 89 | UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]; 90 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[NSString titleWithSDKVersion:YES] message:@"For sample purposes, we have included a PDF document that has been attached. Ordinarily, you would guide the user through selecting an external PDF document to attach to the envelope." preferredStyle:UIAlertControllerStyleAlert]; 91 | 92 | [alertController addAction:okAction]; 93 | [self presentViewController:alertController animated:YES completion:nil]; 94 | } 95 | 96 | 97 | @end 98 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/ClaimsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ClaimsViewController.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface ClaimsViewController : UIViewController 11 | @end 12 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/DamageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DamageViewController.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface DamageViewController : UIViewController 11 | @end 12 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/DamageViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DamageViewController.m 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import "DamageViewController.h" 9 | #import "ProfileManager.h" 10 | #import "ConfigurationConstants.h" 11 | #import "NSString+Additions.h" 12 | 13 | @interface DamageViewController () 14 | 15 | // ui elements 16 | @property (nonatomic, strong) IBOutlet UIBarButtonItem * barButtonNext; 17 | @property (nonatomic, strong) IBOutlet UITextField * tf_damageDate; 18 | @property (nonatomic, strong) IBOutlet UITextField * tf_damageType; 19 | @property (nonatomic, strong) IBOutlet UITextField * tf_damageEstimate; 20 | @property (nonatomic, strong) IBOutlet UITextView * tv_damageComments; 21 | 22 | @end 23 | 24 | 25 | @implementation DamageViewController 26 | 27 | 28 | #pragma mark - UI Lifecycle Methods 29 | 30 | - (void) viewDidLoad 31 | { 32 | [super viewDidLoad]; 33 | [self styleUIElements]; 34 | 35 | // for sample, pre-populate fake damage info 36 | [self loadDamageInfo]; 37 | } 38 | 39 | 40 | #pragma mark - IBAction Methods 41 | 42 | - (IBAction) nextButtonTapped:(id)sender 43 | { 44 | // save damage info 45 | [[ProfileManager sharedInstance] setDamageInfo:[self createDamageInfoDict]]; 46 | 47 | // for demo: determine whether user wants online or offline flow 48 | if (CONFIGURATION_SHOW_OFFLINE_ONLINE_SIGNING_DEV_PROMPT) { 49 | [self promptOnlineOrOffline]; 50 | } else { 51 | if (CONFIGURATION_DEFAULT_TO_OFFLINE_SIGNING) { 52 | [[ProfileManager sharedInstance] setOfflineFlow:YES]; 53 | } else { 54 | [[ProfileManager sharedInstance] setOfflineFlow:NO]; 55 | } 56 | [self performSegueWithIdentifier:@"segue_docusign" sender:self]; 57 | } 58 | } 59 | 60 | 61 | #pragma mark - Private Methods 62 | 63 | - (void) loadDamageInfo 64 | { 65 | // for demo: populate damage info fields with fake data 66 | NSDictionary * damageInfo = [ProfileManager getFakeDamageInfo]; 67 | self.tf_damageType.text = damageInfo[@"damageType"]; 68 | self.tf_damageDate.text = damageInfo[@"damageDate"]; 69 | self.tf_damageEstimate.text = damageInfo[@"damageEstimate"]; 70 | self.tv_damageComments.text = damageInfo[@"damageComments"]; 71 | } 72 | 73 | 74 | - (NSDictionary *) createDamageInfoDict 75 | { 76 | NSDictionary * damageInfo = @{@"damageType":self.tf_damageType.text, 77 | @"damageDate":self.tf_damageDate.text, 78 | @"damageEstimate":self.tf_damageEstimate.text, 79 | @"damageComments":self.tv_damageComments.text 80 | }; 81 | return damageInfo; 82 | } 83 | 84 | 85 | - (void) promptOnlineOrOffline 86 | { 87 | UIAlertAction *selectOfflineAction = [UIAlertAction actionWithTitle:@"Offline" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 88 | NSLog(@"User selected offline flow"); 89 | [[ProfileManager sharedInstance] setOfflineFlow:TRUE]; 90 | 91 | // for offline flow, segue to attachment screen 92 | [self performSegueWithIdentifier:@"segue_damage_attachment" sender:self]; 93 | }]; 94 | 95 | UIAlertAction *selectOnlineAction = [UIAlertAction actionWithTitle:@"Online" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { 96 | NSLog(@"User selected online flow"); 97 | [[ProfileManager sharedInstance] setOfflineFlow:FALSE]; 98 | 99 | // for offline flow, segue to attachment screen 100 | [self performSegueWithIdentifier:@"segue_docusign" sender:self]; 101 | }]; 102 | 103 | UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]; 104 | 105 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[NSString titleWithSDKVersion:YES] message:@"Would you like to proceed with the offline or online signing flow?" preferredStyle:UIAlertControllerStyleAlert]; 106 | 107 | [alertController addAction:selectOfflineAction]; 108 | [alertController addAction:selectOnlineAction]; 109 | [alertController addAction:cancelAction]; 110 | [self presentViewController:alertController animated:YES completion:nil]; 111 | } 112 | 113 | 114 | // dismiss the keyboard when user taps return 115 | - (BOOL) textFieldShouldReturn:(UITextField *)textField 116 | { 117 | [textField resignFirstResponder]; 118 | return TRUE; 119 | } 120 | 121 | 122 | // dismiss the keyboard when user taps outside 123 | - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 124 | { 125 | [[self view] endEditing:TRUE]; 126 | } 127 | 128 | 129 | - (void) styleUIElements 130 | { 131 | // add custom nav title 132 | UIView * navTitleView = [[[NSBundle mainBundle] loadNibNamed:@"CustomNavTitle" owner:self options:nil] lastObject]; 133 | self.navigationItem.titleView = navTitleView; 134 | 135 | // comments textview 136 | UIColor *borderColor = [UIColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:1.0]; 137 | self.tv_damageComments.layer.borderColor = borderColor.CGColor; 138 | self.tv_damageComments.layer.borderWidth = 1.0; 139 | self.tv_damageComments.layer.cornerRadius = 5.0; 140 | } 141 | 142 | 143 | @end 144 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/DocuSignViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DocuSignViewController.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface DocuSignViewController : UIViewController 11 | @end 12 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/DocuSignViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DocuSignViewController.m 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | 9 | #import "DocuSignViewController.h" 10 | 11 | #import "AppDelegate.h" 12 | #import 13 | #import "ProfileManager.h" 14 | #import "TemplatesManager.h" 15 | 16 | 17 | @interface DocuSignViewController () 18 | @end 19 | 20 | 21 | @implementation DocuSignViewController 22 | 23 | 24 | #pragma mark - UI Lifecycle Methods 25 | 26 | - (void)viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | [self styleUIElements]; 30 | 31 | // set sdk styling 32 | [DSMAppearance setNavigationBarTintColor:[ProfileManager getAppNavColor]]; 33 | [DSMAppearance setBarButtonItemsTintColor:[ProfileManager getAppBarItemsColor]]; 34 | 35 | ProfileManager * profileManager = [ProfileManager sharedInstance]; 36 | // retrieve the selected template id 37 | NSString * templateId = [profileManager getClientTemplateId]; 38 | 39 | // retrieve client data for insertion into template 40 | NSDictionary * tabData = [profileManager getTemplateTabDataForId:templateId]; 41 | NSArray * recipientData = [profileManager getTemplateRecipientDataForId:templateId]; 42 | 43 | // retrive customFields for insertion into template 44 | DSMCustomFields *customFields = [profileManager getCustomFieldsDataForTemplateId:templateId]; 45 | 46 | BOOL useOffline = [profileManager useOfflineFlow]; 47 | 48 | NSString * attachmentPath = [profileManager getAttachmentPath]; 49 | 50 | // display template via sdk 51 | [[TemplatesManager sharedInstance] displayTemplateForSignature:templateId forController:self withTabs:tabData withRecipients:recipientData withCustomFields:customFields useOfflineFlow:useOffline withAttachmentAtPath:attachmentPath withCompletion:^(UIViewController * controller, NSError *error) 52 | { 53 | NSLog(@"Done displaying template."); 54 | 55 | // return to claims screen 56 | [self.navigationController popToRootViewControllerAnimated:TRUE]; 57 | }]; 58 | } 59 | 60 | 61 | - (void) viewWillAppear:(BOOL)animated 62 | { 63 | // allow landscape orientation for sdk screens 64 | AppDelegate * appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; 65 | appDelegate.restrictRotation = NO; 66 | } 67 | 68 | 69 | - (void) styleUIElements 70 | { 71 | // add custom nav title 72 | UIView * navTitleView = [[[NSBundle mainBundle] loadNibNamed:@"CustomNavTitle" owner:self options:nil] lastObject]; 73 | self.navigationItem.titleView = navTitleView; 74 | } 75 | 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/DownloadsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DownloadsViewController.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "ContainerWithTableView.h" 10 | 11 | 12 | @interface DownloadsViewController : UITableViewController 13 | @end 14 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/LoginViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface LoginViewController : UIViewController 11 | @end 12 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/LoginViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.m 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import "LoginViewController.h" 9 | 10 | #import "AppDelegate.h" 11 | #import 12 | #import 13 | #import "ProfileManager.h" 14 | 15 | @interface LoginViewController () 16 | 17 | // ui elements 18 | @property (nonatomic, strong) IBOutlet UITextField * usernameInput; 19 | @property (nonatomic, strong) IBOutlet UITextField * passwordInput; 20 | 21 | @end 22 | 23 | 24 | @implementation LoginViewController 25 | 26 | 27 | #pragma mark - UI Lifecycle Methods 28 | 29 | - (void) viewDidLoad 30 | { 31 | [super viewDidLoad]; 32 | 33 | // pre-populate the user credentials fields with defaults (if provided) 34 | NSDictionary * defaultUserCredentials = [ProfileManager getDefaultUserCredentials]; 35 | self.usernameInput.text = defaultUserCredentials[@"defaultUsername"]; 36 | self.passwordInput.text = defaultUserCredentials[@"defaultPassword"]; 37 | 38 | self.passwordInput.delegate = self; 39 | } 40 | 41 | 42 | - (void) viewWillAppear:(BOOL)animated 43 | { 44 | // screen should only display portrait 45 | AppDelegate* appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate; 46 | appDelegate.restrictRotation = TRUE; 47 | } 48 | 49 | 50 | #pragma mark - IBAction Methods 51 | 52 | - (IBAction) loginButtonTapped:(UIButton *)sender 53 | { 54 | 55 | [ProgressHUD show:@"Authenticating..."]; 56 | 57 | NSString * email = self.usernameInput.text; 58 | NSString * password = self.passwordInput.text; 59 | 60 | // check username and password formats are valid 61 | if ([self isUsernameFormatValid:email] && [self isPasswordFormatValid:password]) { 62 | 63 | // log user into docusign api 64 | NSString * integratorKey = [ProfileManager getIntegratorKey]; 65 | NSString * hostApiUrl = [ProfileManager getHostApiUrl]; 66 | [DSMManager loginWithEmail:email password:password integratorKey:integratorKey host:[NSURL URLWithString:hostApiUrl] completion:^(DSMAccountInfo *accountInfo, NSError *error) { 67 | 68 | if (error != nil) { 69 | NSLog(@"An error occurred attempting to log into DocuSign: %@", error); 70 | [ProgressHUD dismiss]; 71 | 72 | // display alert to user 73 | UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Login Failed" 74 | message:error.localizedDescription 75 | preferredStyle:UIAlertControllerStyleAlert]; 76 | UIAlertAction *actionOk = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:nil]; 77 | [alertController addAction:actionOk]; 78 | [self presentViewController:alertController animated:TRUE completion:nil]; 79 | } 80 | else { 81 | NSLog(@"User Authenticated"); 82 | [ProgressHUD dismiss]; 83 | 84 | // proceed to app main nav 85 | [self performSegueWithIdentifier:@"segueMainNav" sender:self]; 86 | } 87 | }]; 88 | } 89 | } 90 | 91 | - (IBAction)passwordFieldPrimaryAction:(id)sender { 92 | [sender resignFirstResponder]; 93 | } 94 | 95 | - (BOOL)textFieldShouldReturn:(UITextField *)textField { 96 | [self.passwordInput resignFirstResponder]; 97 | return YES; 98 | } 99 | 100 | #pragma mark - Private Methods 101 | 102 | - (bool) isUsernameFormatValid:(NSString *)username 103 | { 104 | // check username is non-empty 105 | // TODO perform additional validation 106 | return (username.length > 0); 107 | } 108 | 109 | 110 | - (bool) isPasswordFormatValid:(NSString *)password 111 | { 112 | // check password is non-empty 113 | // TODO Perform additional validation 114 | return (password.length > 0); 115 | } 116 | 117 | 118 | @end 119 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/MainContainerViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainContainerViewController.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface MainContainerViewController : UIViewController 11 | @end 12 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/MainContainerViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainContainerViewController.m 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import "MainContainerViewController.h" 9 | 10 | #import "AppDelegate.h" 11 | #import 12 | #import "DownloadsViewController.h" 13 | 14 | 15 | @interface MainContainerViewController () 16 | 17 | #pragma mark - Properties 18 | 19 | // ui elements 20 | @property (weak, nonatomic) IBOutlet UIView * customNavTitle; 21 | @property (weak, nonatomic) IBOutlet UIView * claimsContainer; 22 | @property (weak, nonatomic) IBOutlet UIView * downloadsContainer; 23 | @property (weak, nonatomic) IBOutlet UIBarButtonItem * editBarButton; 24 | @property (weak, nonatomic) IBOutlet UISegmentedControl * segmentedControl; 25 | 26 | // reference to the embeded downloads view controller 27 | // used to reference ui objects inside container from outer nav bar 28 | @property (weak, nonatomic) DownloadsViewController * downloadsVC; 29 | 30 | @end 31 | 32 | 33 | @implementation MainContainerViewController 34 | 35 | 36 | #pragma mark - Private Variables 37 | 38 | // used to track if downloads table view is in edit mode 39 | bool editModeEnabled = FALSE; 40 | 41 | 42 | #pragma mark - UI Lifecycle Methods 43 | 44 | - (void) viewDidLoad 45 | { 46 | [super viewDidLoad]; 47 | [self styleUIElements]; 48 | 49 | // register for envelope signing completed event 50 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleEnvelopeSignedNotification:) 51 | name:DSMSigningCompletedNotification object:nil]; 52 | 53 | // hide edit button from nav bar 54 | self.editBarButton.enabled = FALSE; 55 | self.editBarButton.title = @""; 56 | } 57 | 58 | 59 | - (void) viewWillAppear:(BOOL)animated 60 | { 61 | // allow only portrait orientation 62 | AppDelegate * appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; 63 | appDelegate.restrictRotation = TRUE; 64 | } 65 | 66 | 67 | - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 68 | { 69 | NSString * segueName = segue.identifier; 70 | if ([segueName isEqualToString: @"downloads_embed"]) 71 | { 72 | // capture a reference to the downloads view controller 73 | self.downloadsVC = (DownloadsViewController *) [segue destinationViewController]; 74 | } 75 | } 76 | 77 | 78 | #pragma mark - IBAction Methods 79 | 80 | - (IBAction) segmentValueChanged:(id)sender 81 | { 82 | UISegmentedControl *segment = sender; 83 | 84 | switch(segment.selectedSegmentIndex) 85 | { 86 | case 0: 87 | // show claims screen 88 | self.editBarButton.enabled = FALSE; 89 | self.editBarButton.title = @""; 90 | self.claimsContainer.hidden = FALSE; 91 | break; 92 | case 1: 93 | // show downloads screen 94 | self.editBarButton.enabled = TRUE; 95 | self.editBarButton.title = @"Edit"; 96 | self.claimsContainer.hidden = TRUE; 97 | break; 98 | default: 99 | break; 100 | } 101 | } 102 | 103 | 104 | - (IBAction) editBarButtonTapped:(id)sender 105 | { 106 | if (editModeEnabled) 107 | { 108 | // end edit mode on tableview 109 | editModeEnabled = FALSE; 110 | self.editBarButton.title = @"Edit"; 111 | [self.downloadsVC endEditModeOnTableView]; 112 | } 113 | else 114 | { 115 | // enter edit mode on tableview 116 | editModeEnabled = TRUE; 117 | self.editBarButton.title = @"Cancel"; 118 | [self.downloadsVC startEditModeOnTableView]; 119 | } 120 | } 121 | 122 | 123 | #pragma mark - Event Handlers 124 | 125 | /** 126 | Handles notification when envelope is signed. 127 | @param notification The notification event object. 128 | */ 129 | - (void) handleEnvelopeSignedNotification:(NSNotification *)notification 130 | { 131 | //[[[DSMEnvelopesManager alloc] init] syncEnvelopes]; 132 | NSLog(@"handleEnvelopeSignedNotification received: Envelope was signed."); 133 | NSLog(@"Created a new envelope: %@",notification); 134 | } 135 | 136 | 137 | #pragma mark - Private Methods 138 | 139 | - (void) styleUIElements 140 | { 141 | // add custom nav title 142 | UIView * navTitleView = [[[NSBundle mainBundle] loadNibNamed:@"CustomNavTitle" owner:self options:nil] lastObject]; 143 | self.navigationItem.titleView = navTitleView; 144 | 145 | // set font for segmented control 146 | [self.segmentedControl setTitleTextAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"OpenSans-Regular" size:12.0]} forState:UIControlStateNormal]; 147 | } 148 | 149 | 150 | @end 151 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/PolicyViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // PolicyViewController.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface PolicyViewController : UIViewController 11 | @end 12 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/PolicyViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // PolicyViewController.m 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import "PolicyViewController.h" 9 | #import "ProfileManager.h" 10 | 11 | 12 | @interface PolicyViewController () 13 | 14 | // ui view and text fields 15 | @property (nonatomic, strong) IBOutlet UIView * vw_clientInfo; 16 | @property (nonatomic, strong) IBOutlet UIView * vw_clientAddress; 17 | @property (nonatomic, strong) IBOutlet UIView * vw_clientContact; 18 | 19 | @property (nonatomic, strong) IBOutlet UIBarButtonItem * barButtonNext; 20 | 21 | @property (nonatomic, strong) IBOutlet UITextField * tf_policyNum; 22 | @property (nonatomic, strong) IBOutlet UITextField * tf_firstName; 23 | @property (nonatomic, strong) IBOutlet UITextField * tf_lastName; 24 | @property (nonatomic, strong) IBOutlet UITextField * tf_address; 25 | @property (nonatomic, strong) IBOutlet UITextField * tf_city; 26 | @property (nonatomic, strong) IBOutlet UITextField * tf_state; 27 | @property (nonatomic, strong) IBOutlet UITextField * tf_country; 28 | @property (nonatomic, strong) IBOutlet UITextField * tf_zipCode; 29 | @property (nonatomic, strong) IBOutlet UITextField * tf_phone; 30 | @property (nonatomic, strong) IBOutlet UITextField * tf_email; 31 | @property (nonatomic, strong) IBOutlet UITextField * tf_driversLicense; 32 | @property (nonatomic, strong) IBOutlet UITextField * tf_licensePlate; 33 | 34 | @end 35 | 36 | 37 | @implementation PolicyViewController 38 | 39 | 40 | #pragma mark - UI Lifecycle Methods 41 | 42 | - (void) viewDidLoad 43 | { 44 | [super viewDidLoad]; 45 | [self styleUIElements]; 46 | } 47 | 48 | 49 | #pragma mark - IBAction Methods 50 | 51 | - (IBAction) searchButtonTapped:(id)sender 52 | { 53 | // unhide the client info 54 | self.vw_clientInfo.hidden = FALSE; 55 | self.vw_clientAddress.hidden = FALSE; 56 | self.vw_clientContact.hidden = FALSE; 57 | 58 | // load client data for the specified policy number 59 | [self loadClientInfo:self.tf_policyNum.text]; 60 | 61 | // enable next button 62 | self.barButtonNext.enabled = TRUE; 63 | } 64 | 65 | 66 | - (IBAction) nextButtonTapped:(id)sender 67 | { 68 | // save client info 69 | NSDictionary * clientInfoDict = [self createClientInfoDict]; 70 | [[ProfileManager sharedInstance] setClientInfo:clientInfoDict]; 71 | 72 | // segue to damage screen 73 | [self performSegueWithIdentifier:@"segue_policy_damage" sender:sender]; 74 | } 75 | 76 | 77 | #pragma mark - Private Methods 78 | 79 | - (void) loadClientInfo:(NSString *)policyNum 80 | { 81 | 82 | NSDictionary * clientInfo = [ProfileManager getFakeClientInfo]; 83 | 84 | // populate client info fields 85 | self.tf_firstName.text = clientInfo[@"firstName"]; 86 | self.tf_lastName.text = clientInfo[@"lastName"]; 87 | self.tf_address.text = clientInfo[@"address"]; 88 | self.tf_city.text = clientInfo[@"city"]; 89 | self.tf_state.text = clientInfo[@"state"]; 90 | self.tf_country.text = clientInfo[@"country"]; 91 | self.tf_zipCode.text = clientInfo[@"zipCode"]; 92 | self.tf_phone.text = clientInfo[@"phone"]; 93 | self.tf_email.text = clientInfo[@"email"]; 94 | self.tf_driversLicense.text = clientInfo[@"driversLicense"]; 95 | self.tf_licensePlate.text = clientInfo[@"licensePlate"]; 96 | 97 | } 98 | 99 | 100 | - (NSDictionary *) createClientInfoDict 101 | { 102 | NSDictionary * clientInfo = @{@"policyNum":self.tf_policyNum.text, 103 | @"firstName":self.tf_firstName.text, 104 | @"lastName":self.tf_lastName.text, 105 | @"address":self.tf_address.text, 106 | @"city":self.tf_city.text, 107 | @"state":self.tf_state.text, 108 | @"country":self.tf_country.text, 109 | @"zipCode":self.tf_zipCode.text, 110 | @"phone":self.tf_phone.text, 111 | @"email":self.tf_email.text, 112 | @"driversLicense":self.tf_driversLicense.text, 113 | @"licensePlate":self.tf_licensePlate.text 114 | }; 115 | return clientInfo; 116 | } 117 | 118 | 119 | // dismiss the keyboard when user taps return 120 | - (BOOL) textFieldShouldReturn:(UITextField *)textField 121 | { 122 | [textField resignFirstResponder]; 123 | return TRUE; 124 | } 125 | 126 | 127 | // dismiss the keyboard when user taps outside 128 | - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 129 | { 130 | [[self view] endEditing:TRUE]; 131 | } 132 | 133 | 134 | - (void) styleUIElements 135 | { 136 | // add custom nav title 137 | UIView * navTitleView = [[[NSBundle mainBundle] loadNibNamed:@"CustomNavTitle" owner:self options:nil] lastObject]; 138 | self.navigationItem.titleView = navTitleView; 139 | } 140 | 141 | 142 | @end 143 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Controllers/TemplatesViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TemplatesViewController.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface TemplatesViewController : UITableViewController 11 | @end 12 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Images/beach.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Images/beach.jpg -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Allura 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSCameraUsageDescription 26 | $(PRODUCT_NAME) camera use 27 | NSContactsUsageDescription 28 | $(PRODUCT_NAME) contact use 29 | NSLocationWhenInUseUsageDescription 30 | $(PRODUCT_NAME) location use 31 | UIAppFonts 32 | 33 | OpenSans-Bold.ttf 34 | OpenSans-BoldItalic.ttf 35 | OpenSans-ExtraBold.ttf 36 | OpenSans-ExtraBoldItalic.ttf 37 | OpenSans-Italic.ttf 38 | OpenSans-Light.ttf 39 | OpenSans-LightItalic.ttf 40 | OpenSans-Regular.ttf 41 | OpenSans-SemiBold.ttf 42 | OpenSans-SemiBoldItalic.ttf 43 | 44 | UILaunchStoryboardName 45 | LaunchScreen 46 | UIMainStoryboardFile 47 | Main 48 | UIRequiredDeviceCapabilities 49 | 50 | armv7 51 | 52 | UISupportedInterfaceOrientations 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationLandscapeLeft 56 | UIInterfaceOrientationLandscapeRight 57 | 58 | UIUserInterfaceStyle 59 | Light 60 | 61 | 62 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Managers/EnvelopesManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // EnvelopeManager.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | @interface EnvelopesManager : NSObject 12 | 13 | // get singleton instance of manager 14 | + (id) sharedInstance; 15 | 16 | // get list of cached envelope defitions 17 | - (NSArray *) getCachedEnvelopesList; 18 | 19 | // get list of cached envelope ids 20 | - (NSArray *) getCachedEnvelopeIds; 21 | 22 | // sync cached envelopes 23 | - (void) syncCachedEnvelopes; 24 | 25 | // remove cached envelope by id 26 | - (void) removeCachedEnvelopeById:(NSString *)envelopeId; 27 | 28 | // present compose envelope view controller 29 | - (void) presentComposeEnvelopeViewControllerWithPresentingController:(UIViewController *)controller signingMode:(DSMSigningMode)signingMode; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Managers/EnvelopesManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // EnvelopeManager.m 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import "EnvelopesManager.h" 9 | 10 | @interface EnvelopesManager () 11 | 12 | // properties 13 | @property (nonatomic, retain) DSMEnvelopesManager *mDSMEnvelopesManager; 14 | @property (nonatomic, retain) NSArray *mEnvelopeDefinitions; 15 | 16 | @end 17 | 18 | 19 | @implementation EnvelopesManager 20 | 21 | + (id) sharedInstance 22 | { 23 | static EnvelopesManager * sharedManager = nil; 24 | 25 | static dispatch_once_t onceToken; 26 | dispatch_once(&onceToken, ^{ 27 | sharedManager = [[self alloc] init]; 28 | 29 | if (sharedManager.mDSMEnvelopesManager == nil) 30 | { 31 | sharedManager.mDSMEnvelopesManager = [[DSMEnvelopesManager alloc] init]; 32 | } 33 | 34 | }); 35 | return sharedManager; 36 | } 37 | 38 | 39 | #pragma mark - Public Methods 40 | 41 | // get list of cached envelope defitions 42 | - (NSArray *) getCachedEnvelopesList 43 | { 44 | return [self.mDSMEnvelopesManager cachedEnvelopes]; 45 | } 46 | 47 | 48 | // get list of cached envelope ids 49 | - (NSArray *) getCachedEnvelopeIds 50 | { 51 | return [self.mDSMEnvelopesManager cachedEnvelopeIds]; 52 | } 53 | 54 | 55 | // sync cached envelopes 56 | - (void) syncCachedEnvelopes 57 | { 58 | [self.mDSMEnvelopesManager syncEnvelopes]; 59 | } 60 | 61 | 62 | // remove cached envelope by id 63 | - (void) removeCachedEnvelopeById:(NSString *)envelopeId 64 | { 65 | [self.mDSMEnvelopesManager removeCachedEnvelopeWithId:envelopeId]; 66 | } 67 | 68 | // present compose envelope view controller 69 | - (void) presentComposeEnvelopeViewControllerWithPresentingController:(UIViewController *)controller signingMode:(DSMSigningMode)signingMode { 70 | // you can use method hasCachedDraftEnvelope to determine whether you'd like to resume a draft or not 71 | [self.mDSMEnvelopesManager presentComposeEnvelopeControllerWithPresentingController:controller signingMode:signingMode resumeWithDraft:YES animated:YES completion:nil]; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Managers/ProfileManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProfileManager.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "DocuSignSDK/DocuSignSDK.h" 10 | 11 | @interface ProfileManager : NSObject 12 | 13 | // get singleton instance of manager 14 | + (id) sharedInstance; 15 | + (BOOL)autoDownloadTemplates; 16 | + (BOOL)displayDeveloperNotes; 17 | 18 | // static methods 19 | + (UIColor *) getAppNavColor; 20 | + (UIColor *) getAppBarItemsColor; 21 | + (NSString *) getIntegratorKey; 22 | + (NSString *) getHostApiUrl; 23 | + (NSDictionary *) getDefaultUserCredentials; 24 | + (NSArray *) templateIdsDemo; 25 | + (NSDictionary *) getFakeClientInfo; 26 | + (NSDictionary *) getFakeDamageInfo; 27 | 28 | // manage client policy number 29 | - (void) setClientPolicyNum:(NSString *)policyNum; 30 | - (NSString *) getClientPolicyNum; 31 | 32 | // manage client and claim info 33 | - (void) setClientInfo:(NSDictionary *)clientInfo; 34 | - (NSDictionary *) getClientInfo; 35 | - (void) setDamageInfo:(NSDictionary *)damageInfo; 36 | - (NSDictionary *) getDamageInfo; 37 | 38 | // manage the current template id 39 | - (void) setClientTemplateId:(NSString *)templateId; 40 | - (NSString *) getClientTemplateId; 41 | 42 | // manage user choice to run offline or online flow 43 | - (void) setOfflineFlow:(BOOL)offineFlowSelected; 44 | - (BOOL) useOfflineFlow; 45 | 46 | // manage pdf attachment 47 | - (void) setAttachmentPath:(NSString *)attachmentPath; 48 | - (NSString *) getAttachmentPath; 49 | 50 | // manage data for the template 51 | - (NSDictionary *) getTemplateTabDataForId:(NSString *)templateId; 52 | - (NSArray *)getTemplateRecipientDataForId:(NSString *)templateId; 53 | - (DSMCustomFields *)getCustomFieldsDataForTemplateId:(NSString *)templateId; 54 | @end 55 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Managers/TemplatesManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // TemplateManager.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | 11 | 12 | @interface TemplatesManager : NSObject 13 | 14 | // get singleton instance of manager 15 | + (id) sharedInstance; 16 | 17 | // get list of template defitions 18 | - (void) getTemplateListWithCompletion:(void(^)(NSArray *))completionHandler; 19 | 20 | // check if the template with id is cached 21 | - (BOOL) templateIsCachedWithId:(NSString *)templateId; 22 | 23 | // download & cache the template with id 24 | - (void) cacheTemplateWithId:(NSString *)templateId withCompletion:(void(^)(NSString *))completionHandler; 25 | 26 | // remove the cached template with id 27 | - (void) removeTemplateWithId:(NSString *)templateId; 28 | 29 | - (void) displayTemplateForSignature:(NSString *)templateId forController:(UIViewController *)controller withTabs:(id)tabs withRecipients:(id)recipients withCustomFields:(DSMCustomFields *)customFields useOfflineFlow:(BOOL)useOffline withAttachmentAtPath:(NSString *)attachmentPath withCompletion:(void(^)(UIViewController *viewController, NSError *error))completionHandler; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Managers/TemplatesManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // TemplateManager.m 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "TemplatesManager.h" 10 | 11 | 12 | @interface TemplatesManager () 13 | 14 | @property (nonatomic, retain) DSMTemplatesManager *mDSMTemplatesManager; 15 | @property (nonatomic, retain) NSArray *mTemplateDefinitions; 16 | 17 | @end 18 | 19 | 20 | @implementation TemplatesManager 21 | 22 | 23 | #pragma mark - Static Methods 24 | 25 | +(id)sharedInstance 26 | { 27 | static TemplatesManager * sharedManager = nil; 28 | 29 | static dispatch_once_t onceToken; 30 | dispatch_once(&onceToken, ^{ 31 | sharedManager = [[self alloc] init]; 32 | 33 | if (sharedManager.mDSMTemplatesManager == nil) 34 | { 35 | sharedManager.mDSMTemplatesManager = [[DSMTemplatesManager alloc] init]; 36 | } 37 | }); 38 | return sharedManager; 39 | } 40 | 41 | 42 | #pragma mark - Public Methods 43 | 44 | - (void) getTemplateListWithCompletion:(void(^)(NSArray *))completionHandler 45 | { 46 | // retrieve list of template definitions 47 | [self.mDSMTemplatesManager listTemplatesWithCompletion:^(NSArray *templateDefinitions, NSError *error) 48 | { 49 | if (error) 50 | { 51 | NSLog(@"An error occurred while fetching template definitions list: %@", error); 52 | } 53 | else 54 | { 55 | // store list of template definitions 56 | self.mTemplateDefinitions = templateDefinitions; 57 | completionHandler(templateDefinitions); 58 | } 59 | }]; 60 | } 61 | 62 | 63 | - (BOOL) templateIsCachedWithId:(NSString *)templateId 64 | { 65 | return [self.mDSMTemplatesManager cacheStateOfTemplateWithId:templateId] == DSMTemplateCacheStateCached; 66 | } 67 | 68 | 69 | - (void) cacheTemplateWithId:(NSString *)templateId withCompletion:(void(^)(NSString *))completionHandler 70 | { 71 | // download template 72 | [self.mDSMTemplatesManager cacheTemplateWithId:templateId completion:^(NSError *error) { 73 | if (error) 74 | { 75 | NSLog(@"An error occurred downloading template: %@", error); 76 | completionHandler(error.localizedDescription); 77 | } 78 | else 79 | { 80 | completionHandler(nil); 81 | } 82 | }]; 83 | } 84 | 85 | 86 | - (void) removeTemplateWithId:(NSString *)templateId 87 | { 88 | // remove the specified template 89 | [self.mDSMTemplatesManager removeCachedTemplateWithId:templateId]; 90 | } 91 | 92 | 93 | - (void) displayTemplateForSignature:(NSString *)templateId forController:(UIViewController *)controller 94 | withTabs:(id)tabs withRecipients:(id)recipients withCustomFields:(DSMCustomFields *)customFields useOfflineFlow:(BOOL)useOffline withAttachmentAtPath:(NSString *)attachmentPath withCompletion:(void(^)(UIViewController *viewController, NSError *error))completionHandler 95 | { 96 | // if an attachment was included, load PDF as NSData 97 | NSData * attachmentData = nil; 98 | if (attachmentPath != nil) 99 | { 100 | attachmentData = [[NSFileManager defaultManager] contentsAtPath:attachmentPath]; 101 | } 102 | 103 | DSMEnvelopeDefaults *envelopeDefauts = [[DSMEnvelopeDefaults alloc] init]; 104 | envelopeDefauts.recipientDefaults = recipients; 105 | envelopeDefauts.tabValueDefaults = tabs; 106 | envelopeDefauts.customFields = customFields; 107 | 108 | [self.mDSMTemplatesManager 109 | presentSendTemplateControllerWithTemplateWithId:templateId 110 | envelopeDefaults:envelopeDefauts 111 | pdfToInsert:attachmentData 112 | insertAtPosition:DSMDocumentInsertAtPositionEnd 113 | signingMode:(!useOffline) ? DSMSigningModeOnline :DSMSigningModeOffline 114 | presentingController:controller 115 | animated:YES 116 | completion:completionHandler]; 117 | } 118 | 119 | @end 120 | 121 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Protocols/ContainerWithTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ContainerWithTableView.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | @protocol ContainerWithTableView 9 | 10 | - (void) startEditModeOnTableView; 11 | - (void) endEditModeOnTableView; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Resources/AccidentChecklist.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-objc/docusign-sdk-sample-objc/Resources/AccidentChecklist.pdf -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Views/CustomNavTitle.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | OpenSans-BoldItalic 13 | 14 | 15 | OpenSans-LightItalic 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Views/DownloadTemplateCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DownloadsTableViewCell.h 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | @interface DownloadTemplateCell : UITableViewCell 11 | 12 | @property (weak, nonatomic) IBOutlet UILabel * nameLabel; 13 | @property (weak, nonatomic) IBOutlet UIButton * downloadButton; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Views/DownloadTemplateCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // DownloadsTableViewCell.m 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import "DownloadTemplateCell.h" 9 | 10 | 11 | @implementation DownloadTemplateCell 12 | 13 | - (void) awakeFromNib 14 | { 15 | [super awakeFromNib]; 16 | } 17 | 18 | - (void) setSelected:(BOOL)selected animated:(BOOL)animated 19 | { 20 | [super setSelected:selected animated:animated]; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/Views/DownloadTemplateCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | OpenSans-Regular 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 35 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/docusign_sdk_sample_objc.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | docusign_sdk_sample_objc.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/docusign_sdk_sample_objc.xcdatamodeld/docusign_sdk_sample_objc.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docusign-sdk-sample-objc/docusign-sdk-sample-objc/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // docusign-sdk-sample-objc 4 | // 5 | // Copyright © 2017 DocuSign. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "AppDelegate.h" 10 | 11 | int main(int argc, char * argv[]) { 12 | @autoreleasepool { 13 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | source 'https://github.com/CocoaPods/Specs.git' 3 | 4 | platform :ios, '10.0' 5 | 6 | target 'docusign-sdk-sample-swift' do 7 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 8 | use_frameworks! 9 | 10 | # Pods for docusign-sdk-sample-swift 11 | pod 'SVProgressHUD' 12 | pod 'DocuSign' 13 | 14 | end 15 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/README.md: -------------------------------------------------------------------------------- 1 | # docusign-sdk-sample-swift 2 | DocuSign Native iOS SDK - Sample App in Swift 3 | 4 | Install 5 | ============= 6 | * Launch Terminal and change directory to `docusign-sdk-sample-swift` 7 | * Perform `pod install` to fetch latest `DocuSign` pod. 8 | * Or run `pod update 'DocuSign'` command on terminal to update 'DocuSign' pod to the latest version from a previous version. 9 | * Launch `docusign-sdk-sample-swift.xcworkspace` with XCode 10 | * Please see the [Getting Started](https://developers.docusign.com/ios_sdk/developer.html) and [Integration](https://developers.docusign.com/ios_sdk/developer.html) section on the **Developer's Site** for more details. 11 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/TGK-Capital-Template.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/TGK-Capital-Template.pdf -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AddAttachment.imageset/AddAttachment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AddAttachment.imageset/AddAttachment.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AddAttachment.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "AddAttachment.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-40x40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-60x60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "20x20", 53 | "idiom" : "ipad", 54 | "filename" : "Icon-App-20x20@1x.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@2x-1.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-29x29@1x.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@2x-1.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-40x40@1x.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@2x-1.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "76x76", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-76x76@1x.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@2x.png", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "size" : "83.5x83.5", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-83.5x83.5@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "idiom" : "ios-marketing", 107 | "size" : "1024x1024", 108 | "scale" : "1x" 109 | } 110 | ], 111 | "info" : { 112 | "version" : 1, 113 | "author" : "xcode" 114 | } 115 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024-1.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/ClientGraph.imageset/ClientGraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/ClientGraph.imageset/ClientGraph.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/ClientGraph.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ClientGraph.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/download.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "download.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/download.imageset/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/download.imageset/download.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/download_done.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "download_done.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/download_done.imageset/download_done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/download_done.imageset/download_done.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/graphs.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "graphs.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/graphs.imageset/graphs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Assets.xcassets/graphs.imageset/graphs.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Controllers/AttachmentViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AttachmentViewController.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | class AttachmentViewController: UIViewController 13 | { 14 | // MARK: UI Elements 15 | 16 | @IBOutlet weak var btn_barSkip: UIBarButtonItem! 17 | @IBOutlet weak var btn_attach: UIButton! 18 | @IBOutlet weak var lbl_attach: UILabel! 19 | @IBOutlet weak var vw_document: UIWebView! 20 | 21 | 22 | // MARK: UI Lifecycle Methods 23 | 24 | override func viewDidLoad() 25 | { 26 | super.viewDidLoad() 27 | self.styleUIElements() 28 | } 29 | 30 | // MARK: IBAction Methods 31 | 32 | @IBAction func skipButtonTapped(_ sender: Any) 33 | { 34 | // segue to docusign screen 35 | self.performSegue(withIdentifier: "segueAttachmentDocusign", sender: self) 36 | } 37 | 38 | @IBAction func attachButtonTapped(_ sender: Any) 39 | { 40 | // load PDF included in bundle 41 | //var pdfFileName = "Portfolio" 42 | var pdfFileName = "UtilityBill" 43 | if let documentURL = Bundle.main.url(forResource: pdfFileName, withExtension: "pdf", subdirectory: nil, localization: nil) 44 | { 45 | do { 46 | let data = try Data(contentsOf: documentURL) 47 | self.vw_document.load(data, mimeType: "application/pdf", textEncodingName: "", baseURL: documentURL.deletingLastPathComponent()) 48 | self.vw_document.isHidden = false 49 | 50 | // hide attach button 51 | self.btn_attach.isHidden = true 52 | self.lbl_attach.isHidden = true 53 | 54 | // update navigation button 55 | self.btn_barSkip.title = "Next" 56 | 57 | // capture url for attachment 58 | ProfileManager.sharedInstance.setAttachmentPath(attachmentUrl: documentURL) 59 | 60 | // display developer's notes 61 | if ProfileManager.Static.displayDeveloperNotes { 62 | self.promptDevAttachment() 63 | } 64 | } 65 | catch { 66 | NSLog("Error loading PDF file as attachment.") 67 | } 68 | } 69 | } 70 | 71 | 72 | // MARK: Private Methods 73 | 74 | private func promptDevAttachment() 75 | { 76 | let title = String.developerNotesTitle(with: true) 77 | let message = "For sample purposes, we have included a PDF document that has been attached. Ordinarily, you would guide the user through selecting an external PDF document to attach to the envelope." 78 | let attachmentAlert = UIAlertController(title: title, message: message, preferredStyle: .alert) 79 | 80 | // add Ok action 81 | attachmentAlert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil)) 82 | 83 | self.present(attachmentAlert, animated: true, completion: nil) 84 | } 85 | 86 | private func styleUIElements() 87 | { 88 | // set custom nav title 89 | self.navigationItem.titleView = Bundle.main.loadNibNamed("CustomNavTitle", owner: nil, options: nil)?.first as! UIView? 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Controllers/ClientViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ClientViewController.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | class ClientViewController: UIViewController 13 | { 14 | // ui elements 15 | @IBOutlet weak var segmentedControl: UISegmentedControl! 16 | @IBOutlet weak var vw_portfolioContainer: UIView! 17 | @IBOutlet weak var vw_contactContainer: UIView! 18 | 19 | 20 | // MARK: UI Lifecycle Methods 21 | 22 | override func viewDidLoad() 23 | { 24 | super.viewDidLoad() 25 | self.styleUIElements() 26 | } 27 | 28 | override func viewWillAppear(_ animated: Bool) { 29 | // check for envelopes waiting to sync 30 | let envelopeIdsToSync = EnvelopesManager.sharedInstance.getCachedEnvelopeIds() 31 | if (envelopeIdsToSync != nil && (envelopeIdsToSync?.count)! > 0) 32 | { 33 | // sync envelopes 34 | EnvelopesManager.sharedInstance.syncEnvelopes() 35 | 36 | // prompt with developer notes 37 | if ProfileManager.Static.displayDeveloperNotes { 38 | self.promptSyncEnvelopes() 39 | } 40 | } 41 | } 42 | 43 | 44 | // MARK: IBAction Methods 45 | 46 | @IBAction func indexChanged(_ sender: UISegmentedControl) 47 | { 48 | switch segmentedControl.selectedSegmentIndex 49 | { 50 | case 0: 51 | // show portfolio screen 52 | vw_portfolioContainer.isHidden = false 53 | vw_contactContainer.isHidden = true 54 | break 55 | 56 | case 1: 57 | // show contact screen 58 | vw_portfolioContainer.isHidden = true 59 | vw_contactContainer.isHidden = false 60 | break 61 | 62 | default: 63 | break 64 | } 65 | } 66 | 67 | 68 | // MARK: Private Methods 69 | 70 | private func promptSyncEnvelopes() 71 | { 72 | let title = String.developerNotesTitle(with: true) 73 | let message = "For sample purposes, we've drawn attention to the fact that completed envelopes are now syncing with the server. However, you will likely perform this task automatically in the background, once a network connection is available." 74 | let syncAlert = UIAlertController(title: title, message: message, preferredStyle: .alert) 75 | 76 | // add Ok action 77 | syncAlert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil)) 78 | 79 | self.present(syncAlert, animated: true, completion: nil) 80 | } 81 | 82 | 83 | private func styleUIElements() 84 | { 85 | // set custom nav title 86 | self.navigationItem.titleView = Bundle.main.loadNibNamed("CustomNavTitle", owner: nil, options: nil)?.first as! UIView? 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Controllers/ContactViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContactViewController.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | class ContactViewController: UIViewController,UITextFieldDelegate 13 | { 14 | // MARK: UI Elements 15 | 16 | @IBOutlet weak var tf_firstName: UITextField! 17 | @IBOutlet weak var tf_lastName: UITextField! 18 | @IBOutlet weak var tf_phone: UITextField! 19 | @IBOutlet weak var tf_email: UITextField! 20 | @IBOutlet weak var tf_address: UITextField! 21 | @IBOutlet weak var tf_city: UITextField! 22 | @IBOutlet weak var tf_state: UITextField! 23 | @IBOutlet weak var tf_country: UITextField! 24 | @IBOutlet weak var tf_zipCode: UITextField! 25 | 26 | 27 | // UI Lifecycle Methods 28 | 29 | override func viewDidLoad() 30 | { 31 | super.viewDidLoad() 32 | self.styleUIElements() 33 | 34 | // for demo purposes, pre-populate with fake data 35 | self.loadContactData() 36 | } 37 | 38 | 39 | override func viewWillDisappear(_ animated: Bool) { 40 | // save any changes to the personal info 41 | ProfileManager.sharedInstance.setClientPersonalInfo( 42 | firstName: self.tf_firstName.text, 43 | lastName: self.tf_lastName.text, 44 | address: self.tf_address.text, 45 | city: self.tf_city.text, 46 | state: self.tf_state.text, 47 | country: self.tf_country.text, 48 | zipCode: self.tf_zipCode.text, 49 | email: self.tf_email.text, 50 | phone: self.tf_phone.text) 51 | } 52 | 53 | 54 | // MARK: Private Methods 55 | 56 | private func loadContactData() 57 | { 58 | let clientData = ProfileManager.sharedInstance.getClientData() 59 | 60 | self.tf_firstName.text = clientData["firstName"] 61 | self.tf_firstName.delegate = self 62 | 63 | self.tf_lastName.text = clientData["lastName"] 64 | self.tf_lastName.delegate = self 65 | 66 | self.tf_phone.text = clientData["phone"] 67 | self.tf_phone.delegate = self 68 | 69 | self.tf_email.text = clientData["email"] 70 | self.tf_email.delegate = self 71 | 72 | self.tf_address.text = clientData["address"] 73 | self.tf_address.delegate = self 74 | 75 | self.tf_city.text = clientData["city"] 76 | self.tf_city.delegate = self 77 | 78 | self.tf_state.text = clientData["state"] 79 | self.tf_state.delegate = self 80 | 81 | self.tf_country.text = clientData["country"] 82 | self.tf_country.delegate = self 83 | 84 | self.tf_zipCode.text = clientData["zipCode"] 85 | self.tf_zipCode.delegate = self 86 | } 87 | 88 | 89 | private func styleUIElements() 90 | { 91 | // set custom nav title 92 | self.navigationItem.titleView = Bundle.main.loadNibNamed("CustomNavTitle", owner: nil, options: nil)?.first as! UIView? 93 | } 94 | 95 | func textFieldShouldReturn(_ textField: UITextField) -> Bool { 96 | self.view.endEditing(true) 97 | return true 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Controllers/DocuSignViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DocuSignViewController.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | 10 | import DocuSignSDK 11 | import UIKit 12 | 13 | 14 | class DocuSignViewController: UIViewController 15 | { 16 | 17 | // MARK: UI Lifecycle Methods 18 | 19 | override func viewDidLoad() 20 | { 21 | super.viewDidLoad() 22 | self.styleUIElements() 23 | 24 | // set sdk styling 25 | DSMAppearance.setNavigationBarTintColor(UIColor(red: 46.0/255, green: 109.0/255, blue: 164.0/255, alpha: 1.0)) 26 | DSMAppearance.setBarButtonItemsTintColor(UIColor.white) 27 | 28 | let templateId: String = ProfileManager.sharedInstance.getCurrentTemplateId() 29 | let tabData: Dictionary = ProfileManager.sharedInstance.getTemplateTabData(templateId:templateId) 30 | let recipientData: Array = ProfileManager.sharedInstance.getTemplateRecipientData(templateId:templateId) 31 | let onlineSign: Bool = !ProfileManager.sharedInstance.getUseOfflineFlow() 32 | let attachmentUrl: URL? = ProfileManager.sharedInstance.getAttachmentUrl() 33 | let customFields = ProfileManager.sharedInstance.getCustomFieldsData(templateId:templateId) 34 | 35 | // display template via sdk 36 | TemplatesManager.sharedInstance.displayTemplateForSignature(templateId: templateId, controller: self, tabData: tabData, recipientData: recipientData, customFields:customFields, onlineSign: onlineSign, attachmentUrl: attachmentUrl) { (controller, errMsg) in 37 | 38 | // return to client screen 39 | let vcIndex = self.navigationController?.viewControllers.index(where: { (viewController) -> Bool in 40 | if let _ = viewController as? ClientViewController { 41 | return true 42 | } 43 | return false 44 | }) 45 | 46 | let clientVC = self.navigationController?.viewControllers[vcIndex!] as! ClientViewController 47 | self.navigationController?.popToViewController(clientVC, animated: true) 48 | } 49 | } 50 | 51 | // MARK: Private Methods 52 | 53 | private func styleUIElements() 54 | { 55 | // set custom nav title 56 | self.navigationItem.titleView = Bundle.main.loadNibNamed("CustomNavTitle", owner: nil, options: nil)?.first as! UIView? 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Controllers/InvestmentViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InvestmentViewController.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | class InvestmentViewController: UIViewController,UITextFieldDelegate 13 | { 14 | @IBOutlet weak var tf_clientNumber: UITextField! 15 | @IBOutlet weak var tf_investmentAmount: UITextField! 16 | 17 | 18 | // MARK: UI Lifecycle Methods 19 | 20 | override func viewDidLoad() 21 | { 22 | super.viewDidLoad() 23 | self.styleUIElements() 24 | 25 | self.loadInvestmentData() 26 | } 27 | 28 | 29 | // MARK: IBAction Methods 30 | 31 | @IBAction func nextButtonTapped(_ sender: Any) 32 | { 33 | // Store investment details 34 | ProfileManager.sharedInstance.setClientInvestmentInfo(clientNumber: self.tf_clientNumber.text!, 35 | investmentAmount: self.tf_investmentAmount.text!) 36 | 37 | // segue to agreement screen 38 | self.performSegue(withIdentifier: "segueInvestmentAgreements", sender: self) 39 | } 40 | 41 | 42 | // MARK: Private Methods 43 | 44 | private func loadInvestmentData() 45 | { 46 | let clientData = ProfileManager.sharedInstance.getClientData() 47 | 48 | self.tf_clientNumber.text = clientData["clientNumber"] 49 | self.tf_clientNumber.delegate = self 50 | 51 | self.tf_investmentAmount.text = clientData["investmentAmount"] 52 | self.tf_investmentAmount.delegate = self 53 | } 54 | 55 | 56 | private func styleUIElements() 57 | { 58 | // set custom nav title 59 | self.navigationItem.titleView = Bundle.main.loadNibNamed("CustomNavTitle", owner: nil, options: nil)?.first as! UIView? 60 | } 61 | 62 | func textFieldShouldReturn(_ textField: UITextField) -> Bool { 63 | self.view.endEditing(true) 64 | return true 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Controllers/LoginViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | 10 | import DocuSignSDK 11 | import SVProgressHUD 12 | import UIKit 13 | 14 | 15 | class LoginViewController: UIViewController, UITextFieldDelegate 16 | { 17 | @IBOutlet weak var tf_username: UITextField! 18 | @IBOutlet weak var tf_password: UITextField! 19 | 20 | 21 | // MARK: UI Lifecycle Methods 22 | 23 | override func viewDidLoad() 24 | { 25 | super.viewDidLoad() 26 | 27 | // pre-populate the user credentials fields with defaults (if provided) 28 | tf_username.text = ProfileManager.Static.defaultUsername 29 | tf_password.text = ProfileManager.Static.defaultPassword 30 | tf_password.delegate = self 31 | } 32 | 33 | // MARK: IBAction Methods 34 | 35 | @IBAction func signInButtonTapped(_ sender: Any) 36 | { 37 | SVProgressHUD.show(withStatus: "Authenticating...") 38 | 39 | guard let email = tf_username.text else { 40 | return 41 | } 42 | 43 | guard let password = tf_password.text else { 44 | return 45 | } 46 | let integratorKey = ProfileManager.Static.integratorKey 47 | let hostUrl: URL! = ProfileManager.Static.demoHostApi 48 | 49 | if (isUsernameFormatValid(username: email) && isPasswordFormatValid(password: password)) 50 | { 51 | DSMManager.login(withEmail: email, 52 | password: password, 53 | integratorKey: integratorKey, 54 | host: hostUrl) { (accountInfo, error) in 55 | SVProgressHUD.dismiss() 56 | 57 | if (error != nil) 58 | { 59 | NSLog("Error logging in") 60 | // display error prompt 61 | self.promptError(err: error) 62 | } 63 | else 64 | { 65 | NSLog("User authenticated") 66 | // segue to main navigation controller 67 | self.performSegue(withIdentifier: "segueMainNav", sender: nil) 68 | } 69 | } 70 | } 71 | } 72 | 73 | func textFieldShouldReturn(_ textField: UITextField) -> Bool { 74 | self.tf_password.resignFirstResponder() 75 | return true 76 | } 77 | 78 | // MARK: Private Methods 79 | 80 | func isUsernameFormatValid(username: String?) -> Bool 81 | { 82 | // check username is non-empty 83 | // TODO perform additional validation 84 | return ((username?.count)! > 0) 85 | } 86 | 87 | 88 | func isPasswordFormatValid(password: String?) -> Bool 89 | { 90 | // check password is non-empty 91 | // TODO Perform additional validation 92 | return ((password?.count)! > 0) 93 | } 94 | 95 | 96 | func promptError(err: Error?) 97 | { 98 | let title = "Error" 99 | let message = err?.localizedDescription 100 | 101 | let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) 102 | alert.addAction(UIAlertAction(title: "OK", style: .default) { action in }) 103 | 104 | self.present(alert, animated: true) 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Controllers/MainContainerViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainContainerViewController.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class MainContainerViewController: UIViewController { 12 | 13 | // ui elements 14 | @IBOutlet weak var segmentedControl: UISegmentedControl! 15 | @IBOutlet weak var vw_overviewContainer: UIView! 16 | @IBOutlet weak var vw_clientContainer: UIView! 17 | @IBOutlet weak var vw_templatesContainer: UIView! 18 | @IBOutlet weak var bt_navEdit: UIBarButtonItem! 19 | 20 | // reference to the embeded templates view controller 21 | // used to reference ui objects inside container from outer nav bar 22 | private var templatesVC: TemplatesViewController? 23 | 24 | 25 | // used to track if downloads table view is in edit mode 26 | private var editModeEnabled: Bool = false 27 | 28 | 29 | // MARK: UI Lifecycle Methods 30 | 31 | override func viewDidLoad() { 32 | super.viewDidLoad() 33 | self.styleUIElements() 34 | 35 | // hide edit button from nav bar 36 | self.bt_navEdit.isEnabled = false 37 | self.bt_navEdit.title = "" 38 | } 39 | 40 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) 41 | { 42 | if (segue.identifier == "segueMainNavTemplates") 43 | { 44 | templatesVC = segue.destination as? TemplatesViewController 45 | } 46 | } 47 | 48 | 49 | // MARK: IBAction Methods 50 | 51 | @IBAction func indexChanged(_ sender: UISegmentedControl) 52 | { 53 | switch segmentedControl.selectedSegmentIndex 54 | { 55 | case 0: 56 | // show overview screen 57 | vw_overviewContainer.isHidden = false 58 | vw_clientContainer.isHidden = true 59 | vw_templatesContainer.isHidden = true 60 | bt_navEdit.isEnabled = false 61 | bt_navEdit.title = "" 62 | break 63 | 64 | case 1: 65 | // show clients screen 66 | vw_overviewContainer.isHidden = true 67 | vw_clientContainer.isHidden = false 68 | vw_templatesContainer.isHidden = true 69 | bt_navEdit.isEnabled = false 70 | bt_navEdit.title = "" 71 | break 72 | 73 | case 2: 74 | // show templates screen 75 | vw_overviewContainer.isHidden = true 76 | vw_clientContainer.isHidden = true 77 | vw_templatesContainer.isHidden = false 78 | bt_navEdit.isEnabled = true 79 | bt_navEdit.title = "Edit" 80 | break 81 | 82 | default: 83 | break 84 | } 85 | } 86 | 87 | 88 | @IBAction func editButtonTapped(_ sender: Any) 89 | { 90 | NSLog("Edit button tapped") 91 | 92 | if (editModeEnabled) 93 | { 94 | // end edit mode on tableview 95 | editModeEnabled = false 96 | bt_navEdit.title = "Edit" 97 | templatesVC?.endEditModeOnTableView() 98 | } 99 | else 100 | { 101 | // enter edit mode on tableview 102 | editModeEnabled = true 103 | bt_navEdit.title = "Cancel" 104 | templatesVC?.startEditModeOnTableView() 105 | } 106 | } 107 | 108 | 109 | // MARK: Private Methods 110 | 111 | private func styleUIElements() 112 | { 113 | // set custom nav title 114 | self.navigationItem.titleView = Bundle.main.loadNibNamed("CustomNavTitle", owner: nil, options: nil)?.first as! UIView? 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Controllers/OverviewViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OverviewViewController.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import DocuSignSDK 11 | 12 | class OverviewViewController: UIViewController, UITableViewDelegate, UITableViewDataSource 13 | { 14 | // ui elements 15 | @IBOutlet var tableView: UITableView! 16 | 17 | 18 | // private variables 19 | private let cellReuseIdentifier = "cell_appointment" 20 | 21 | 22 | // MARK: UI Lifecycle Methods 23 | 24 | override func viewDidLoad() 25 | { 26 | super.viewDidLoad() 27 | 28 | tableView.delegate = self 29 | tableView.dataSource = self 30 | 31 | let nib = UINib(nibName: "AppointmentTableViewCell", bundle: nil) 32 | tableView.register(nib, forCellReuseIdentifier: cellReuseIdentifier) 33 | } 34 | 35 | // MARK: actions 36 | @IBAction func onCreateNewAgreementTapped(_ sender: Any) 37 | { 38 | self.promptDevAction(composeEnvelopeHandler: presentComposeEnvelope) 39 | } 40 | 41 | // MARK: TableView Methods 42 | 43 | // number of sections in table view 44 | func numberOfSections(in tableView: UITableView) -> Int 45 | { 46 | return 1 47 | } 48 | 49 | // number of rows in table view 50 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 51 | return 2 52 | } 53 | 54 | // create a cell for each table view row 55 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell 56 | { 57 | 58 | // create a new cell if needed or reuse an old one 59 | let cell: AppointmentTableViewCell = self.tableView.dequeueReusableCell(withIdentifier: cellReuseIdentifier) as! AppointmentTableViewCell! 60 | 61 | return cell 62 | } 63 | 64 | // configure cell before display 65 | func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) 66 | { 67 | let apptCell: AppointmentTableViewCell = cell as! AppointmentTableViewCell 68 | 69 | switch indexPath.row 70 | { 71 | case 0: 72 | // first cell 73 | apptCell.lbl_date.text = "June 20, 2018" 74 | apptCell.lbl_clientName.text = "Tom Wood" 75 | apptCell.lbl_profileStatus.text = "Unsigned" 76 | apptCell.lbl_profileStatus.textColor = UIColor(red: 208.0/255, green: 2.0/255, blue: 27.0/255, alpha: 1.0) 77 | 78 | // add target action 79 | 80 | break 81 | 82 | case 1: 83 | // second cell 84 | apptCell.lbl_date.text = "June 19, 2018" 85 | apptCell.lbl_clientName.text = "Andrea G Kuhn" 86 | apptCell.lbl_profileStatus.text = "Signed" 87 | apptCell.lbl_profileStatus.textColor = UIColor(red: 126.0/255, green: 211.0/255, blue: 33.0/255, alpha: 1.0) 88 | break 89 | 90 | default: 91 | break 92 | } 93 | } 94 | 95 | // method to run when table view cell is tapped 96 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) 97 | { 98 | if (indexPath.row == 0) 99 | { 100 | // Segue to the Client view controller 101 | self.performSegue(withIdentifier: "segueOverviewClient", sender: self) 102 | } 103 | } 104 | 105 | // MARK: private methods 106 | private func promptDevAction(composeEnvelopeHandler handler: @escaping (_ signingMode: DSMSigningMode) -> Void) 107 | { 108 | let title = String.developerNotesTitle(with: true) 109 | let message = "You can either compose an envelope in online or offline mode. You would need to check for network connectivity and present the appropriate view controller." 110 | let agreementAlert = UIAlertController(title: title, message: message, preferredStyle: .alert) 111 | 112 | // add Ok action 113 | agreementAlert.addAction(UIAlertAction(title: "Online Envelope", style: .default, handler: { (action) in 114 | handler(.online) 115 | })) 116 | 117 | agreementAlert.addAction(UIAlertAction(title: "Offline Envelope", style: .default, handler: { (action) in 118 | handler(.offline) 119 | })) 120 | agreementAlert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler:nil)) 121 | self.present(agreementAlert, animated: true, completion: nil) 122 | } 123 | 124 | private func presentComposeEnvelope(_ signingMode: DSMSigningMode) -> Void 125 | { 126 | if #available(iOS 11.0, *) { 127 | EnvelopesManager.sharedInstance.presentComposeEnvelopeViewController(self, signingMode) 128 | } else { 129 | let alertController = UIAlertController(title: "iCloud Entitlement required", message: "For iOS 10 and below, iCloud entitlements must be added and DSM_SETUP_ICLOUD_DOCUMENT_ENABLED set to true for document picker usage.", preferredStyle: .actionSheet) 130 | 131 | let action = UIAlertAction(title: "OK", style: .default) { (action:UIAlertAction) in 132 | EnvelopesManager.sharedInstance.presentComposeEnvelopeViewController(self, signingMode) 133 | } 134 | alertController.addAction(action) 135 | self.present(alertController, animated: true, completion: nil) 136 | } 137 | } 138 | 139 | } 140 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Controllers/PortfolioViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PortfolioViewController.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | class PortfolioViewController: UIViewController 13 | { 14 | // MARK: UI Elements 15 | 16 | @IBOutlet weak var lbl_signedStatus: UILabel! 17 | @IBOutlet weak var lbl_clientName: UILabel! 18 | 19 | 20 | // MARK: UI Lifecycle Methods 21 | 22 | override func viewDidLoad() 23 | { 24 | super.viewDidLoad() 25 | } 26 | 27 | override func viewWillAppear(_ animated: Bool) { 28 | 29 | // set client name 30 | lbl_clientName.text = ProfileManager.sharedInstance.getClientName() 31 | 32 | // set signed label based on whether envelopes need to sync 33 | let envelopeIdsToSync = EnvelopesManager.sharedInstance.getCachedEnvelopeIds() 34 | 35 | if (envelopeIdsToSync != nil && (envelopeIdsToSync?.count)! > 0) 36 | { 37 | // envelopes need to sync, mark as signed 38 | self.lbl_signedStatus.text = "Signed" 39 | self.lbl_signedStatus.textColor = UIColor(red: 126.0/255, green: 211.0/255, blue: 33.0/255, alpha: 1.0) 40 | } 41 | else 42 | { 43 | // mark unsigned 44 | self.lbl_signedStatus.text = "Unsigned" 45 | self.lbl_signedStatus.textColor = UIColor(red: 208.0/255, green: 2.0/255, blue: 27.0/255, alpha: 1.0) 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Extensions/NSString+Extensions.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import DocuSignSDK 3 | 4 | extension String { 5 | /** 6 | Return title with optional DocuSign SDK version 7 | */ 8 | static func developerNotesTitle(with sdkVersion:Bool) -> String { 9 | if sdkVersion { 10 | return "Developer's Notes (\(DSMManager.buildVersion())" 11 | } 12 | return "Developer's Notes" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Images/tgk-financial.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Images/tgk-financial.jpg -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | TGK Capital 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | LSRequiresIPhoneOS 24 | 25 | NSCameraUsageDescription 26 | You will be able to use photos taken from your camera to send a document. 27 | NSContactsUsageDescription 28 | $(PRODUCT_NAME) contact use 29 | NSLocationWhenInUseUsageDescription 30 | $(PRODUCT_NAME) location use 31 | NSPhotoLibraryUsageDescription 32 | You will be able to use existing photos on your device to send a document. 33 | UILaunchStoryboardName 34 | LaunchScreen 35 | UIMainStoryboardFile 36 | Main 37 | UIRequiredDeviceCapabilities 38 | 39 | armv7 40 | 41 | UISupportedInterfaceOrientations 42 | 43 | UIInterfaceOrientationPortrait 44 | 45 | UIUserInterfaceStyle 46 | Light 47 | 48 | 49 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Managers/EnvelopesManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EnvelopesManager.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import DocuSignSDK 10 | import Foundation 11 | 12 | 13 | class EnvelopesManager 14 | { 15 | // singleton instance 16 | static let sharedInstance = EnvelopesManager() 17 | 18 | // DSM Envelopes Manager 19 | var mDSMEnvelopesManager: DSMEnvelopesManager? 20 | 21 | // list of template definitions 22 | var mEnvelopeDefinitions: [DSMEnvelopeDefinition]? 23 | 24 | //This prevents others from using the default '()' initializer for this class. 25 | private init() 26 | { 27 | if (self.mDSMEnvelopesManager == nil) 28 | { 29 | self.mDSMEnvelopesManager = DSMEnvelopesManager() 30 | } 31 | } 32 | 33 | 34 | func getCachedEnvelopeIds() -> [String]? 35 | { 36 | return self.mDSMEnvelopesManager?.cachedEnvelopeIds() 37 | } 38 | 39 | 40 | func syncEnvelopes() -> Void 41 | { 42 | self.mDSMEnvelopesManager?.syncEnvelopes() 43 | } 44 | 45 | func presentComposeEnvelopeViewController(_ presentingController:UIViewController, _ signingMode:DSMSigningMode) -> Void 46 | { 47 | // you can use method hasCachedDraftEnvelope() to determine whether you'd like to resume a draft or not 48 | self.mDSMEnvelopesManager?.presentComposeEnvelopeController(withPresenting:presentingController, signingMode:signingMode, resumeWithDraft: true, animated: true, completion: nil) 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Managers/TemplatesManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TemplatesManager.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import DocuSignSDK 10 | import Foundation 11 | 12 | class TemplatesManager 13 | { 14 | // singleton instance 15 | static let sharedInstance = TemplatesManager() 16 | 17 | // DSM Template Manager 18 | var templatesManager: DSMTemplatesManager? 19 | 20 | // list of template definitions 21 | var templateDefinitions: [DSMEnvelopeTemplateDefinition]? 22 | 23 | 24 | //This prevents others from using the default '()' initializer for this class. 25 | private init() { 26 | 27 | if (templatesManager == nil) 28 | { 29 | templatesManager = DSMTemplatesManager() 30 | } 31 | } 32 | 33 | typealias templateDefinitionsCompletionHandler = (_ templateDefinitions: [DSMEnvelopeTemplateDefinition]?) -> Void 34 | 35 | func getTemplateListWithCompletion(completionHandler: @escaping templateDefinitionsCompletionHandler) 36 | { 37 | // retrieve list of template definitions 38 | templatesManager?.listTemplates() { (templates, error) in 39 | NSLog("Get Template Definitions") 40 | 41 | if let error = error { 42 | NSLog("Error: \(error.localizedDescription)") 43 | } 44 | else { 45 | self.templateDefinitions = templates 46 | completionHandler(templates) 47 | } 48 | } 49 | } 50 | 51 | 52 | // check if template with templateId is cached on device 53 | func templateIsCachedWithId(templateId: String) -> Bool { 54 | return (templatesManager?.cacheStateOfTemplate(withId: templateId) == DSMTemplateCacheState.cached) 55 | } 56 | 57 | 58 | //typealias cacheTemplateCompletionHandler = (_ errMsg: String?) -> Void 59 | 60 | func cacheTemplateWithId(templateId: String, completionHandler: @escaping (String?) -> Void) { 61 | 62 | templatesManager?.cacheTemplate(withId: templateId, completion: { (error: Error?) in 63 | if let error = error { 64 | completionHandler(error.localizedDescription) 65 | } 66 | else { 67 | completionHandler(nil) 68 | } 69 | }) 70 | } 71 | 72 | 73 | func removeTemplateWithId(templateId: String) 74 | { 75 | // remove the specified template 76 | templatesManager?.removeCachedTemplate(withId: templateId) 77 | } 78 | 79 | 80 | func displayTemplateForSignature(templateId: String, controller: UIViewController, tabData: Dictionary, recipientData: Array, customFields:DSMCustomFields?, onlineSign: Bool, attachmentUrl: URL?, completionHandler: @escaping ((UIViewController?, Error?) -> Void)) 81 | { 82 | // load PDF data 83 | var pdfData: Data? 84 | if (attachmentUrl != nil) 85 | { 86 | do { 87 | pdfData = try Data(contentsOf: attachmentUrl!) 88 | } 89 | catch { 90 | NSLog("Error loading PDF data") 91 | } 92 | } 93 | 94 | let envelopeDefaults = DSMEnvelopeDefaults() 95 | envelopeDefaults.recipientDefaults = recipientData.count > 0 ? recipientData : nil 96 | envelopeDefaults.tabValueDefaults = tabData 97 | envelopeDefaults.customFields = customFields 98 | 99 | templatesManager?.presentSendTemplateControllerWithTemplate ( 100 | withId: templateId, 101 | envelopeDefaults: envelopeDefaults, 102 | pdfToInsert: pdfData, 103 | insertAtPosition: .end, 104 | signingMode: onlineSign ? .online : .offline, 105 | presenting: controller, 106 | animated: true) { (view, error) in 107 | if let error = error { 108 | NSLog("Error encountered during signing: \(error.localizedDescription)") 109 | } 110 | if view == nil { 111 | // `view` is `nil` if all of the signers pending for signature are remote 112 | // A) Envelope is sent to next remote signer, should receive `DSMSigningCompletedNotification` during online signing. 113 | // B) Or in case of offline signing, envelope is successfully cached and now awaiting sync. 114 | NSLog("Warning: Encountered `nil view` during signing.") 115 | } else { 116 | // DocuSign SDK UI components are active if >=1 local signers are pending signature 117 | NSLog("DocuSign Native iOS SDK - UI components active") 118 | } 119 | } 120 | } 121 | } 122 | 123 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Protocols/ContainerWithTableView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContainerWithTableView.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol ContainerWithTableView { 12 | 13 | func startEditModeOnTableView() 14 | func endEditModeOnTableView() 15 | } 16 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Resources/Portfolio.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Resources/Portfolio.pdf -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Resources/TGK_Capital_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Resources/TGK_Capital_Logo.png -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Resources/UtilityBill.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/docusign-sdk-sample-swift/docusign-sdk-sample-swift/Resources/UtilityBill.pdf -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Views/AppointmentTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppointmentTableViewCell.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class AppointmentTableViewCell: UITableViewCell { 12 | 13 | @IBOutlet weak var lbl_date: UILabel! 14 | @IBOutlet weak var lbl_clientName: UILabel! 15 | @IBOutlet weak var lbl_profileStatus: UILabel! 16 | 17 | override func awakeFromNib() 18 | { 19 | super.awakeFromNib() 20 | // Initialization code 21 | } 22 | 23 | override func setSelected(_ selected: Bool, animated: Bool) 24 | { 25 | super.setSelected(selected, animated: animated) 26 | 27 | // Configure the view for the selected state 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Views/CustomNavTitle.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Views/TemplateTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TemplateTableViewCell.swift 3 | // docusign-sdk-sample-swift 4 | // 5 | // 6 | // Copyright © 2017 DocuSign. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class TemplateTableViewCell: UITableViewCell 12 | { 13 | @IBOutlet weak var lbl_templateName: UILabel! 14 | @IBOutlet weak var btn_download: UIButton! 15 | 16 | override func awakeFromNib() 17 | { 18 | super.awakeFromNib() 19 | // Initialization code 20 | } 21 | 22 | override func setSelected(_ selected: Bool, animated: Bool) 23 | { 24 | super.setSelected(selected, animated: animated) 25 | 26 | // Configure the view for the selected state 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/Views/TemplateTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/docusign_sdk_sample_swift.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | docusign_sdk_sample_swift.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swift/docusign-sdk-sample-swift/docusign_sdk_sample_swift.xcdatamodeld/docusign_sdk_sample_swift.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'SwiftUIApp' do 5 | # Comment the next line if you don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for SwiftUIApp 9 | pod 'DocuSign' 10 | 11 | target 'SwiftUIAppTests' do 12 | inherit! :search_paths 13 | # Pods for testing 14 | end 15 | 16 | target 'SwiftUIAppUITests' do 17 | # Pods for testing 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/README.md: -------------------------------------------------------------------------------- 1 | # docusign-sdk-sample-swiftui 2 | DocuSign Native iOS SDK - Sample App in SwiftUI 3 | 4 | Install 5 | ============= 6 | * Launch Terminal and change directory to `docusign-sdk-sample-swiftui` 7 | * Perform `pod install` to fetch latest `DocuSign` pod. 8 | * Or run `pod update 'DocuSign'` command on terminal to update 'DocuSign' pod to the latest version from a previous version. 9 | * Launch `SwiftUIApp.xcworkspace` with XCode `12.4` or above 10 | * Please see the [Getting Started](https://developers.docusign.com/ios_sdk/developer.html) and [Integration](https://developers.docusign.com/ios_sdk/developer.html) section on the **Developer's Site** for more details. 11 | 12 | Sample Feature Implementation 13 | ============= 14 | 15 | * Embedded Captive Signing 16 | * Login with AccessToken 17 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIApp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIApp/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | 28 | UIApplicationSupportsIndirectInputEvents 29 | 30 | UILaunchScreen 31 | 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIApp/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIApp/SwiftUIApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | import DocuSignSDK 3 | 4 | @main 5 | struct SwiftUIApp: App { 6 | init() { 7 | print ("SwiftUI - DocuSign SDK Sample.") 8 | initializeDocuSign() 9 | } 10 | 11 | var body: some Scene { 12 | WindowGroup { 13 | ContentView() 14 | } 15 | } 16 | } 17 | 18 | private extension SwiftUIApp { 19 | func initializeDocuSign() { 20 | // initialize sdk manager 21 | var configurations = DSMManager.defaultConfigurations() 22 | configurations[DSM_SETUP_POWERED_BY_DOCUSIGN_ENABLED] = DSM_SETUP_FALSE_VALUE 23 | configurations[DSM_SETUP_ONLINE_SIGNING_DISABLE_NATIVE_COMPONENTS] = DSM_SETUP_TRUE_VALUE 24 | 25 | // initialize sdk manager 26 | DSMManager.setup(withConfiguration: configurations) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIApp/SwiftUIAppApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | import DocuSignSDK 3 | 4 | @main 5 | struct SwiftUIApp: App { 6 | init() { 7 | print ("SwiftUI - DocuSign SDK Sample.") 8 | initializeDocuSign() 9 | } 10 | 11 | var body: some Scene { 12 | WindowGroup { 13 | ContentView() 14 | } 15 | } 16 | } 17 | 18 | private extension SwiftUIApp { 19 | func initializeDocuSign() { 20 | // initialize DS sdk manager 21 | var configurations = DSMManager.defaultConfigurations() 22 | configurations[DSM_SETUP_POWERED_BY_DOCUSIGN_ENABLED] = DSM_SETUP_FALSE_VALUE 23 | configurations[DSM_SETUP_ONLINE_SIGNING_DISABLE_NATIVE_COMPONENTS] = DSM_SETUP_TRUE_VALUE 24 | 25 | // initialize DS sdk manager 26 | DSMManager.setup(withConfiguration: configurations) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIAppTests/SwiftUIAppTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import SwiftUIApp 3 | 4 | class SwiftUIAppTests: XCTestCase { 5 | 6 | override func setUpWithError() throws { 7 | // Put setup code here. This method is called before the invocation of each test method in the class. 8 | } 9 | 10 | override func tearDownWithError() throws { 11 | // Put teardown code here. This method is called after the invocation of each test method in the class. 12 | } 13 | 14 | func testExample() throws { 15 | // This is an example of a functional test case. 16 | // Use XCTAssert and related functions to verify your tests produce the correct results. 17 | } 18 | 19 | func testPerformanceExample() throws { 20 | // This is an example of a performance test case. 21 | self.measure { 22 | // Put the code you want to measure the time of here. 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIAppUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /docusign-sdk-sample-swiftui/SwiftUIAppUITests/SwiftUIAppUITests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | class SwiftUIAppUITests: XCTestCase { 4 | 5 | override func setUpWithError() throws { 6 | // Put setup code here. This method is called before the invocation of each test method in the class. 7 | 8 | // In UI tests it is usually best to stop immediately when a failure occurs. 9 | continueAfterFailure = false 10 | 11 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 12 | } 13 | 14 | override func tearDownWithError() throws { 15 | // Put teardown code here. This method is called after the invocation of each test method in the class. 16 | } 17 | 18 | func testExample() throws { 19 | // UI tests must launch the application that they test. 20 | let app = XCUIApplication() 21 | app.launch() 22 | 23 | // Use recording to get started writing UI tests. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testLaunchPerformance() throws { 28 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { 29 | // This measures how long it takes to launch your application. 30 | measure(metrics: [XCTApplicationLaunchMetric()]) { 31 | XCUIApplication().launch() 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /support-files/Auto_Insurance_Claims-without-tab-defaults.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/Auto_Insurance_Claims-without-tab-defaults.png -------------------------------------------------------------------------------- /support-files/Car_insurance_claim_adjuster_template-with-tab-defaults.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/Car_insurance_claim_adjuster_template-with-tab-defaults.png -------------------------------------------------------------------------------- /support-files/Document-Custom-Fields-in-Certificate-of-Completion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/Document-Custom-Fields-in-Certificate-of-Completion.png -------------------------------------------------------------------------------- /support-files/Home_insurance_claim_adjuster_template-with-tab-defaults.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/Home_insurance_claim_adjuster_template-with-tab-defaults.png -------------------------------------------------------------------------------- /support-files/Integration-Troubleshooting.md: -------------------------------------------------------------------------------- 1 | 2 | # Troubleshooting DocuSignSDK Integration issues 3 | 4 | ## 1. Bitcode 5 | 6 | ### v2.9 supports Bitcode enabled integrations. 7 | 8 | Use DocuSign Native iOS SDK `v2.9` or higher to enable Bitcode in your app. 9 | 10 | Native SDK `v2.8` or prior does not support bitcode, if your integration is dependent on **Bitcode**, perform pod update with `pod update 'DocuSign'` to fetch `v2.9` or higher. 11 | 12 | Following error occurs with integrations that are using `v2.8` or prior releases. 13 | 14 | ``` 15 | { 16 | Apple XCode build error: '/Users/appName.Apps/Pods/DocuSign/DocuSignSDK.framework/DocuSignSDK' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/appName.Apps/Pods/DocuSign/DocuSignSDK.framework/DocuSignSDK' for architecture armv7 17 | } 18 | ``` 19 | 20 | ## 2. Simulator Build fails for `arm64` 21 | 22 | ### Simulator Build error 23 | 24 | * `ld: building for iOS Simulator, but linking in dylib built for iOS, file '.../Pods/DocuSign/DocuSignSDK.framework/DocuSignSDK' for architecture arm64` 25 | * `ld: could not reparse object file in bundle: ‘Invalid version (Producer: ‘’ Reader: ‘’)’, using libLTO version ‘LLVM version 12.0.0, ()’ for architecture arm64` - specific to `Xcode12.4`. 26 | 27 | This is a known issue that happens with Xcode12.4 and higher builds for `iphonesimulator*` and Apple Silicon (M1 chips) for SDK version `v2.5` and earlier. 28 | 29 | ![building for iOS Simulator Error - Screenshot](simulator-build-release-archieve-issue.png) 30 | 31 | ### Fix with SDK version `2.5.1` 32 | 33 | This issue has been addressed with SDK `v2.5.1` release. Use `pod update 'DocuSign'` to upgrade the pod that contains *XCFramework* instead of *Binary Fat Framework*. `v2.5.1` is built with Xcode12.5 and supports both Apple Silicon & Intel hardware. Apps which are using older version of Xcode and not using *Modern Build System*, it's recommended to use `v2.5` or earlier versions to integrate with *Universal Binary* `DocuSignSDK.framework`. Projects which are using *Modern Build System* or shipping a SDK, it's recommended to utilize `v2.5.1` with Xcode12.5. 34 | 35 | ## 3. Undefined Symbols 36 | 37 | ### Error when building project: 38 | 39 | * Undefined symbol: 40 | * `_OBJC_CLASS_$_DSMEnvelopesManager`, 41 | * `_OBJC_CLASS_$_DSMManager`, 42 | * `_DSM_SETUP_TRUE_VALUE` and other similar symbols missing 43 | 44 | ![Undefined symbol in DocuSignSDK build error - Screenshot](docusignsdk-undefined-symbol.png) 45 | 46 | ### Root cause: 47 | 48 | * Invalid binary file: `DocuSignSDK.framework/DocuSignSDK`. In projects with missing symbol issues, `DocuSignSDK` binary file size is in a few KB. 49 | * `v2.5` and earlier: `DocuSignSDK` binary file under the framework isn't getting fetched correctly via the CocoaPods `pod install`. Correct `DocuSignSDK` binary is over 100MB. For example, the correct binary size as of `v2.5` is `105.8MB`. 50 | * `v2.5.1`: `DocuSignSDK` binary files are invalid for the XCFramework under the `Pods\` directory. 51 | * Incorrect file size for `DocuSignSDK` binary in `DocuSignSDK.xcframework\ios-arm64_i386_x86_64-simulator\DocuSignSDK.framework\` or `DocuSignSDK.xcframework\ios-arm64_armv7\DocuSignSDK.framework\`. 52 | 53 | ![Valid DocuSign SDK binary file - Screenshot](docusignsdk-binary-via-pods.png) 54 | 55 | ### Fix: Ensure Client is fetching DocuSignSDK Binary 56 | 57 | 1. Close Xcode 58 | 2. Go to the solution directory and perform `pod deintegrate` to uninitialize the pods. 59 | 3. Remove pods & lock file with `rm Podfile.lock` & `rm -rf Pods/` 60 | 4. Clean CocoaPods `DocuSign` pods in cache with `pod cache clean 'DocuSign' --all` 61 | 5. Make sure `Podfile` has a correct entry, for example: 62 | * `pod 'DocuSign'` or 63 | * Using Specific Commit: `pod 'DocuSign', :git => 'https://github.com/docusign/native-ios-sdk.git', :commit => "3ed4ed6985e44d12c99ae7a9f2b5bda66dd00b4d"` 64 | * Using Specific Branch: `pod 'DocuSign', :git => 'https://github.com/docusign/native-ios-sdk.git', :branch => "beta-branch-name"` 65 | * In case you are using specific branch to fetch `DocuSign` pod, **additional steps are required** to install [git-lfs](https://git-lfs.github.com/) as `pod install` fetches binary framework (>100MB file) via git-lfs hooks. 66 | * Install git-lfs via brew: `brew install git-lfs` 67 | * Activate git-lfs next: `git lfs install` 68 | 6. `pod install` or `pod install --repo-update` 69 | 7. Ensure `DocuSignSDK.framework/DocuSignSDK` binary file is available and is around `~105MB`, If yes, open workspace and build. Report an issue if problem still persists. 70 | -------------------------------------------------------------------------------- /support-files/Investment_Agreement.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/Investment_Agreement.pdf -------------------------------------------------------------------------------- /support-files/Localization.md: -------------------------------------------------------------------------------- 1 | ## Native iOS SDK - Localization 2 | 3 | ### DocuSign Native iOS SDK supports following languages: 4 | 5 | - Chinese Simplified & Traditional (zh-Hans/zh-Hant) 6 | - Dutch (nl) 7 | - English (en) 8 | - French (fr) 9 | - German (de) 10 | - Italian (it) 11 | - Japanese (ja) 12 | - Korean (ko) 13 | - Portuguese Brazil / Portugal (pt-BR/pt-PT) 14 | - Russian (ru) 15 | - Spanish (es) 16 | 17 | These languages are used automatically depending on the preferred language set in the DocuSign Account for web components (e.g. Online Signing) used in the SDK. For components using native iOS UI (e.g. Offline Signing), SDK will use the app language setting. For more details refer [Extensive Language support](https://www.docusign.com/how-it-works/global) for Signing and Sending. 18 | 19 | Raise [an issue](https://github.com/docusign/native-ios-sdk/issues) or reach to DocuSign Support Professional if an additional language needs to be supported. 20 | -------------------------------------------------------------------------------- /support-files/Permissions-Requirements.md: -------------------------------------------------------------------------------- 1 | ## Usages Permissions Requirements 2 | 3 | Native iOS SDK requires access to specific capabilities to prepare the agreement and capture signatures. Depending on the use case, you can use all or a subset of the usage permissions in the client app by adding respective descriptions in `Info.plist` file. 4 | 5 | ### Camera Access 6 | 7 | Native iOS SDK requires access to the Camera to capture user Signature. If this is the desired feature to use, you may define the usage description in `info.plist` to allow access to the Camera. 8 | 9 | `NSCameraUsageDescription` is required in case the app needs to capture a photo for signature adoption. 10 | 11 | `Privacy - Camera Usage Description`: `You will be able to use photos taken from your camera to sign a document.` 12 | 13 | ### Photo Library Access 14 | 15 | Like using Camera to capture user signature images, the DocuSign signing experience captures signatures using the Photo Library. The following usage description can be set in `info.plist` access to the Photo Library for your app. 16 | 17 | `NSPhotoLibraryUsageDescription` is required in case the app needs to upload images for signature adoption. 18 | 19 | `Privacy - Photo Library Usage Description`: `You will be able to use photos from your photo library to sign a document.` 20 | 21 | ### Location Access 22 | 23 | During the signing process, a signer location information allows DocuSign to display the 'Signed in Location' on a map from within envelope History. 24 | 25 | `NSLocationWhenInUseUsageDescription` is required in case the app needs to record more precise location data in the Certificate of Completion as part of the entire audit trail of a document. 26 | 27 | `Privacy - Location When In Use Usage Description`: `DocuSign records the location at which you sign a document to protect your signatures against fraud.` 28 | 29 | Additional details on location related tracking can be found [here](https://support.docusign.com/en/articles/Why-does-DocuSign-request-my-location-information-when-signing-a-document). 30 | 31 | ### Contacts Access 32 | 33 | If an app relies on the Apple Contacts to fill signer details, SDK has native-UI-components to fill in contact information (`name` and `email`) using Contacts Access on iOS. Alternative to UI components, the app could use Envelope & Recipient Defaults to set signer information programmatically. Also refer [Envelope Default](../Using-Envelope-Defaults.md) usage guide. 34 | 35 | `NSContactsUsageDescription` is required in case the app needs to access Contacts on device to fill recipient details during agreement preparation. 36 | 37 | `Privacy - Contacts Usage Description`: `You will be able to select contacts as recipients to sign a document.` 38 | 39 | ## Additional Details 40 | 41 | ### Sample App 42 | 43 | ![usage permission with a sample app](https://developers.docusign.com/docs/ios-sdk/images/documentation_screenshots/native-ios-sdk-info-plist.jpg) 44 | 45 | ### Camera & Photo Library Usage 46 | 47 | The Signature Adoption for offline and online signing may benefit from granting Camera & Photo Library access permissions. In the screenshot below, an embedded online signing-based app uses Photo Library or takes pictures using the Camera to capture signatures. 48 | 49 | ![embedded online signing signature capture using photo library and camera usage](./online-signing-upload-your-signature.jpeg) -------------------------------------------------------------------------------- /support-files/Summary.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/Summary.pdf -------------------------------------------------------------------------------- /support-files/Telemetry-Details.md: -------------------------------------------------------------------------------- 1 | ## Telemetry Details 2 | 3 | Release `v2.3.3` includes the addition of telemetry to track SDK events on the app side, such as starting signing and any of the errors that result during different phases. Telemetry is turned on by default and will help DocuSign debug any issues that may arise, but should you prefer to disable this you may set the `DSM_SETUP_ENABLE_TELEMETRY` flag to `false` when passing in the configuration flags to our SDK’s `DSMManager.setupWithConfiguration()` method 4 | 5 | Following are the **telemetry events** (and associated **event-specific properties** listed in parentheses) that are now tracked via DocuSign Native iOS SDK: 6 | 7 | * SDK authentication (success or failure, error reason if any) 8 | * Signing ceremony started (DocuSign account ID, DocuSign envelope ID) 9 | * Error during signing (error reason) 10 | * HTML link tapped during signing (link URL) 11 | * Online signing native component displayed (component such as native consumer disclosure, native signing palette, native signer selection, etc.) 12 | * Signer / host finished signing (success or failure, error reason if any, DocuSign account ID, DocuSign envelope ID, DocuSign recipient ID) 13 | * Signer / host cancelled signing (DocuSign account ID, DocuSign envelope ID, DocuSign recipient ID, cancelled by discard or save action) 14 | 15 | For each of these events, Telemetry manager also include the following properties: 16 | 17 | * Device connectivity (online / offline) 18 | * Device network mode (e.g. WiFi) 19 | * Device type (iPhone / iPad) 20 | * iOS version 21 | * DocuSign Native iOS SDK version 22 | * DocuSign account ID 23 | * DocuSign account name 24 | * Timestamp 25 | 26 | Note: These events are only sent to DocuSign backend and are not shared with any third-parties outside of DocuSign. -------------------------------------------------------------------------------- /support-files/captive-signing-postman/Add command postman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/captive-signing-postman/Add command postman.png -------------------------------------------------------------------------------- /support-files/captive-signing-postman/DocuSign Captive Recipient - mobile SDK.postman_collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "_postman_id": "5d9c8286-9d93-4ab1-b495-dc57058d514f", 4 | "name": "DocuSign Captive Recipient - mobile SDK", 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" 6 | }, 7 | "item": [ 8 | { 9 | "name": "Create Envelope - Captive Signer - Simple case (final)", 10 | "event": [ 11 | { 12 | "listen": "test", 13 | "script": { 14 | "exec": [ 15 | "pm.globals.set(\"envelopeId\", pm.response.json().envelopeId);" 16 | ], 17 | "type": "text/javascript" 18 | } 19 | } 20 | ], 21 | "request": { 22 | "method": "POST", 23 | "header": [ 24 | { 25 | "key": "X-DocuSign-Authentication", 26 | "value": "{{username}}{{password}}{{ikey}}" 27 | }, 28 | { 29 | "key": "Content-Type", 30 | "value": "application/json" 31 | } 32 | ], 33 | "body": { 34 | "mode": "raw", 35 | "raw": "\r\n{\r\n \"documents\": [\r\n {\r\n \"documentId\": \"1\",\r\n \"name\": \"blank.pdf\",\r\n \"fileExtension\": \"pdf\",\r\n \"documentBase64\": \"\"\r\n }\r\n ],\r\n \"recipients\":{\r\n \"signers\":[\r\n {\"recipientId\":\"1\",\"routingOrder\":\"1\",\"clientUserId\":\"1\",\"email\":\"hostEmail@dsxtr.com\",\"name\":\"hostName\", \"requireIdLookup\": \"false\", \"tabs\": {\r\n \"signHereTabs\": [{\r\n \"xPosition\": \"100\",\r\n \"yPosition\": \"100\",\r\n \"documentId\": \"1\",\r\n \"pageNumber\": \"1\"\r\n }],\r\n \"initialHereTabs\": [{\r\n \"xPosition\": \"200\",\r\n \"yPosition\": \"100\",\r\n \"documentId\": \"1\",\r\n \"pageNumber\": \"1\"\r\n }]\r\n }}\r\n ]\r\n },\r\n \"status\": \"sent\",\r\n \"emailSubject\": \"one recipient envelope - subject\",\r\n \"emailBlurb\": \"one recipient envelope - email\"\r\n}" 36 | }, 37 | "url": { 38 | "raw": "{{url}}/accounts/{{account}}/envelopes", 39 | "host": [ 40 | "{{url}}" 41 | ], 42 | "path": [ 43 | "accounts", 44 | "{{account}}", 45 | "envelopes" 46 | ] 47 | } 48 | }, 49 | "response": [] 50 | }, 51 | { 52 | "name": "Gets the status of recipients for an envelope. Copy", 53 | "request": { 54 | "method": "GET", 55 | "header": [ 56 | { 57 | "key": "X-DocuSign-Authentication", 58 | "value": "{{username}}{{password}}{{ikey}}" 59 | }, 60 | { 61 | "key": "Content-Type", 62 | "value": "application/json" 63 | } 64 | ], 65 | "url": { 66 | "raw": "{{url}}/accounts/{{account}}/c5a1d0aa-b754-4737-81f9-fbb6b34e3d9d/recipients", 67 | "host": [ 68 | "{{url}}" 69 | ], 70 | "path": [ 71 | "accounts", 72 | "{{account}}", 73 | "c5a1d0aa-b754-4737-81f9-fbb6b34e3d9d", 74 | "recipients" 75 | ] 76 | }, 77 | "description": "###### Client libraries: Envelopes::listRecipients\nRetrieves the status of all recipients in a single envelope and identifies the current recipient in the routing list. \n\nThe `currentRoutingOrder` property of the response contains the `routingOrder` value of the current recipient indicating that the envelope has been sent to the recipient, but the recipient has not completed their actions." 78 | }, 79 | "response": [] 80 | }, 81 | { 82 | "name": "Captive Recipient Url - Captive Signer - Simple case (final)", 83 | "request": { 84 | "method": "POST", 85 | "header": [ 86 | { 87 | "key": "Content-Type", 88 | "value": "application/json" 89 | }, 90 | { 91 | "key": "X-DocuSign-Authentication", 92 | "value": "{{username}}{{password}}{{ikey}}" 93 | }, 94 | { 95 | "key": "Accept", 96 | "value": "application/json" 97 | } 98 | ], 99 | "body": { 100 | "mode": "raw", 101 | "raw": "{\n \"returnUrl\": \"https://www.docusign.com/devcenter\",\n \"userName\": \"Triston Gilbert\",\n \"email\": \"thomas_template_demo@dsxtr.com\",\n \"authenticationMethod\": \"email\", \n \"clientUserId\":\"1\"\n}" 102 | }, 103 | "url": { 104 | "raw": "{{url}}/accounts/{{account}}/envelopes/06a04067-7850-4fae-924c-28a2f5b70fed/views/recipient", 105 | "host": [ 106 | "{{url}}" 107 | ], 108 | "path": [ 109 | "accounts", 110 | "{{account}}", 111 | "envelopes", 112 | "06a04067-7850-4fae-924c-28a2f5b70fed", 113 | "views", 114 | "recipient" 115 | ] 116 | } 117 | }, 118 | "response": [] 119 | } 120 | ] 121 | } -------------------------------------------------------------------------------- /support-files/captive-signing-postman/Get capacitive url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/captive-signing-postman/Get capacitive url.png -------------------------------------------------------------------------------- /support-files/captive-signing-postman/postman-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/captive-signing-postman/postman-config.png -------------------------------------------------------------------------------- /support-files/captive-signing-postman/postman-env-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/captive-signing-postman/postman-env-config.png -------------------------------------------------------------------------------- /support-files/captive-signing-postman/postman-post-envelopes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/captive-signing-postman/postman-post-envelopes.png -------------------------------------------------------------------------------- /support-files/docusignsdk-binary-via-pods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/docusignsdk-binary-via-pods.png -------------------------------------------------------------------------------- /support-files/docusignsdk-undefined-symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/docusignsdk-undefined-symbol.png -------------------------------------------------------------------------------- /support-files/objc-offline-signing-with-and-without-tab-defaults.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/objc-offline-signing-with-and-without-tab-defaults.mov -------------------------------------------------------------------------------- /support-files/offline-signing-with-and-without-tab-defaults.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/offline-signing-with-and-without-tab-defaults.mov -------------------------------------------------------------------------------- /support-files/online-signing-upload-your-signature.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/online-signing-upload-your-signature.jpeg -------------------------------------------------------------------------------- /support-files/simulator-build-excluded-architectures-arm64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/simulator-build-excluded-architectures-arm64.png -------------------------------------------------------------------------------- /support-files/simulator-build-release-archieve-issue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/simulator-build-release-archieve-issue.png -------------------------------------------------------------------------------- /support-files/template-editing-signer-roleName.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/native-ios-sdk/2b5451a40b2abed7d0d8cc22461ca59accca0bf2/support-files/template-editing-signer-roleName.png --------------------------------------------------------------------------------