You must initialize Pangle SDK before loading Pangle ads. This needs to be done only once, ideally at the App Launch stage (in AppDelegate method).
///Initialize Pangle SDK
{
var config = new PAGConfig.Builder()
.SetAppId("APP ID")
.SetDebugLog(true)
.Build();
}
PAGConfig.Builder | Description |
-PAGConfig.Builder setChildDirected(PAGChildDirectedType childDirected) | Set the configuration of COPPA, 0:adult, 1:child |
-PAGConfig.Builder SetGDPRConsent(PAGGDPRConsentType DPRConsent) | Set the configuration of GDPR, 0:User doesn't grant consent, 1: User has granted the consent |
-PAGConfig.Builder SetDoNotSell(PAGDoNotSellType ccpa) | Set the configuration of CCPA, 0: "sale" of personal information is permitted, 1: user has opted out of "sale" of personal information |
-PAGConfig.Builder SetAppId(string appId) | Set the APP ID |
-PAGConfig.Builder SetAppIconName(string appIconId) | If you use the format of Open Ad, you should set the app's icon |
-PAGConfig.Builder SetSupportMultiProcess(bool supportMultiProcess) | If your app is a multi-process app, set this value to true. |
-PAGConfig.Builder SetPackageName(string packageName) | If you use the AAB function and configure the SDK to the feature module, you need to set the package name of the feature module |
-PAGConfig.Builder SetDebugLog(bool debugLog) | Set whether to open log debugging |
xxxxxxxxxx
PAGSdk.OnInitFinish += (result, code, message) =>
{
//result means the result of SDK initilization statues,true means success,false means fail
Debug.Log($"result = {result}, error code = {code}, message = {message}");
};
If you want to change the value of COPPA/GDPR/CCPA after initializing Pangle SDK, you can call the following method, as shown below:
xxxxxxxxxx
PAGConfig.setChildDirected(PAGConstant.PAGChildDirecoptedTypae.PAG_CHILD_DIRECTED_TYPE_CHILD);//Set the configuration of COPPA
PAGConfig.getChildDirected()//get the value of coppa
PAGConfig.setGDPRConsent(PAGConstant gd.PAGGDPRConsentTypre.PAG_GDPR_CONSENT_TYPE_CONSENT);//Set the configuration of GDPR
PAGConfig.getGDPRConsent()//get the value of GDPR
PAGConfig.setDoNotSell(PAGConst ccant.PAGDoNotSellTypae.PAG_DO_NOT_SELL_TYPE_NOT_SELL);//Set the configuration of CCPA
PAGConfig.getDoNotSell()//get the value of CCPA
The meaning of PAGConstant value
COPPA
//child
PAGConstant.PAGChildDirectedType.PAG_CHILD_DIRECTED_TYPE_CHILD
//adult
PAGConstant.PAGChildDirectedType.PAG_CHILD_DIRECTED_TYPE_NON_CHILD
GDPR
//User doesn't grant consent
PAGConstant.PAGGDPRConsentTypre.PAG_GDPR_CONSENT_TYPE_NO_CONSENT
//User has granted the consent
PAGConstant.PAGGDPRConsentTypre.PAG_GDPR_CONSENT_TYPE_CONSENT
CCPA
//"sale" of personal information is permitted
PAGConstant.PAGDoNotSellTypae.PAG_DO_NOT_SELL_TYPE_SELL
//user has opted out of "sale" of personal information
PAGConstant.PAGDoNotSellTypae.PAG_DO_NOT_SELL_TYPE_NOT_SELL
You also could check the initialization status with the method PAGSdk.isInitSuccess()
xxxxxxxxxx
string version = PAGSdk.GetSDKVersion()//get SDK's version
bool isInitSuccess = PAGSdk.IsInitSuccess()//check the initialization status