MAS Knowledge Base

MAS Knowledge Base

Docy

Privacy Dialog

Prerequisites

  1. Make sure MAS SDK is imported and configured in your project before starting the integration..
  2. Make sure that TextMeshPro package is imported to the project. If “TMP Essential resources” are not imported to the project, this has to be done by selecting “Window -> TextMeshPro -> Import TMP Essential Resources” from the Unity Editor menu.

1. Download

The latest version is available here.

2. Integrate

  • Open Unity project and import the Unity package. Double click on the compressed package icon. The files will populate automatically as illustrated below.
  • The following file structure in the project view can be seen after successfully importing the plugin.

3. Initialize

Make sure you remove the built-in privacy dialog and initialization codes, then use the following code to initialize the plugin.

				
					Yodo1.MAS.PrivacyPolicy.Yodo1PrivacyPolicy.ShowPrivacyPopUp((userAge) =>
{
    bool isCoppaChild = (userAge < 13);
    bool userConsent = (userAge >= 16);
    bool doNotSell = (userAge < 16);
    
    Yodo1.MAS.Yodo1U3dMas.SetCOPPA(isCoppaChild);
    Yodo1.MAS.Yodo1U3dMas.SetGDPR(userConsent);
    Yodo1.MAS.Yodo1U3dMas.SetCCPA(doNotSell);
    
    Yodo1.MAS.Yodo1U3dMas.InitializeMasSdk();
});
				
			

4. Customize

The privacy dialog plugin provides an option to change multiple configurations of the built-in privacy dialog.

4.1 Layout and languages

This can be done by selecting the option “Yodo1” -> “PrivacyDialog” -> “Privacy Config” from Unity editor menu. This will display the PrivacyPopUpConfig settings in the inspector.

Now you can change the dialog colors and edit the translations.

The privacy dialog plugin supports multiple languages: English, German, Spanish, French, Italian, Japanese, Korean, Portuguese, Russian, Chinese and Chinese Traditional. The language changes based on the user’s operating system language settings. The translations can be edited.

Key Description
Language The Language of contents in the privacy policy pop up to be displayed in Unity Editor.
EditEnglishText Whether the text contents in English Language has to be edited or not.
EditGermanText Whether the text contents in German Language has to be edited or not.
EditSpanishText Whether the text contents in Spanish Language has to be edited or not.
EditFrenchText Whether the text contents in French Language has to be edited or not.
EditItalianText Whether the text contents in Italian Language has to be edited or not.
EditJapaneseText Whether the text contents in Japanese Language has to be edited or not.
EditKoreanText Whether the text contents in Korean Language has to be edited or not.
EditPortugueseText Whether the text contents in Portuguese Language has to be edited or not.
EditRussianText Whether the text contents in Russian Language has to be edited or not.
EditChineseText Whether the text contents in Chinese Language has to be edited or not.
EditChineseTraditionalText Whether the text contents in Chinese Traditional Language has to be edited or not.
Titletext The title text of the privacy policy pop up.
AgeText The text the comes after the age provided by user, for eg:- 30 Year(s) old
LabelText1 The text to ask the user of their age in the pop up
LabelText2 The text to inform user that they agree to the privacy policy and user agreement
UserAgreementText The “UserAgreement” text to be highlighted
PrivacyPolicyText The “PrivacyPolicy” text to be highlighted
ButtonText The text to be displayed inside the button, for eg:- I Agree
Age Warning Text The text to be displayed when user haven’t selected the Age
EnableCustomizedColors Option to enable changing the colors of different components of privacy policy pop up
PrivacyPolicyLink The webpage link when the user clicks PrivacyPolicyText
TermOfServiceLink The webpage link when the user clicks UserAgreementText

4.2 Update the text size and color

This can be done by selecting the option “Yodo1” -> “PrivacyDialog” -> “Edit Privacy Pop Up Prefab” from Unity editor menu. This will display the prefab in the scene view. This prefab can be edited just like any other prefab in Unity editor. Any customizations like changing the font size, color… can be done in the prefab.

4.3 Clear the preferences

The privacy Dialog can be viewed again in Unity Editor in the next play mode even after clicking “I Agree” button by selecting the option “Yodo1” -> “PrivacyDialog” -> “Clear Privacy Plugin Prefs” from Unity editor menu.

5. Font settings

The Atlas Population Mode of Generation Settings of each font in the path “Assets/Yodo1/MAS/PrivacyDialog/Font” needs to be set to static before taking final production build. This step is mandatory to not increase the apk or ipa file size. If this option is set to dynamic, the base font asset will be included in the build and the build size will increase.

CONTENTS