Skip to main content

Dizme SDK iOS Framework Library

DizmeSDK iOS Framework Library

Introduction

Scope and field of document application

This document describes integration specifications and API Description of Dizme SDK library for the iOS version. Within the document, the library will be called simply library, Dizme SDK, Framework, Dizme Wallet SDK, SDK.

Framework Version

The iOS library version is: 0.0.3950

Release Note

  • 0.0.4 - API Description, first release
  • 0.0.5:
    • Added descriptions for the methods related to the new features:
      • reset
      • getCredentialsList
      • getNotificationsList
      • performActionFromURL
      • setAcceptedSchemes
      • setAcceptedCredentialDefinitions
    • Added NotificationType Enum
  • 0.0.6:
    • Removed Floating Action Button from the Home page of the SDK

Integration of Dizme SDK into an iOS Application

Prerequisites

The Framework is provided through JFrog InfoCert Artifactory. The framework integration, using JFrog Artifactory, must be done using CocoaPods. Therefore, the following instructions assumes that the Integrating Application already has a Podfile file and then is ready to use Pods. If not, before proceeding further, the necessary configuration to use Pods must be done by the Integrating Application. To perform all the necessary steps, the Integrating Application, can use the following guide: Using CocoaPods In order to use CocoaPods with JFrog Artifactory, the Integrator will need to install the cocoapods-art plugin.

To install cocoapods-art plugin, open the Terminal and run the following command: gem install cocoapods-art

Cocoapods-art plugin uses authentication to log into Jfrog Artifactory.

Therefore, the Integrator must have added the credentials for the access to the artifactory, in the standard netrc file. Then, in the netrc file of the integrator must be present the following authenitcation infos:

machine infocert.jfrog.io
login <USERNAME>
password <PASSWORD>

Using the Terminal, the integrator must add the Artifcactory Specs Repo for the CocoaPods Frameworks (dizme-native-iOS) as shown below:

pod repo-art add dizme-native-iOS "https://infocert.jfrog.io/artifactory/api/pods/dizme-native-iOS"

To update the added Specs (dizme-native-iOS) the Integrator, through the Terminal, can run:

pod repo-art update dizme-native-iOS

Add Framework's Pod to the integrant Application

To resolve Pods from the Artifactory Specs Repo added above (dizme-native-iOS), the Integrator must add the following snippet of code in the App's Podfile:

plugin 'cocoapods-art', :sources => [
  'dizme-native-iOS'
]

If the application uses other Pods, contained within the CocoaPods public repos, it must specify as the source, in addition to the one related to the Pods of the Artifactory, also:

source 'https://github.com/CocoaPods/Specs.git'

To integrate the SDK in to the Integrant Application, the Integrator must add, to the App's Podfile, the following line:

pod 'dizme_sdk_framework', '0.0.39'50'

An example of the App's Podfile is shown below:

platform :ios, '13.0'
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/hyperledger/indy-sdk.git'
plugin 'cocoapods-art', :sources => [
  'dizme-native-iOS'
]

target 'dizme_sdk_framework_test_app' do
  use_frameworks!
  pod 'dizme_sdk_framework', '0.0.39'50'
end

Finally, the Integrator can use, for the Pods installation, as usual:

pod install

API Description and I/O Objects

DizmeSDK

The object through which it is possible to perform all the main features offered by the SDK is the object DizmeSDK.

Each method invoked will provide the result through a specific callback. To receive the latter, it is necessary to adopt the relevant protocols: DizmeSDKCallback and DizmeSDKInitCallback

API Description

