Platforms to show: All Mac Windows Linux Cross-Platform
Last modified Sun, 23th Dec 2023.
You find this example project in your MBS Xojo Plugin download as a Xojo project file within the examples folder: /iOS/GoogleAds/ConsentForm
Download this example: ConsentForm.zip
Project "ConsentForm.xojo_binary_project"
Class App Inherits MobileApplication
End Class
Class MainScreen Inherits MobileScreen
Control VersionLabel Inherits MobileLabel
ControlInstance VersionLabel Inherits MobileLabel
Constraint Constraint 1
Constraint Constraint 2
Constraint Constraint 3
Constraint Constraint 4
End Control
Control Button1 Inherits MobileButton
ControlInstance Button1 Inherits MobileButton
Constraint Constraint 1
Constraint Constraint 2
Constraint Constraint 3
Constraint Constraint 4
EventHandler Sub Pressed()
requestConsentInfoUpdate
End EventHandler
End Control
Control Button2 Inherits MobileButton
ControlInstance Button2 Inherits MobileButton
Constraint Constraint 1
Constraint Constraint 2
Constraint Constraint 3
Constraint Constraint 4
EventHandler Sub Pressed()
loadConsentForm
End EventHandler
End Control
Control StatusLabel Inherits MobileLabel
ControlInstance StatusLabel Inherits MobileLabel
Constraint Constraint 1
Constraint Constraint 2
Constraint Constraint 3
Constraint Constraint 4
End Control
EventHandler Sub Opening()
VersionLabel.Text = "SDK Version: " + UMPConsentFormMBS.VersionString
UpdateConsentStatus
End EventHandler
Sub ConsentFormLoaded(consentForm as UMPConsentFormMBS, Error as NSErrorMBS)
System.DebugLog CurrentMethodName
Self.consentForm = consentForm
If Error <> Nil Then
MessageBox "Failed: "+Error.LocalizedDescription
Else
dim viewController as UIViewControllerMBS = UIViewControllerMBS.currentViewController
consentForm.presentFromViewController viewController, AddressOf ConsentFormPresentCompleted
End If
End Sub
Sub ConsentFormPresentCompleted(Error as NSErrorMBS)
System.DebugLog CurrentMethodName
UpdateConsentStatus
If Error <> Nil Then
MessageBox "Failed: "+Error.LocalizedDescription
Else
MessageBox "Consent Form Completed"
End If
End Sub
Sub UpdateConsentStatus()
System.DebugLog CurrentMethodName
Dim consentInformation As UMPConsentInformationMBS = UMPConsentInformationMBS.sharedInstance
Dim consentStatus As Integer = consentInformation.consentStatus
Dim formStatus As Integer = consentInformation.formStatus
Dim consentStatusText As String
Dim formStatusText As String
Select Case consentStatus
Case UMPConsentInformationMBS.ConsentStatusNotRequired
consentStatusText = "ConsentStatusNotRequired"
Case UMPConsentInformationMBS.ConsentStatusObtained
consentStatusText = "ConsentStatusObtained"
Case UMPConsentInformationMBS.ConsentStatusRequired
consentStatusText = "ConsentStatusRequired"
Case UMPConsentInformationMBS.ConsentStatusUnknown
consentStatusText = "ConsentStatusUnknown"
End Select
Select Case formStatus
Case UMPConsentInformationMBS.FormStatusAvailable
formStatusText = "FormStatusAvailable"
Case UMPConsentInformationMBS.FormStatusUnavailable
formStatusText = "FormStatusUnavailable"
Case UMPConsentInformationMBS.FormStatusUnknown
formStatusText = "FormStatusUnknown"
End Select
StatusLabel.Text = consentStatusText + " " + formStatusText
End Sub
Sub loadConsentForm()
System.DebugLog CurrentMethodName
UMPConsentFormMBS.load(AddressOf ConsentFormLoaded)
End Sub
Sub requestConsentInfoUpdate()
System.DebugLog CurrentMethodName
// test for Europe Economic Area
Dim debug As New UMPDebugSettingsMBS
debug.geography = debug.DebugGeographyEEA
Dim param As New UMPRequestParametersMBS
param.debugSettings = debug
param.tagForUnderAgeOfConsent = True
UMPConsentInformationMBS.sharedInstance.requestConsentInfoUpdateWithParameters param
End Sub
Property consentForm As UMPConsentFormMBS
End Class
Class LaunchScreen Inherits MobileScreen
End Class
Sign
End Sign
Sign
End Sign
ExternalFile Info
End ExternalFile
End Project
Download this example: ConsentForm.zip
The items on this page are in the following plugins: MBS iOS Plugin.