Skip to Content
defold-typescript libraries
defold (official)

defold/extension-adinfo/adinfo

Provides functionality to get the advertising id and tracking status. Supported on iOS and Android.

  • GitHub: defold/extension-adinfo — pinned to 3.0.3 (released while Defold 1.13.1 was current)
    1. Pick a release from defold/extension-adinfo releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as adinfo from "adinfo"

Functions

adinfo.get(callback: function)

Get a table with advertising information. function returns nil if values do not ready

function init(self)
    adinfo.get(function(self, info)
      print(info.ad_ident, info.ad_tracking_enabled)
    end)
end

Parameters

  • callback: function — The function to call when advertising information is available. On iOS 14 and above this will trigger a tracking request popup.

On this page