Below the description of the DizmeSDK object methods:

  • createWallet(walletPassword: String, dizmeSDKEnvironment: DizmeSDKEnvironment, dizmeSDKLanguage: DizmeSDKLanguage, pushToken: String, domainInvitation: String, domain: String, callback: DizmeSDKInitCallback: This method is useful to perform the first initialization of the SDK. So it will only be called once. Below the description of the parameters:

    • String walletPassword: A String that represents the Dizme SDK Wallet Password.
    • DizmeSDKEnvironment dizmeSDKEnvironment: The Dizme SDK Wallet environment
    • DizmeSDKLanguage dizmeSDKLanguage: An Enum that represents the language to set for the Dizme SDK Wallet.
    • String pushToken: A String that represents the push notifications related token.
    • String domainInvitation: A String that represents the invitation URL for the connection with the Domain.
    • String domain: A String that represents the Domain name.
    • DizmeSDKInitCallback callback: The callback that will be called at the end of the createWallet operation. Will be called the 'DizmeSDKInitCallback.onCreateWalletCompleted' callback.
  • openWallet(walletPassword: String, pushToken: String, callback: DizmeSDKInitCallback): This method is useful to perform the initialization of the SDK at each startup of the Integrant Application. Below the description of the parameters:

    • String walletPassword: A String that represents the Dizme SDK Wallet Password.
    • String pushToken: A String that represents the push notifications related token.
    • DizmeSDKInitCallback callback: The callback that will be called at the end of the openWallet operation. Will be called the 'DizmeSDKInitCallback.onOpenWalletCompleted' callback.
  • initializeSDKFromBackup(backupFilePath: String, walletPassphrase: String, walletPassword: String, dizmeSDKLanguage: DizmeSDKLanguage, pushToken: String, domain: String, callback: DizmeSDKInitCallback): This method is useful to perform the initialization of the SDK using a backup file. Below the description of the parameters:

    • String backupFilePath: A String that represents the path of the Dizme SDK Wallet backup file.
    • String walletPassphrase: A String that represents the Dizme SDK Wallet Passphrase necessary to execute the recovery of the Dizme Wallet.
    • String walletPassword: A String that represents the Dizme SDK Wallet Password.
    • DizmeSDKLanguage dizmeSDKLanguage: An Enum that represents the language to set for the Dizme SDK Wallet.
    • String pushToken: A String that represents the push notifications related token.
    • String domain: A String that represents the Domain name.
    • DizmeSDKInitCallback callback: The callback that will be called at the end of the initializeSDKFromBackup operation. Will be called the 'DizmeSDKInitCallback.onInitializeSDKFromBackup' callback.

The methods described above may also be called as DizmeSDK init methods or init methods. The operations that the SDK will perform by invoking them will be defined as init operations

  • startDizme(callback: DizmeSDKInitCallback, dataFromIntent: String?): This method is useful to start the main view of the Dizme SDK. Below the description of the parameters:

    • DizmeSDKInitCallback callback: The callback that will be called at the end of the startDizme operation. Will be called the 'DizmeSDKInitCallback.onStartCompleted' callback
    • String dataFromIntent (Optional): A String that represents the URI (as String) received by the Integrant App, if it is intended for Dizme.
  • analyzeNotify(callback: DizmeSDKCallback, notifyMessageAsDict: [String : Any?]): This method is useful to analyze Integrating App's incoming notifications. If the incoming messages belong to Dizme the output of this method will be true, otherwise false. In the first case, DizmeSDK will execute (on background) the related operations, dependent from the received message. Below the description of the parameters:

    • DizmeSDKCallback callback: The callback that will be called at the end of the analyzeNotify operation. Will be called the 'DizmeSDKCallback.onAnalyzeNotifyCompleted' callback
    • Dictionary notifyMessageAsDict: A notify message, as Dictionary, received by the Integrating Application. For example: ["destination":"dizme","owner":"dizme"]
  • doBackup(callback: DizmeSDKCallback): This method is useful to ask Dizme SDK to execute the backup of the entire Wallet. Below the description of the parameters:

    • DizmeSDKCallback callback: The callback that will be called at the end of the doBackup operation. Will be called the 'DizmeSDKCallback.onDoBackupCompleted' callback
  • getWalletPassphrase(callback: DizmeSDKCallback): This method is useful to obtain the Dizme SDK Wallet Passphrase useful to execute the Dizme Wallet Recovery (initializeSDKFromBackup). Below the description of the parameters:

    • DizmeSDKCallback callback: The callback that will be called at the end of the getWalletPassphrase operation. Will be called the 'DizmeSDKCallback.onGetWalletPassphraseCompleted' callback
  • getEnvironment(callback: DizmeSDKCallback): This method is useful to obtain the Dizme SDK Wallet Environment. Below the description of the parameters:

    • DizmeSDKCallback callback: The callback that will be called at the end of the getEnvironment operation. Will be called the 'DizmeSDKCallback.onGetEnvironmentCompleted' callback
  • getSDKVersion(callback: DizmeSDKCallback): This method is useful to obtain the Dizme SDK Wallet version. Below the description of the parameters:

    • DizmeSDKCallback callback: The callback that will be called at the end of the getSDKVersion operation. Will be called the 'DizmeSDKCallback.onGetSDKVersionCompleted' callback
  • getStatus(callback: DizmeSDKCallback): This method is useful to obtain the Dizme SDK Wallet status. Below the description of the parameters:

    • interfaces.DizmeSDKCallback callback: The callback that will called at the end of the getStatus operation. Will be called the 'DizmeSDKCallback.onGetStatusCompleted' callback
  • setLanguage(callback: DizmeSDKCallback, dizmeSDKLanguage: DizmeSDKLanguage): This method is useful to set the language of the Dizme SDK. Below the description of the parameters:

    • DizmeSDKCallback callback: The callback that will be called at the end of the setLanguage operation. Will be called the 'DizmeSDKCallback.onSetLanguageCompleted' callback
    • DizmeSDKLanguage dizmeSDKLanguage: The language to set
  • getLanguage(callback: DizmeSDKCallback): This method is useful to obtain the language of the Dizme SDK. Below the description of the parameters:

    • DizmeSDKCallback callback: The callback that will be called at the end of the getLanguage operation. Will be called the 'DizmeSDKCallback.onGetLanguageCompleted' callback
  • getMaintenanceInfo(callback: DizmeSDKCallback): This method is useful to obtain info about the Maintenance.

    • DizmeSDKCallback callback: The callback that will be called at the end of the getMaintenanceInfo operation. Will be called the 'DizmeSDKCallback.onGetMaintenanceInfoCompleted' callback
  • openNotify(callback: DizmeSDKCallback, notifyId: String): This method is useful to open a Notify object.

    • DizmeSDKCallback callback: The callback that will be called at the end of the openNotify operation. Will be called the 'DizmeSDKCallback.onOpenNotifyCompleted' callback
    • String notifyId: The unique identifier representing the Notify object chosen by the Integrant Application.
  • getDizmeViewController() -> UIViewController: This method is useful to obtain the Dizme SDK UIViewController. Within the latter will be displayed all Views of the SDK. A UIViewController object will be returned.

  • getMyDomainDid(callback: DizmeSDKCallback): This method is useful to obtain the SDK DID related to the connection with the Domain.

    • DizmeSDKCallback callback: The callback that will be called at the end of the getMyDomainDid operation. Will be called the 'DizmeSDKCallback.onGetMyDomainDidCompleted' callback
  • setNotifyCallback(callback: DizmeSDKCallback): This method is useful to set the callback that will be called when new Notify object was received by the SDK.

    • DizmeSDKCallback callback: The callback that will be called when new Notify object was received. Will be called the 'DizmeSDKCallback.onNewNotificationReceived' callback.
  • reset(callback: DizmeSDKCallback): This method is useful to ask Dizme SDK to reset the entire Dizme Wallet. This method must be invoked only when the DizmeSDK UIViewController, obtained using the method getDizmeViewController() -> UIViewController, is not in foreground (not shown). This is because when the reset will be performed, the latter will be restarted. When the callback will be called it will be possible to interact with the DizmeSDK UIViewController again.

    • DizmeSDKCallback callback: The callback that will be called at the end of the reset operation. Will be called the 'DizmeSDKCallback.onResetCompleted' callback.
  • performActionFromURL(callback:DizmeSDKCallback, url:String): This method is useful to provide to Dizme SDK the content of a Dizme QRCode, as an URL (as a String). If the URL is valid (belong to Dizme), the SDK will execute (on background) the related operations. Below the description of the parameters:

    • DizmeSDKCallback callback: The callback that will be called at the end of the performActionFromURL operation. Will be called the 'DizmeSDKCallback.onActionFromURLPerformed' callback.
    • String url: The URL, as a String, extracted from a Dizme QRCode.
  • getNotificationsList(callback:DizmeSDKCallback): This method is useful to obtain the list of the incomnig notifications, as a list of dizme_sdk_framework.models.Notify objects.

    • DizmeSDKCallback callback: The callback that will be called at the end of the getNotificationsList operation. Will be called the 'DizmeSDKCallback.onGetNotificationsListCompleted' callback.
  • getCredentialsList(callback:DizmeSDKCallback): This method is useful to obtain the list of the Credentials contained within the Dizme Wallet, as a JSON String.

    • DizmeSDKCallback callback: The callback that will be called at the end of the getCredentialsList operation. Will be called the 'DizmeSDKCallback.getCredentialsList' callback.
  • setAcceptedSchemes(callback:DizmeSDKCallback, schemesList:[String]): This method is useful to set a list of schemes to make the SDK accept all the credentials issued using that specific schema without requiring the user to verify the data contained within the related Credential. Therefore, by setting a Schema Id, the SDK will accept each Credential, which refers to that Schema Id, which can be issued by multiple Issuers.

    • DizmeSDKCallback callback: The callback that will be called at the end of the setAcceptedSchemes operation. Will be called the 'DizmeSDKCallback.onSetAcceptedSchemesCompleted' callback.
    • [String] schemesList: The List of Schemes Identifiers (as String) to set.
  • setAcceptedCredentialDefinitions(callback:DizmeSDKCallback, credentialDefinitionsList:[String]): This method is useful to set a list of Credential Definition Id to make the SDK accept all the credentials issued using that Id without requiring the user to verify the data contained within the related Credential. Therefore, by setting a Credential Definition Id, the SDK will accept each Credential with that Id which can be issued by specific Issuer.

    • DizmeSDKCallback callback: The callback that will be called at the end of the setAcceptedCredentialDefinitions operation. Will be called the 'DizmeSDKCallback.setAcceptedCredentialDefinitions' callback.
    • [String] credentialDefinitionsList: The list of Credential Definition Identifiers (as String) to set.

DizmeSDKInitCallback

Below the description of the callback methods for the init operations:

  • func onCreateWalletCompleted(dizmeSDKInitResult:DizmeSDKInitResult):This callback will be invoked when the operations performed by the DizmeSDK createWallet method are completed.
    • The DizmeSDKInitResult object contains the result of the createWallet operations.
  • func onOpenWalletCompleted(dizmeSDKInitResult:DizmeSDKInitResult):This callback will be invoked when the operations performed by the DizmeSDK openWallet method are completed.
    • The DizmeSDKInitResult object contains the result of the openWallet operations.
  • func onInitializeSDKFromBackup(dizmeSDKInitResult:DizmeSDKInitResult):This callback will be invoked when the operations performed by the DizmeSDK initializeSDKFromBackup method are completed.
    • The DizmeSDKInitResult object contains the result of the initializeSDKFromBackup operations.
  • func onStartCompleted(startResult:Bool, dizmeSDKInitError:DizmeSDKInitError?):This callback will be invoked when the operations performed by the DizmeSDK startDizme method are completed.
    • The Bool startResult represents the outcome of the start operation.
    • (Optional) The DizmeSDKInitError object describes the errors, if occurred, during the execution of the start operation.

DizmeSDKCallback

Below the description of the callback methods for the SDK operations:

  • func onAnalyzeNotifyCompleted(analyzeResult:Bool, dizmeSDKError:DizmeSDKError?):This callback will be invoked when the operations performed by the DizmeSDK analyzeNotify method are completed.

    • The Bool analyzeResult represents the outcome of the analyzeNotify operation.
    • (Optional) The DizmeSDKErrordizmeSDKError object describes the errors, if occurred, during the execution of the analyzeNotify operation.
  • func onDoBackupCompleted(doBackupResult:Bool, backupFilePath:String?, dizmeSDKError:DizmeSDKError?):This callback will be invoked when the operations performed by the DizmeSDK doBackup method are completed.

    • The Bool doBackupResult represents the outcome of the doBackup operation.
    • (Optional) The String backupFilePath represents the path of the backup file
    • (Optional) The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the doBackup operation.
  • func onGetWalletPassphraseCompleted(walletPassphrase:String?, dizmeSDKError:DizmeSDKError?):This callback will be invoked when the operations performed by the DizmeSDK getWalletPassphrase method are completed.

    • (Optional) The String walletPassphrase represents the walletPassphrase.
    • (Optional) The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the getWalletPassphrase operation.
  • func onGetEnvironmentCompleted(environment:DizmeSDKEnvironment?, dizmeSDKError:DizmeSDKError?):This callback will be invoked when the operations performed by the DizmeSDK getEnvironment method are completed.

    • (Optional) The DizmeSDKEnvironment environment represents the SDK Environment.
    • (Optional) The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the getEnvironment operation.
  • func onGetSDKVersionCompleted(sdkVersion:String?, dizmeSDKError:DizmeSDKError?):This callback will be invoked when the operations performed by the DizmeSDK getSDKVersion method are completed.

    • (Optional) The String sdkVersion represents the SDK version name.
    • (Optional) The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the getSDKVersion operation.
  • func onGetStatusCompleted(status:DizmeSDKStatus?, dizmeSDKError:DizmeSDKError?):This callback will be invoked when the operations performed by the DizmeSDK getStatus method are completed.

    • (Optional) The DizmeSDKStatus status represents the actual status of the Dizme SDK.
    • (Optional) The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the getStatus operation.
  • func onSetLanguageCompleted(setLanguageResult:Bool, dizmeSDKError:DizmeSDKError?):This callback will be invoked when the operations performed by the DizmeSDK setLanguage method are completed.

    • The Bool setLanguageResult represents the outcome of the setLanguage operation.
    • (Optional) The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the setLanguage operation.
  • onGetLanguageCompleted(language:DizmeSDKLanguage?, dizmeSDKError:DizmeSDKError?):This callback will be invoked when the operations performed by the DizmeSDK getLanguage method are completed.

    • (Optional) The DizmeSDKLanguagelanguage represents the outcome of the getLanguage operation.
    • (Optional) The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the getLanguage operation.
  • func onGetMaintenanceInfoCompleted(maintenanceInfo:DizmeSDKMaintenanceInfo?, dizmeSDKError:DizmeSDKError?):This callback will be invoked when the operations performed by the DizmeSDK getMaintenanceInfo method are completed.

    • (Optional) The DizmeSDKMaintenanceInfo maintenanceInfo represents the outcome of the getMaintenanceInfo operation.
    • (Optional) The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the getMaintenanceInfo operation.
  • func onOpenNotifyCompleted(openResult:Bool, dizmeSDKError:DizmeSDKError?): This callback will be invoked when the operations performed by the DizmeSDK openNotify method are completed.

    • The Bool openResult represents the outcome of the openNotify operation.
    • (Optional) The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the openNotify operation.
  • func onGetMyDomainDidCompleted(myDomainDid:String?, dizmeSDKError:DizmeSDKError?): This callback will be invoked when the operations performed by the DizmeSDK getMyDomainDid method are completed.

    • (Optional) The String myDomainDid represents the SDK DID related to the connection with the Domain.
    • (Optional) The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the onGetMyDomainDidCompleted operation.
  • func onNewNotificationReceived(notify:Notify?, dizmeSDKError:DizmeSDKError?): This callback will be invoked when a new Notify was received by the Dizme SDK.

    • (Optional) Notify notify: The Notify object received by the SDK.
    • (Optional) The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the parsing operation on the incoming notification.
  • func onResetCompleted(resetResult:Bool, dizmeSDKError:DizmeSDKError?): This callback will be invoked when the operations performed by the DizmeSDK reset method are completed.

    • The Bool resetResult represents the outcome of the reset operation.
    • The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the reset operation.
  • func onActionFromURLPerformed(result:Bool, dizmeSDKError:DizmeSDKError?): This callback will be invoked when the operations performed by the DizmeSDK performActionFromURL method are completed.

    • The Bool result represents the outcome of the performActionFromURL operation.
    • The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the performActionFromURL operation.
  • func onGetNotificationsListCompleted(notificationsList:[Notify]?, dizmeSDKError:DizmeSDKError?): This callback will be invoked when the operations performed by the DizmeSDK getNotificationsList method are completed.

    • The [Notify] notificationsList represents the outcome of the getNotificationsList operation.
    • The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the getNotificationsList operation.
  • onGetCredentialsListCompleted(credentialsListJSON:String?, dizmeSDKError:DizmeSDKError?): This callback will be invoked when the operations performed by the DizmeSDK getCredentialsList method are completed.

    • The String credentialsListJSON represents, through a JSON String, the outcome of the getCredentialsList operation.
    • The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the getCredentialsList operation.

    Example: {"L1":{"schema_id":"TEST:2:L1:1.1","credential_definition_id":"TEST:3:CL:181552:L1#2.0","attributes":[{"name":"name","mime-type":"text/plain","value":"TEST"},{"name":"surname","mime-type":"text/plain","value":"TEST"},{"name":"birthdate","mime-type":"text/plain","value":"1900-1-1"},{"name":"birthplace","mime-type":"text/plain","value":"TEST"},{"name":"citizenship","mime-type":"text/plain","value":"TEST"},{"name":"credentialIssueTimestamp","mime-type":"text/plain","value":"1600000001"}]}}

  • func onSetAcceptedSchemesCompleted(setAcceptedSchemesResult:Bool, dizmeSDKError:DizmeSDKError?): This callback will be invoked when the operations performed by the DizmeSDK setAcceptedSchemes method are completed.

    • The Bool setAcceptedSchemesResult represents the outcome of the setAcceptedSchemes operation.
    • The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the setAcceptedSchemes operation.
  • func onSetAcceptedCredentialDefinitionsCompleted(setAcceptedCredentialDefinitionsResult:Bool, dizmeSDKError:DizmeSDKError?): This callback will be invoked when the operations performed by the DizmeSDK setAcceptedCredentialDefinitions method are completed.

    • The Bool setAcceptedCredentialDefinitionsResult represents the outcome of the setAcceptedCredentialDefinitions operation.
    • The DizmeSDKError dizmeSDKError object describes the errors, if occurred, during the execution of the setAcceptedCredentialDefinitions operation.

DizmeSDKLanguage

Enum which represents the possible language that can be used with the SDK.

Values:

  • en: English language.
  • it: Italian language.
  • fr: French language.

DizmeSDKEnvironment

Enum which represents the possible environment that can be used with the SDK.

Values:

  • MainNet: Production environment.
  • StageNet: Staging environment.
  • BuilderNet: Development environment.

DizmeSDKMaintenanceInfo

This object is useful to provide to the Integrant App the informations about the maintenance (or planned maintenance) of the Dizme SDK. The information contained therein can be used by the Integrant App to provide information to the user about the maintenance that will be carried out on the Dizme SDK.

Below the description of the DizmeSDKMaintenanceInfo methods:

  • func getType() -> DizmeSDKMaintenanceType?: (Optional) Returns the type of maintenance (DizmeSDKMaintenanceType) if it is present.
  • func getTitle()->String?: (Optional) Returns, if it is present, a title String (localized) related to the maintenance, useful to build a message to show to the user.
  • func getMessage()->String?: (Optional) Returns, if it is present, a message String (localized) related to the maintenance, useful to build a message to show to the user.
  • func getFromDate() -> Date?: (Optional) Returns (if present, otherwise the field is nil) the start Date of the maintenance operations.
  • func getToDate()->Date?: (Optional) Returns (if present, otherwise the field is nil) the end Date of the maintenance operations.

DizmeSDKMaintenanceType

Enum which represents the possible type of ongoing maintenance.

Values:

  • MAINTENANCE: SDK is under maintenance. More informations could be retrieved using the getMaintenanceInfo method of the DizmeSDK object.
  • INFO: This maintenance type is related to a informations about future maintenance or other important informations about the SDK. More informations could be retrieved using the getMaintenanceInfo method of the DizmeSDK object.
  • FUTURE_MAINTENANCE: A future maintenance is planned. More informations could be retrieved using the getMaintenanceInfo method of the DizmeSDK object.

DizmeSDKStatus

Enum which represents the possible status of the Dizme SDK obtained by calling the DizmeSDK getStatus method. Based on the DizmeSDKStatus it will be possible to understand which Dizme SDK init method to invoke, or if an error has occurred.

Values:

  • UNINITIALIZED: Dizme SDK was never initialized before. It is the case of first init of the SDK. Then, if the status is UNINITIALIZED the createWallet method of the DizmeSDK object must be called.
  • INITIALIZED: The SDK is already initialized. This is the case of every SDK init following the first one (for example, every execution of the integrant Application). So, if the state is INITIALIZED, the openWallet method of the DizmeSDK object must be called.
  • ERROR: Dizme SDK is in Error. A critical error has occurred. The SDK cannot be started.

DizmeSDKInitStatus

Enum which represents the possible status reached as a result of running one of the DizmeSDK init methods (createWallet or openWallet). Each init method invoked will then return the reached status or an error.

Values:

  • INITIALIZED: Status reached if the init operations invoked by the createWallet method of the DizmeSDK object was successful.
  • STARTED: Status reached if the init operations invoked by the openWallet method of the DizmeSDK object was successful.
  • RECOVERED: Status reached if the init operations invoked by the initializeSDKFromBackup method of the DizmeSDK object was successful.
  • ERROR: An error occurred while executing of an init method. Further details will be provided through the DizmeSDKInitResult.

DizmeSDKInitResult

Object useful to handle the result of the init methods of the DizmeSDK object: createWallet, openWallet, initializeSDKFromBackup.

Below the description of the DizmeSDKInitResult methods:

  • func getInitStatus() -> DizmeSDKInitStatus?: (Optional) Returns (if present, otherwise the field is nil) the result status of an init method.
  • func getInitError() -> DizmeSDKInitError?: (Optional)Returns (if present, otherwise the field is nil) the type of error that occurred while executing one of the init methods.
  • func getErrorDetails() ->String?: (Optional)Returns (if present, otherwise the field is nil) a String (localized) that provides a description of the occurred error while executing one of the init methods.
  • func getErrorSpecific()->DizmeSDKInitErrorSpecific?: (Optional) Returns (if present, otherwise the field is nil) more details about the occurred error.

DizmeSDKError

Enum which represents the possible error occurred during the executions of the Dizme SDK methods.

Values:

  • CRITICAL: Critical internal error occurred.
  • GENERIC: Generic error occurred.
  • BACKUP_ERROR: An error occurred during the wallet backup procedure.
  • INVALID_SDK_STATUS: Error, Dizme SDK is it is not in the correct state to be able to perform the required functionality. Check DizmeSDKStatus value.
  • NOT_READY: Error, Dizme SDK is still not ready to use. Try to call the getStatus method, of the DizmeSDK object, again and check DizmeSDKStatus value.
  • INVALID_INPUT_PARAMETERS: Error, wrong parameters provided to the method. Check input parameters.
  • NETWORK_ERROR: Network Error. Check internet connection.
  • URL_NOT_VALID_ERROR: The URL provided is not valid for the Dizme SDK.

DizmeSDKInitError

Enum which represents the possible error occurred during the executions of the init methods of the Dizme SDK.

Values:

  • CRITICAL: Critical internal error occurred.
  • REGISTRATION_ERROR: Generic error occurred during the Registration phase.
  • INITIALIZE_WALLET_ERROR: Generic error occurred during the Initialize Wallet phase.
  • RECOVERY_WALLET_ERROR: Generic error occurred during the Recovery Wallet phase.
  • NETWORK_ERROR: Network Error. Check internet connection.
  • WRONG_PIN_ERROR: Error, a wrong wallet PIN was provided
  • INVALID_SDK_STATUS: Error, Dizme SDK is it is not in the correct state to be able to perform the required functionality. Check DizmeSDKStatus value.
  • INVALID_INPUT_PARAMETERS: Error, wrong parameters provided to the method. Check input parameters.
  • NOT_READY: Error, Dizme SDK is still not ready to use. Try to call the DizmeSDK getStatus method again and check DizmeSDKStatus value.
  • LOGIN_ERROR: Login error occurs during the DizmeSDK openWallet phase.
  • RESET_NEEDED: An error occurs during the DizmeSDK openWallet or the DizmeSDK initializeSDKFromBackup phase. In this case, the Wallet is already installed on other device and will be deleted on the current device.
  • MAINTENANCE: Dizme is under maintenance. The SDK cannot be started. More informations about the maintenance can be retrieved through the getMaintenanceInfo method of the DizmeSDK object. This status was returned in case of maintantenance of type (DizmeSDKMaintenanceType) MAINTENANCE. However, it is convenient to invoke the getMaintenanceInfo method of the DizmeSDK object before each call to the DizmeSDK object's init method (createWallet, openWallet, initializeSDKFromBackup). This is because in addition to blocking maintenance, a DizmeSDKMaintenanceInfo object could be returned concerning a future planned maintenance (DizmeSDKMaintenanceType.FUTURE_MAINTENANCE) or a maintenance Info message could be returned. The latters is used by the SDK to communicate important information while not blocking the SDK from starting.

DizmeSDKInitErrorSpecific

Enum which represents more informations regarding the possible error occurred during the executions of the init methods of the Dizme SDK.

Values:

  • CRTITICAL_ERROR: Critical internal error occurred.
  • NETWORK_ERROR: Network Error. Check internet connection.
  • BLOCKCHAIN_UNREACHABLE: Error, Blockchain is unreachable.
  • BLOCKCHAIN_UNREACHABLE_TIMEOUT: Error, Blockchain is unreachable for timeout.
  • BLOCKCHAIN_UNREACHABLE_VPN: Error, Blockchain is unreachable for presence of Firewall or VPNs.
  • WRONG_CREDENTIALS: Error, elements used for the wallet recovery (wallet backup file and/or wallet passphrase) are wrong.

RECOVERY_WALLET_ERROR: Generic error occurred during the Recovery Wallet phase.

  • NETWORK_ERROR: Network Error. Check internet connection.
  • WRONG_PIN_ERROR: Error, a wrong wallet PIN was provided
  • INVALID_SDK_STATUS: Error, Dizme SDK is it is not in the correct state to be able to perform the required functionality. Check it.etuitus.dizme_sdk_aar.models.DizmeSDKStatus value.
  • INVALID_INPUT_PARAMETERS: Error, wrong parameters provided to the method. Check input parameters.
  • NOT_READY: Error, Dizme SDK is still not ready to use. Try to call the DizmeSDK.getStatus method again and check it.etuitus.dizme_sdk_aar.models.DizmeSDKStatus value.
  • LOGIN_ERROR: Login error occurs during the DizmeSDK.openWallet phase.
  • RESET_NEEDED: An error occurs during the DizmeSDK.openWallet or the DizmeSDK.initializeSDKFromBackup phase. In this case, the Wallet is already installed on other device and will be deleted on the current device.
  • MAINTENANCE: Dizme is under maintenance. The SDK cannot be started. More informations about the maintenance can be retrieved through the getMaintenanceInfo() method of the DizmeSDK object. This status was returned in case of maintantenance of type (DizmeSDKMaintenanceType) MAINTENANCE. However, it is convenient to invoke the getMaintenanceInfo() method of the DizmeSDK object before each call to the DizmeSDK object's init method (createWallet, openWallet, initializeSDKFromBackup). This is because in addition to blocking maintenance, a it.etuitus.dizme_sdk_aar.models.DizmeSDKMaintenanceInfo object could be returned concerning a future planned maintenance (DizmeSDKMaintenanceType.FUTURE_MAINTENANCE) or a maintenance Info message could be returned. The latters is used by the SDK to communicate important information while not blocking the SDK from starting.

DizmeSDKInitErrorSpecific

Enum which represents more informations regarding the possible error occurred during the executions of the init methods of the Dizme SDK.

Values:

  • CRTITICAL_ERROR: Critical internal error occurred.
  • NETWORK_ERROR: Network Error. Check internet connection.
  • BLOCKCHAIN_UNREACHABLE: Error, Blockchain is unreachable.
  • BLOCKCHAIN_UNREACHABLE_TIMEOUT: Error, Blockchain is unreachable for timeout.
  • BLOCKCHAIN_UNREACHABLE_VPN: Error, Blockchain is unreachable for presence of Firewall or VPNs.
  • WRONG_CREDENTIALS: Error, elements used for the wallet recovery (wallet backup file and/or wallet passphrase) are wrong.

Notify

Object useful to describe an incoming notification.

Below the description of the Notify (Notify) getter methods:

  • func getId() -> String?: Returns,through an object of type String, the notify's Id
  • func getTitle()-> String?: Returns,through an object of type String, the notify's Title
  • fun getMessage()->String?: Returns,through an object of type String, the notify's Message
  • func getCreated() -> Date?: Returns,through an object of type Date, the notify's creation Date
  • getData() -> [String:Any]?: Returns,through an object of type [String:Any], the notify's (optional) additional Data
  • func getType() -> NotificationType?: Returns,through an object of type NotificationType, the notify's Type

Below an example of Notification's List (from toString() -> String method): [Notify{"title": Optional("A message from Company"), "message": Optional("test"), "created":Optional(2023-05-25 14:31:25 +0000), "id": Optional("d03b24fa-fb08-11ed-a9bb-bed920a82699"), "type": Optional(dizme_sdk_framework.NotificationType.INFO), "data":Optional([:])},Notify{"title": Optional("Issue credential TEST"), "message": Optional("Company offers you the credential TEST"), "created":Optional(2023-05-25 14:31:59 +0000), "id": Optional("2e3fa887-3709-4611-ba0c-54403bda7179"), "type": Optional(dizme_sdk_framework.NotificationType.ISSUE_CREDENTIAL), "data":Optional(["credential_definition_id": TEST:3:CL:43451:L1V02, "schema_id": TEST:2:L1:2.1])}]

NotificationType

An Enum that represents the type of the incoming notification (Notify).

Values:

  • ISSUE_CREDENTIAL: The incoming notification is related to an issue of a Credential. In this case, the Dictionary obtained using the getData() -> [String:Any]? method described above will contain two Strings related to the Credential, object of the notification. Specifically, therefore, the Credential Definition Id (credential_definition_id) and the Schema Id (schema_id) will be present (see the Example above).
  • PROOF_REQUEST: The incoming notification is related to a Proof Request
  • INFO: The incoming notification is an info message for the user

Use of DizmeSDK

To use DizmeSDK it is necessary to add the import: import dizme_sdk_framework.

Once the DizmeSDK type object has been instantiated,the getStatus method must be invoked.

Before proceeding further, regarding the output of the getStatus method, available through the callback DizmeSDKCallback.onGetStatusCompleted(status:DizmeSDKStatus?, dizmeSDKError:DizmeSDKError?), the integrating Application must not proceed in calling other methods related to the DizmeSDK object before the DizmeSDKStatus hasn't value different from DizmeSDKError.NOT_READY or if DizmeSDKError hasn't value different from DizmeSDKStatus.ERROR.

Then, later, when the getStatus method ends with values different from that described above, the integrant Application can invoke the init methods of the SDK using the method createWallet or the method openWallet, regarding the value of the DizmeSDKStatus (INITIALIZED, UNINITIALIZED), as described in the sections above.

When on of the two callback methods (onCreateWalletCompleted or onOpenWalletCompleted) will be called, dependently from the init method chosen (createWallet or openWallet), the startDizme method may be invoked. At the end of start operations, the onStartCompleted callback will be invoked.

At this point the Dizme SDK will be ready to be viewed.

Then, using the getDizmeViewController method, can be recovered the UIViewController in which the Dizme SDK will be displayed and can be the positioned the latter in the appropriate View of the Integrant App chosen for viewing Dizme SDK.

Since the operations described above, createWallet/openWallet and startDizme, may take some time, it would be advisable to execute them at the startup of the Integrating App in order to have, at the end of the startup, the UIViewController ready to be displayed (Dizme SDK already initialized and ready). If the Dizme SDK UIViewController should be displayed before the end of the operations described above, a view containing a progress bar will be displayed.

Auto-Accept Incoming Credentials

If the Integrating Application wants to use one of the two setAcceptedSchemes and/or setAcceptedCredentialDefinitions methods listed in the API Description paragraph, it is advisable to invoke the desired method as soon as the SDK status is DizmeSDKInitStatus.INITIALIZED to be sure that these parameters have been set before receive any credential.

Therefore for the first initialization they can be invoked within the callback onCreateWalletCompleted or onInitializeSDKFromBackup (as soon as the SDK state is DizmeSDKInitStatus.RECOVERED) in case of Wallet recovery.

Once the desired values have been set, they remain stored until the App is uninstalled from the device.

In case the integrating Application wants to specify, after the first initialization, different values for the Schema Id or Credential Definition Id, integrating Application can invoke the related methods within the onOpenWalletCompleted callback (as soon as the SDK status is DizmeSDKInitStatus.STARTED). In this way the previously indicated values will be overwritten.

Use of DizmeSDK - Example:

Below, some snippet of code that represents an example (incomplete) of an iOS Demo Application that integrate the SDK.

In particular, the latter, has a UITabBarController (UITabBarViewController) as main UIViewController (as initial ViewController) and within the latter displays two UIViewController.

The first (TabOneViewController) is a empty UIViewController. The second is a UIViewController (ViewController) that will display the Dizme SDK UIViewController

AppDelegate.swift

.......

	func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
	let window = UIWindow(frame: UIScreen.main.bounds)
	let storyboard = UIStoryboard(name: "Main", bundle: nil)
	let tabBarController = UITabBarViewController()
	window.rootViewController = tabBarController
	window.makeKeyAndVisible()   
	return true
}

