adobe / aepsdk-edgeconsent-ios Goto Github PK
View Code? Open in Web Editor NEWAdobe Experience Platform Consent mobile extension for Adobe Edge Network in Swift
License: Apache License 2.0
Adobe Experience Platform Consent mobile extension for Adobe Edge Network in Swift
License: Apache License 2.0
Merge changes to staging and update test targets to point to staging for other Edge dependencies
#if os(iOS)
once we have tvOS supported stable branchRelease tvOS target
Update docs: current sdk versions, release notes
The existing functional tests should be refactored to use the newly available common test utilities available in: https://github.com/adobe/aepsdk-testutils-ios
With the following items covered:
No response
The Consent extension will need two APIs:
getConsents
setConsent:
ConsentType
This type will represent all possible consents that the user can manually update. In the beginning, the only consent type to be available through the API will be the collect
consent type. However, as more consent types are created, we can add additional consent types.
public enum ConsentType {
case collect
}
Note: This is a stripped-down definition. The actual definition will be modified to support Objective-C.
ConsentStatus
This type represents all the possible statuses for a given consent. This will be limited to "yes" and "no".
public enum ConsentStatus {
case yes
case no
}
Note: This is a stripped-down definition. The actual definition will be modified to support Objective-C.
This API allows for customers to fetch the current consent statues stored by the Consent extension.
/// Returns a dictionary containing all the consents and their current statues
/// - Parameter completion: invoked with a dictionary containing the consent type mapped to the current consent status
static func getConsents(completion: @escaping ([ConsentType: ConsentStatus]?, Error?) -> Void)
/// Returns a dictionary containing all the consents and their current statues
/// - Parameter completion: invoked with a dictionary containing the consent type mapped to the current consent status
@available (*, unavailable) // only expose this API to Obj-C
static func getConsents(completion: @escaping ([String: String]?, Error?) -> Void)
Consent.getConsents { (consents, error) in
// check error, handle consents
guard error == nil else { return }
let collectConsent = consents[.collect]
}
This API returns a dictionary of consents mapped to their corresponding status. This makes it easy for a customer to look up a status for a given consent quickly.
There is one catch... we are not able to bridge a dictionary that contains enums to Objective-C. In the API definition, we have a dictionary where the keys and values are enums, [ConsentType: ConsentStatus]
. The workaround is to provide an API only available in Objective-C which instead returns a dictionary of type [String: String]
. Where the keys are a string representation of the consent type and status. For example @{"collect": "yes"}
.
[AEPConsent getConsents:^(NSDictionary<NSString *,NSString *> * _Nullable consents, NSError * _Nullable error) {
if (error != nil) { return; }
NSString *consentStatus = consents[@"collect"];
}];
This API allows customers to set/update a given consent with a consent status. This API will either override the current status for a consent or set it for the first time.
/// Updates a given `ConsentType` to a `ConsentStatus`
/// - Parameters:
/// - type: the `ConsentType` to be updated
/// - status: the `ConsentStatus` for `type`
@objc(setConsent:status:)
static func setConsent(type: ConsentType, status: ConsentStatus)
// set collect to yes
Consent.setConsent(type: .collect, status: .yes)
// set collect to no
Consent.setConsent(type: .collect, status: .no)
// set collect to yes
[AEPConsent setConsent:AEPConsentTypeCollect status:AEPConsentStatusYes];
// set collect to no
[AEPConsent setConsent:AEPConsentTypeCollect status:AEPConsentStatusNo];
The iOS Consent for Edge Network extension repo should also have public documentation in line with the Android version:
https://github.com/adobe/aepsdk-edgeconsent-android/tree/main/Documentation (and other Edge repos)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.