Migration To SDK v6
info
Apply these mandatory changes while updating the SDK from 5.x to 6.x
Changes in GFPAdParam & GFPUserParam added.
User targeting parameters are moved from GFPAdParam to GFPUserParam. GFPAdParam is needed to be set on every ad request. Meanwhile, GFPUserParam is applied in GFPAdManager which is shared instance.
GFPAdParam Before
- Objective-C
- Swift
GFPAdParam *adParam = [[GFPAdParam alloc] init];
adParam.gender = GFPAdParamGenderTypeFemale;
adParam.yearOfBirth = 1995;
adParam.userCountryCode = @"KR";
adParam.userID = @"abcd";
let adParam = GFPAdParam()
adParam.gender = .female
adParam.yearOfBirth = 1995
adParam.userCountryCode = "KR"
adParam.userID = "abcd"
GFPUserParam Now
- Objective-C
- Swift
GFPUserParam *userParam;
GFPUserParam *userParam;
if (GFPAdManager.userParam != nil) {
userParam = GFPAdManager.userParam;
} else {
userParam = [[GFPUserParam alloc] init];
}
userParam.gender = GFPUserParamGenderTypeFemale;
userParam.yearOfBirth = 1995;
userParam.userCountryCode = @"KR";
userParam.userID = @"abcd";
[GFPAdManager setUserParam: userParam];
let userParam = GFPAdManager.userParam() ?? GFPUserParam()
userParam.gender = .female
userParam.yearOfBirth = 1995
userParam.userCountryCode = "KR"
userParam.userID = "abcd"
GFPAdManager.setUserParam(userParam)