........

UITabBarViewController.swift

import UIKit
import dizme_sdk_framework
class UITabBarViewController: UITabBarController, UITabBarControllerDelegate {
    
    private var dizmeSDK:DizmeSDK!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        dizmeSDK = DizmeSDK()
        self.delegate = self
        
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        self.tabBar.autoresizesSubviews = true
        self.tabBar.tintColor = UIColor.red
        self.tabBar.backgroundColor = UIColor.gray
        self.tabBar.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        
        let firstPage = TabOneViewController()
        let firstPageItem = UITabBarItem(title: "First Page", image:nil, selectedImage:nil)
        firstPage.tabBarItem = firstPageItem
        
        let dizmeTab = ViewController()
        dizmeTab.setDizmeSDKInstance(dizmeSDK: self.dizmeSDK)
        let dizmeTabItem = UITabBarItem(title: "Dizme Page", image: nil, selectedImage: nil)
        dizmeTab.tabBarItem = dizmeTabItem
        
        self.viewControllers = [firstPage,dizmeTab]
    }
}
........

ViewController.swift

import dizme_sdk_framework
import UIKit

class ViewController: UIViewController, DizmeSDKInitCallback, DizmeSDKCallback {
    
    private var dizmeSDK:DizmeSDK!
    private var dizmeViewController: UIViewController!
    
