prebid / prebid-mobile-ios

Prebid Mobile SDK for iOS applications
Apache License 2.0
48 stars 93 forks source link

Prebid SDK support for SharedID #1057

Open bretg opened 1 month ago

bretg commented 1 month ago

As more of the ecosystem supports SharedID, it's time to consider adding support for it to PBSDK.

Proposal:

  1. Create a way for app developers to opt into having Prebid SDK generate a shared ID. e.g. Prebid global class function createSharedId()
  2. This function would need to check for permission:
    1. If LimitAdTracking (LMT) is set, there's no permission. Remove any previously stored SharedID value.
    2. If GDPR is in scope and there's not Purpose 1 consent, remove any previously stored SharedID value. See https://github.com/prebid/prebid-mobile-ios/issues/375, involving gdprApplies and deviceAccessConsent.
    3. On iOS, if ATTS is other than 3, remove any previously stored SharedID value.
  3. If allowed to create SharedID and it doesn't already exist in device local storage, generate a UUID as per generateUUID in https://github.com/prebid/Prebid.js/blob/master/src/utils.js and stored it.
  4. When building the ORTB, check device local storage and append the following ORTB object to the user.eids array:
{
  "source": "pubcid.org",
   "uids": [{
            "id": 'SHAREDID_VALUE',
            "atype": 1
        }]
}