public static RequestConfiguration GetRequestConfiguration() { RequestConfiguration.Builder requestConfigurationBuilder = new RequestConfiguration.Builder(); MaxAdContentRating maxAdContentRating = MaxAdContentRating.ToMaxAdContentRating(Externs.GADUGetMaxAdContentRating(requestConfigurationPtr)); IntPtr testDeviceIdsArray = Externs.GADUGetTestDeviceIdentifiers(requestConfigurationPtr); List <string> testDeviceIds = Utils.PtrArrayToManagedList(testDeviceIdsArray, Externs.GADUGetTestDeviceIdentifiersCount(requestConfigurationPtr)); TagForChildDirectedTreatment TagForChildDirectedTreatment = (TagForChildDirectedTreatment)Externs.GADUGetRequestConfigurationTagForChildDirectedTreatment(requestConfigurationPtr); TagForUnderAgeOfConsent TagForUnderAgeOfConsent = (TagForUnderAgeOfConsent)Externs.GADUGetRequestConfigurationTagForUnderAgeOfConsent(requestConfigurationPtr); requestConfigurationBuilder.SetMaxAdContentRating(maxAdContentRating); requestConfigurationBuilder.SetTestDeviceIds(testDeviceIds); requestConfigurationBuilder.SetTagForChildDirectedTreatment(TagForChildDirectedTreatment); requestConfigurationBuilder.SetTagForUnderAgeOfConsent(TagForUnderAgeOfConsent); return(requestConfigurationBuilder.build()); }
public static RequestConfiguration GetRequestConfiguration(AndroidJavaObject androidRequestConfiguration) { TagForChildDirectedTreatment TagForChildDirectedTreatment = (TagForChildDirectedTreatment)androidRequestConfiguration.Call <int>("getTagForChildDirectedTreatment"); TagForUnderAgeOfConsent TagForUnderAgeOfConsent = (TagForUnderAgeOfConsent)androidRequestConfiguration.Call <int>("getTagForUnderAgeOfConsent"); MaxAdContentRating maxAdContentRating = MaxAdContentRating.ToMaxAdContentRating(androidRequestConfiguration.Call <string>("getMaxAdContentRating")); List <string> TestDeviceIds = Utils.GetCsTypeList(androidRequestConfiguration.Call <AndroidJavaObject>("getTestDeviceIds")); RequestConfiguration.Builder builder = new RequestConfiguration.Builder(); builder = builder.SetTagForChildDirectedTreatment(TagForChildDirectedTreatment); builder = builder.SetTagForUnderAgeOfConsent(TagForUnderAgeOfConsent); builder = builder.SetMaxAdContentRating(maxAdContentRating); builder = builder.SetTestDeviceIds(TestDeviceIds); return(builder.build()); }