    public func setDizmeSDKInstance(dizmeSDK: DizmeSDK) {
        self.dizmeSDK = dizmeSDK
        self.dizmeViewController = dizmeSDK.getDizmeViewController()
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.systemTeal
        self.title = "Dizme"
        dizmeSDK.getStatus(callback: self)
    }
    
    func onGetStatusCompleted(status: dizme_sdk_framework.DizmeSDKStatus?, dizmeSDKError: DizmeSDKError?) {
        if (dizmeSDKError == DizmeSDKError.NOT_READY || status == DizmeSDKStatus.ERROR) {
            dizmeSDK.getStatus(callback: self)
            return
        }
        
        if (status == DizmeSDKStatus.UNINITIALIZED) {
            self.dizmeSDK.createWallet(walletPassword: "Kjufhte7557ujf@oolzzh", dizmeSDKEnvironment: DizmeSDKEnvironment.StageNet, dizmeSDKLanguage: DizmeSDKLanguage.en, pushToken: "NOT_A_REAL_TOKEN_57757ifinisnvdcsdcdscdsndosncwscunrsNOEWndonwdanIUNFWIRFNadskldnweadocsnd", domainInvitation: "https://agent-cl.dizme.io/api/v1/invitation/dizme_default_invitation", domain: "dizme",callback: self)
        }
        
        if (status == DizmeSDKStatus.INITIALIZED) {
            dizmeSDK.openWallet(walletPassword: "Kjufhte7557ujf@oolzzh",
                                pushToken: "NOT_A_REAL_TOKEN_57757ifinisnvdcsdcdscdsndosncwscunrsNOEWndonwdanIUNFWIRFNadskldnweadocsnd",
                                callback: self)
            
        }
        self.dizmeViewController = dizmeSDK.getDizmeViewController()
        .....
		  .....
			 .....
        
    }
    
    
    func onCreateWalletCompleted(dizmeSDKInitResult: DizmeSDKInitResult) {
        let initStatus:DizmeSDKInitStatus? = dizmeSDKInitResult.getInitStatus()
        if (dizmeSDKInitResult.getInitStatus() == DizmeSDKInitStatus.INITIALIZED) {
            dizmeSDK.startDizme(callback: self, dataFromIntent: nil)
        }
    }
    
