Type Library Revision Release 2022.3683 Keywords Ads, Monetization, Apple, App Tracking Transparency Platforms iOS, tvOS
Starting with iOS14 Apple requires to request explicit permission for ad tracking. This plugin allows to show the pop up and check permission status. Make sure to add descriptive string as well.
This plugin implements what you need when Ad provider asks you to implement something like this in your native app:
ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in .... })
To use this plugin your build.settings
should contain following entries:
settings = { iphone = { plist = { NSUserTrackingUsageDescription = "This would allow the app to advertise better.", }, }, plugins = { ['plugin.att'] = { publisherId = 'com.solar2d' }, } }
local att = require( "plugin.att" )
local att = require "plugin.att" local status = att.status local statusText = display.newText( status, display.contentCenterX, display.contentCenterY*0.5, nil, 14 ) local eventText = display.newText( "tap to request", display.contentCenterX, display.contentCenterY*1.5, display.contentWidth*0.5, display.contentHeight*0.25, nil, 14 ) local function attListener(e) eventText.text = "Status is " .. tostring(e.status) end local function tapListener() att.request(attListener) end Runtime:addEventListener( "tap", tapListener)