If your app will have European Union users, it should comply with the General Data Protection Regulation (GDPR). This means you need to ask for the user’s consent before collecting their private data.

The HyBid SDK is GDPR compliant, however, a few steps are necessary to collect the user’s consent and therefore provide a more personalized ad experience, therefore, higher payouts.

Initialization Overview

Upon initialization, the SDK follows this flow:

  1. Initialize the SDK using the app token.
  2. Check the location from where the user is connected using the IP address and an external service (ip-api.com).
  3. If the country the app is connecting from is inside the GDPR jurisdiction zone, then set a flag that defines that the SDK needs user consent before keeping the data.
  4. Execute initialization callback to notify that initialization happened successfully.

The consent dialog will not show if you attempt to call it for a user that PubNative has determined is outside of the European Economic Area, the United Kingdom, or Switzerland. Please keep this in mind when testing outside of those regions. You have 2 options for getting the consent from your users: PubNative Owned and Publisher Owned.

For both of the options, do not forget to import HyBid into your class.

import HyBid
#import <HyBid/HyBid.h>

PubNative Owned Consent

This way to request displays a screen included in the HyBid SDK which shows PubNative’s consent page and allows users to opt-in or opt-out.

Once the screen is showed and the user interacts with it, the SDK itself handles the responses of the user and notifies the PubNative server if the user opted in or out regarding the processing of their data.

  1. Check if you should show the consent dialog:
HyBidUserDataManager.sharedInstance().shouldAskConsent()
[[HyBidUserDataManager sharedInstance] shouldAskConsent];
  1. Depending on the return value for shouldAskConsent, start loading the consent request screen:
HyBidUserDataManager.sharedInstance().loadConsentPage(completion: { (loadError) in
           // ...
        })
[[HyBidUserDataManager sharedInstance] loadConsentPageWithCompletion:^(NSError * _Nullable error) {
        // ...
    }];
  1. In loadConsentPageWithCompletion’s completion block, show the consent dialog that the SDK has prepared for you.
HyBidUserDataManager.sharedInstance().loadConsentPage(completion: { (loadError) in
            if (loadError == nil) {
                HyBidUserDataManager.sharedInstance()?.showConsentPage({
                    // Consent Page Did Show Completion Block..
                }, didDismiss: {
                    // Consent Page Did Dismiss Completion Block..
                })
            }
        })
[[HyBidUserDataManager sharedInstance] loadConsentPageWithCompletion:^(NSError * _Nullable error) {
        if (error == nil) {
            [[HyBidUserDataManager sharedInstance] showConsentPage:^{
                // Consent Page Did Show Completion Block..
            } didDismiss:^{
                // Consent Page Did Dismiss Completion Block..
            }];
        }
    }];

If you choose to show the consent page at some point in the future, check if it is ready via isConsentPageLoaded before showing it.

Publisher Owned Consent

If you implement your own mechanism to collect consent in your app, then you need to user PubNative’s vendor list and privacy policy to obtain consent on their behalf.

  1. Check if you should show the consent dialog:
HyBidUserDataManager.sharedInstance().shouldAskConsent()
[[HyBidUserDataManager sharedInstance] shouldAskConsent];
  1. Get the current vendor list link:
HyBidUserDataManager.sharedInstance().vendorListLink()
[[HyBidUserDataManager sharedInstance] vendorListLink];
  1. Get the privacy policy link:
HyBidUserDataManager.sharedInstance().privacyPolicyLink()
[[HyBidUserDataManager sharedInstance] privacyPolicyLink];
  1. Then, depending on whether the user has given consent, call one of the below methods to let the HyBid SDK know:
// Call this to let PubNative know the user has granted consent
HyBidUserDataManager.sharedInstance().grantConsent()

// Call this to let PubNative know the user has revoked consent
HyBidUserDataManager.sharedInstance().denyConsent()
// Call this to let PubNative know the user has granted consent
[[HyBidUserDataManager sharedInstance] grantConsent];

// Call this to let PubNative know the user has revoked consent
[[HyBidUserDataManager sharedInstance] denyConsent];

Check if data can be collected

The method canCollectData from HyBidUserDataManager can be used to determine if the SDK can collect user data. It will return YES if the user is outside the European Union or if he gave consent for data collection previously, otherwise it will return NO.

HyBidUserDataManager.sharedInstance().canCollectData()
[[HyBidUserDataManager sharedInstance] canCollectData];

Note:

Keep in mind that for the two mechanisms (PubNative Owned & Publisher Owned consents), the user consent is based on their Advertising ID. If the user chooses to reset their IDFA on their phone, then the HyBid SDK will consider it as a new data subject and will need to require consent again.