【发布时间】:2019-05-09 13:04:33
【问题描述】:
此代码中未使用变量“状态”。因此我无法检查用户的同意选择。
我必须在默认值中存储“状态数组”。一旦当前状态在数组中可用,它将不会显示该同意书。如果没有,那么我们将显示表单并将该状态添加到默认状态数组中。
现在我无法检查用户的同意选择,并且每次加载应用时都会加载表单。
这可能会解决问题,但我不知道如何在代码中做到这一点。有什么建议?
// Load Form
[form loadWithCompletionHandler:^(NSError *_Nullable error) {
NSLog(@"Load complete. Error: %@", error);
if (error) {
// Handle error.
} else {
// Load successful.
[form presentFromViewController:self
dismissCompletion:^(NSError *_Nullable error, BOOL userPrefersAdFree) {
if (error) {
// Handle error.
} else if (userPrefersAdFree) {
// The user prefers to use a paid version of the app.
} else {
// Check the user's consent choice.
PACConsentStatus status =
PACConsentInformation.sharedInstance.consentStatus;
// store status array in defaults
// once current status is available in array we will not show that form
// if not then we will show form and add that status in defaults status array
//Storing publisher managed consent
PACConsentInformation.sharedInstance.consentStatus = PACConsentStatusPersonalized;
}
}];
【问题讨论】:
标签: ios nsuserdefaults userdefaults cookieconsent admob-cookieconsent