Example: /iOS/GoogleAds/ConsentForm

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/iOS/GoogleAds/ConsentForm


You find this example project in your Plugins Download as a Xojo project file within the examples folder: /iOS/GoogleAds/ConsentForm

This example is the version from Sun, 23th Dec 2023.

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

The items on this page are in the following plugins: MBS iOS Plugin.


💬 Ask a question or report a problem