    func onOpenWalletCompleted(dizmeSDKInitResult: dizme_sdk_framework.DizmeSDKInitResult) {
        let initStatus:DizmeSDKInitStatus? = dizmeSDKInitResult.getInitStatus()
        if (dizmeSDKInitResult.getInitStatus() == DizmeSDKInitStatus.STARTED) {
            dizmeSDK.startDizme(callback: self, dataFromIntent: nil)
        }
    }
    
    func onStartCompleted(startResult: Bool, dizmeSDKInitError: dizme_sdk_framework.DizmeSDKInitError?) {
    	dizmeSDK.analyzeNotify(callback: self, notifyMessageAsDict: ["destination":"dizme","owner":"dizme","click_action":"FLUTTER_NOTIFICATION_CLICK"])
        dizmeSDK.setNotifyCallback(callback: self)
        dizmeSDK.testNotifications()
        return
	 }
.....
.....
 .....
}

Customization of DizmeSDK

Some characteristics of the SDK can be customized. To do this, the Integrating Application must add a JSON file with the name dizme_sdk_config.json to the path PROJECT_MAIN_DIRECTORY/dizme/

Within the latter, by adding the defined keys, with the relative values, it is possible to customize some aspects of the SDK.

Then, within Xcode, click on the root element of the Projects Navigator View (on the left side of the IDE, the Navigator Area) and then click on the Target element on the right side (under Targets). Then select the Build Phases Tab.

