This plugin presents the app-tracking authorization request dialog and get the tracking authorization status.
This is a plugin for Unreal Engine 4.
https://www.unrealengine.com/marketplace/ja/product/e8a0a0ed3f4b45e4b43723cf8e243735
You Must to follow the steps below.
- Install this plugin by Epic Games Launcher.
- Copy this plugin ("EpicGames/UE_4.26/Engine/Plugins/Marketplace/ATTPR") to your project plugins folder("Your_project_folder/Plugins").
- Uninstall this plugin by Epic Games Launcher.
- Open your project(Must be C++ project) and build for iOS on UE4.
-
Must be enrolled in the Apple Developer Program.
-
Download and install the latest version Xcode on your Mac.
-
Register your App to the Apple Developer site.
-
Create the mobile provisioning file.
-
The mobile provisioning file download and install on your Mac.
-
If you have multiple versions of Xcode installed, must select the Xcode 12 or later.
You see the selected Xcode version: 'Xcode > Preferences... > Locations > Command Line Tools' from the Xcode menu.
-
Update the project settings of your game on UE4.
Project > Packaging: Decide whether to select 'For Distribution'
Platforms > iOS: Slecet 'Mobile Provision' and set 'Bundle Information'.
-
To build the project, select 'File> Package Project> iOS' from the menu.
You see which the version of Xcode building the project in the output logs following.
ATHelper: Packaging (iOS): Compiling with non-standard Xcode (xcode-select): /Applications/Xcode12.4.app/Contents/Developer/
UATHelper: Packaging (iOS): Compiling with iPhoneOS SDK 14.4
ERROR: Unable to instantiate module 'ATTPR': System.FormatException: Input string was not in a correct format.
If you already installed command line tools, please try to comment out the following code. The xcrun installation path may not be "/usr/bin".
Plugins/ATTPR/Source/ATTPR/ATTRP.Build.cs
// string SDKVersionString = Utils.RunLocalProcessAndReturnStdOut("/usr/bin/xcrun", "--sdk iphoneos --show-sdk-version");
// float SDKVersion = float.Parse(SDKVersionString);
// if(SDKVersion >= 14f)
- Windows
- Mac
- iOS
The behaviour on the platforms below is the tracking authorization status is always "Not Determind" and the App Tracking Transparency Dialog is not presented.
- Win64
- Mac
- Android
・"GetTrackingAuthorizationStatus" is gets the current status of the app-tracking authorization.
・"RequestTrackingAuthorization" is presents the app-tracking authorization request dialog only the first time.
・You can customize the dialog message text.
The example project is under the "AttPermissionRequest" folder in this GitHub repository.
Put the "ATTPR" plugin into the plugins folder ("AttPermissionRequest/Plugins/ATTPR").
Enable this plugin.
"Mobile Provision" and "Bundle Identifier" must be set for builds for iOS.
(Project Settings > Platforms > iOS)
・Call "RequestTrackingAuthorizationResult" then presents the app-tracking authorization request dialog on iOS 14.5 or later.(Does not present the dialog on other platforms.)
-
After iOS14
return ATTrackingManager.trackingAuthorizationStatus;
Not Determind
Restricted
Denied
Authorized -
Before iOS13
[[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled];
If the return value is
true: Authorized
false: Denied