Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

AppInfo

class in Unity.Localization.Apple

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Stores the localized values that describe an Apple application in its property list.

These are the strings the operating system shows while the application is not running, such as the name under the icon and the permission prompts. Unity reads this object when it builds for an Apple platform, resolves each value in every enabled locale, and hands the results to the installed Apple platform support, which writes them into the generated Xcode project. Without that platform support the values cannot be written and the build says so. Each property names the property list key it holds the value for. A value is resolved once per locale, so it cannot use Smart Strings; the operating system reads the built files without Unity running. Configure it before building, and reach it through LocalizationSettings.AppleAppInfo. No property ever reads as null: assigning null stores an empty value instead, so a property can always be read and configured without a null check.

Additional resources: LocalizationSettings, AppInfo, LocalizedString

Configure the Apple application name and permission prompts before a build.

using Unity.Localization;
using Apple = Unity.Localization.Apple;

namespace Unity.Localization.Samples { public class AppleAppInfoExample { public void Run(Apple.AppInfo appInfo) { appInfo.ShortName.SetReference("App Strings", "App Short Name"); appInfo.DisplayName.SetReference("App Strings", "App Display Name"); appInfo.CameraUsageDescription.SetReference("App Strings", "Why We Need The Camera"); } } }

Properties

Property Description
CameraUsageDescription The reason the application asks for access to the camera.
DisplayName The full user-visible name of the application.
LocationUsageDescription The reason the application asks for the device location while it is in the foreground.
MicrophoneUsageDescription The reason the application asks for access to the microphone.
ShortName The short user-visible name of the application.
UserTrackingUsageDescription The reason the application asks to track the user or the device.