Skip to content

Commit

Permalink
Merge pull request #184 from decentralised-dataexchange/feature/183-R…
Browse files Browse the repository at this point in the history
…emove-all-expose-IDs-from-cocoapod-sample
  • Loading branch information
georgepadayatti authored Nov 20, 2023
2 parents 04397da + 22b04eb commit 85ef1f6
Showing 1 changed file with 35 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,67 +16,57 @@ class ViewController: UIViewController {
}

override func viewDidAppear(_ animated: Bool) {
// 1. For showing Privacy Dashboard
PrivacyDashboard.showPrivacyDashboard(withApiKey: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTY29wZXMiOlsic2VydmljZSJdLCJPcmdhbmlzYXRpb25JZCI6IjY1MjY1Nzk2OTM4MGYzNWZhMWMzMDI0NSIsIk9yZ2FuaXNhdGlvbkFkbWluSWQiOiI2NTI2NTc5NjkzODBmMzVmYTFjMzAyNDMiLCJleHAiOjE3MDA3MjkxOTF9.2rkHNiLDjQi8WOy4CWn96sMBx8KkvFCUMU0Xe6oXNbY",
withUserId: "6556f6cc617a19d996bd80a7",
withOrgId: "64f09f778e5f3800014a879a",
withBaseUrl: "https://staging-consent-bb-api.igrant.io/v2",
withLocale: "en",
turnOnAskme: false,
turnOnUserRequest: false,
turnOnAttributeDetail: false)
// 1. For showing Privacy Dashboard
// PrivacyDashboard.showPrivacyDashboard(withApiKey: <API Key>,
// withUserId: <User ID>,
// withOrgId: <Organisation ID>,
// withBaseUrl: <Base Url>,
// withLocale: "en",
// turnOnAskme: false,
// turnOnUserRequest: false,
// turnOnAttributeDetail: false)

// 2. For showing Data sharing UI
// PrivacyDashboard.showDataSharingUI(apiKey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTY29wZXMiOlsic2VydmljZSJdLCJPcmdhbmlzYXRpb25JZCI6IjY1MjY1Nzk2OTM4MGYzNWZhMWMzMDI0NSIsIk9yZ2FuaXNhdGlvbkFkbWluSWQiOiI2NTI2NTc5NjkzODBmMzVmYTFjMzAyNDMiLCJleHAiOjE3MDA3MjkxOTF9.2rkHNiLDjQi8WOy4CWn96sMBx8KkvFCUMU0Xe6oXNbY",
// userId: "65378403b3f442eb9381b38d",
// baseUrlString: "https://staging-consent-bb-api.igrant.io/v2",
// dataAgreementId: "65522d05b792e39cff5cab2c",
// organisationName: "My company",
// organisationLogoImageUrl: "https://www.kasandbox.org/programming-images/avatars/old-spice-man-blue.png",
// termsOfServiceText: "Terms of service.",
// termsOfServiceUrl: "http://google.com",
// cancelButtonText: "Cancel")
// PrivacyDashboard.showDataSharingUI(apiKey: <API Key >,
// userId: <User ID>,
// baseUrlString: <Base Url>,
// dataAgreementId: <Data agreement ID>,
// organisationName: "My company",
// organisationLogoImageUrl: <Logo image Url>,
// termsOfServiceText: "Terms of service.",
// termsOfServiceUrl: <Terms of service Url>,
// cancelButtonText: "Cancel")


// 3. Call back method to receive response back
PrivacyDashboard.receiveDataBackFromPrivacyDashboard = { data in
debugPrint("Data receieved here:\(data)")
}
// 3. Call back method to receive response back
// PrivacyDashboard.receiveDataBackFromPrivacyDashboard = { data in
// debugPrint("Data receieved here:\(data)")
// }


// 4. Setting API configuring params
// PrivacyDashboard.configure(withApiKey: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTY29wZXMiOlsic2VydmljZSJdLCJPcmdhbmlzYXRpb25JZCI6IjY1MjY1Nzk2OTM4MGYzNWZhMWMzMDI0NSIsIk9yZ2FuaXNhdGlvbkFkbWluSWQiOiI2NTI2NTc5NjkzODBmMzVmYTFjMzAyNDMiLCJleHAiOjE3MDA3MjkxOTF9.2rkHNiLDjQi8WOy4CWn96sMBx8KkvFCUMU0Xe6oXNbY", withUserId: "65378403b3f442eb9381b38d", withOrgId: "64f09f778e5f3800014a879a", withBaseUrl: "https://staging-consent-bb-api.igrant.io/v2")
// PrivacyDashboard.configure(withApiKey: <API Key >,
// withUserId: <User ID>,
// withOrgId: <Organisation ID>,
// withBaseUrl: <Base Url>)


// 5. Update Data agreement
// PrivacyDashboard.updateDataAgreementStatus(dataAgreementId: "6551c9ba7654351e98a58734", status: true)
// PrivacyDashboard.updateDataAgreementStatus(dataAgreementId: <Data agreement ID>,
// status: true)

// 6. Individual related API calls
// PrivacyDashboard.fetchAllIndividuals { success, resultVal in
// debugPrint(resultVal)
// }
// PrivacyDashboard.fetchAllIndividuals { success, resultVal in
// debugPrint(resultVal)
// }

// 7. Open Data agreement policy UI
// PrivacyDashboard.showDataAgreementPolicy(dataAgreementRecord: dict)
// PrivacyDashboard.showDataAgreementPolicy(dataAgreementRecord: <JSON data of "dataAgreement" response>)

// 8. Read data agreement
// PrivacyDashboard.readDataAgreementApi(dataAgreementId: "65539173ed8be121fe2a59af") { success, resultVal in
// print(resultVal)
// let dict = resultVal["dataAgreement"] as? [String: Any]
// if let theJSONData = try? JSONSerialization.data(withJSONObject: dict ?? [:], options: .prettyPrinted),
// let theJSONText = String(data: theJSONData, encoding: String.Encoding.ascii) {
// if let json = theJSONText.data(using: String.Encoding.utf8) {
// if let jsonData = try? JSONSerialization.jsonObject(with: json, options: .allowFragments) as? [String:AnyObject] {
// PrivacyDashboard.showDataAgreementPolicy(dataAgreementDic: jsonData)
// }
// }
// }
// }

// 8. Read data agreement
// PrivacyDashboard.readDataAgreementApi(dataAgreementId: "65535cad70eaa866249023d4") { success, resultVal in
// print(resultVal)
// }
// PrivacyDashboard.readDataAgreementApi(dataAgreementId: <Organisation ID>) { success, resultVal in
// print(resultVal)
// }

}

Expand Down

0 comments on commit 85ef1f6

Please sign in to comment.