About • Release Status • Contributing • Licensing
This repository hosts source code for the reference implementation of the GovStack Consent Building Block Privacy Dashboard towards individuals.
Released. Refer to the wiki page for the latest status of the deliverables.
PrivacyDashboardiOS is available through CocoaPods. To install it, simply add the following line to your Podfile after all pod set up done:
pod 'PrivacyDashboardiOS','2023.11.10'
Import PrivacyDashboard SDK
#import PrivacyDashboardiOS
Initiate the privacy dashboard with the code block below:
PrivacyDashboard.showPrivacyDashboard(withApiKey: <apiKey>,
withUserId: <userId>,
withOrgId: <orgId>,
withBaseUrl: <baseUrl>,
turnOnAskme: <Bool>,
turnOnUserRequest: <Bool>,
turnOnAttributeDetail: <Bool>)
We can show the privacy dashboard with accessToken
(optional parameter).
Note: If we have
accessToken
then no need to passAPI key
andUser ID
To set app language, pass language code to withLocale
.
Now supporting three languages ie: English, Swedish and Finnish (By default it'll be English)
.withLocale: "en",
To enable user requests, set the turnOnUserRequest
to true
.turnOnUserRequest : true
To enable Ask me, set the turnOnAskme
to true
.turnOnAskme : true
To enable Attribute detail screen, set the turnOnAttributeDetail
to true
.turnOnAttributeDetail : true
To initiate the Data sharing UI
PrivacyDashboard.showDataSharingUI(apiKey: <API key>,
userId: <API key>,
baseUrlString: <>,
dataAgreementId: <Data Agreement ID>,
organisationName: <Third party application name>,
organisationLogoImageUrl: <Third party application logo>,
termsOfServiceText:<Terms of service text>,
termsOfServiceUrl: <Terms url>,
cancelButtonText: <Cancel button text>)
We can also show the privacy dashboard with accessToken
with below param
.accessToken(<accessToken>)
Note: If we have
accessToken
then no need to passAPI key
andUser ID
In response, it will return a json string as follows. Null
if the process failed
{
"id": "********************",
"dataAgreementId": "********************",
"dataAgreementRevisionId": "********************",
"dataAgreementRevisionHash": "*******************************",
"individualId": "********************",
"optIn": Boolean,
"state": "*********",
"signatureId": ""
}
Below 'configure' method should be called before api calls which doesnt have API key or access token as params.
PrivacyDashboard.configure(withApiKey: <APIKey>,
withOrgId: <OrgId>,
withBaseUrl: <BaseUrl>,
accessToken: <accessToken>)
This function is used to provide the 3PP developer to opt-in to a data agreement.
PrivacyDashboard.updateDataAgreementStatus(dataAgreementId: <Data Agreement ID>,
status: <True always>)
In response, it will return a json string as follows. Null
if the process failed
{
"id": "********************",
"dataAgreementId": "********************",
"dataAgreementRevisionId": "********************",
"dataAgreementRevisionHash": "*******************************",
"individualId": "********************",
"optIn": Boolean,
"state": "*********",
"signatureId": ""
}
This function is used to fetch the data agreement using dataAgreementId
PrivacyDashboard.readDataAgreementApi(dataAgreementId: <>) {
success, resultVal in
// Result val will be a callback
// response in dictionary format
}
To show data agreement policy, fetch the data agreement with the above API, pass the response with below api request
PrivacyDashboard.showDataAgreementPolicy(dataAgreementRecord:
<Data agreement response>)
To create individual below one is the API request
PrivacyDashboard.createAnIndividual(
name: <Optional>,
email: <Optional>,
phone: <Optional>)
{ success, resultVal in
// Result val will be a callback
// response in dictionary format
}
To fetch indivdual details
PrivacyDashboard.readAnIndividual(
individualId = <individual ID>
{ success, resultVal in
// Result val will be a callback
// response in dictionary format
}
To update individual record
PrivacyDashboard.updateAnIndividual(
individualId = <individual ID>
{ success, resultVal in
// Result val will be a callback
// response in dictionary format
}
To fetch all individual records
PrivacyDashboard.fetchAllIndividuals(
individualId = <individual ID>
{ success, resultVal in
// Result val will be a callback
// response in dictionary format
}
Feel free to improve the plugin and send us a pull request. If you find any problems, please create an issue in this repo.
Copyright (c) 2023-25 LCubed AB (iGrant.io), Sweden
Licensed under the Apache 2.0 License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LICENSE for the specific language governing permissions and limitations under the License.