Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Moved Readme file to parent folder #237

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 0 additions & 189 deletions PrivacyDashboardiOS/README.md

This file was deleted.

165 changes: 165 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,171 @@ This repository hosts source code for the reference implementation of the GovSta

Released. Refer to the [wiki page](https://github.com/decentralised-dataexchange/bb-consent-docs/wiki/wps-and-deliverables) for the latest status of the deliverables.

## 1. iOS Configuration
[PrivacyDashboardiOS](https://cocoapods.org/pods/PrivacyDashboardiOS#about) is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile after all [pod set up](https://guides.cocoapods.org/using/getting-started.html) done:

```ruby
pod 'PrivacyDashboardiOS','2023.11.10'
```
## 2. iOS Integration

Import PrivacyDashboard SDK
```
#import PrivacyDashboardiOS
```
#### Privacy Dashboard

We can initiate the privacy dashboard by calling:
```
PrivacyDashboard.showPrivacyDashboard(withApiKey: <apiKey>,
withUserId: <userId>,
withOrgId: <orgId>,
withBaseUrl: <baseUrl>,
turnOnAskme: <Bool>,
turnOnUserRequest: <Bool>,
turnOnAttributeDetail: <Bool>)
```
We can also show the privacy dashboard with `accessToken` (optional parameter).
> **_Note:_** If we have `accessToken` then no need to pass `API key` and `User 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
```
#### Data Sharing UI
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 pass `API key` and `User 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": ""
}
```
#### Configuring API key or Access token
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>)
```
#### Opt-in to Data Agreement
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": ""
}
```
#### Fetch Data Agreement
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
}
```
#### Show data agreement policy
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>)
```

#### Individual Functions
##### To Create an Individual
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 an Individual
To fetch indivdual details
```
PrivacyDashboard.readAnIndividual(
individualId = <individual ID>
{ success, resultVal in
// Result val will be a callback
// response in dictionary format
}
```
##### To update an Individual
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 individuals
To fetch all individual records
```
PrivacyDashboard.fetchAllIndividuals(
individualId = <individual ID>
{ success, resultVal in
// Result val will be a callback
// response in dictionary format
}
```

## Other resources

* Wiki - https://github.com/decentralised-dataexchange/consent-dev-docs/wiki
Expand Down
Loading