From here, click on the + button and select New Run Script Phase.

Move the latter to the end of the phase's List.

Whitin the created Run Script block, copy the following line of code:

mkdir ${BUILT_PRODUCTS_DIR}/${TARGET_NAME}.app/Frameworks/App.framework/flutter_assets/dizme cp dizme/dizme_sdk_config.json ${BUILT_PRODUCTS_DIR}/${TARGET_NAME}.app/Frameworks/App.framework/flutter_assetsflutter_assets/dizme.

Below, the description of the currently customizable aspects with the indication of the key to be inserted inside the JSON object and the relative value.

  • Primary color of the SDK's views:
    • Key: primaryColor
    • Value: string. Color to be set, as Hex String.
    • Default value: "#0181C8"
  • Secondary color of the SDK's views:
    • Key: secondaryColor
    • Value: string. Color to be set, as Hex String.
    • Default value: "#0A4B8F"
  • Text color used on Primary Color:
    • Key: textColorOnPrimary
    • Value: string. Color to be set, as Hex String.
    • Default value: "#FFFFFF"
  • Show/Hide Top portion of the Home Page (Including Avatar and Username label):
    • Key: show_only_credentials_on_home_page
    • Value: boolean. If true, only the credential list will be shown on the HomePage.
    • Default value: false

Below an example of the JSON file (dizme_sdk_config.json):

{
  "show_only_credentials_on_home_page":true,
  "primaryColor" : "#006F98",
  "textColorOnPrimary" :"#FFFFFF",
  "secondaryColor":"#0B2E4F"
}