Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Accessing User GDPR Settings in AIR
Michael
Michael

Posted on

     

Accessing User GDPR Settings in AIR

At some point in your application development when you start to store and share data you will need to handle user GDPR settings.

The General Data Protection Regulation (GDPR) is a European Union (EU) regulation that mandates how an organisation should handle personal data.

If you use personalised advertising or store user related data on your server then you will need to address GDPR concerns in your application.

On mobile devices the GDPR settings are stored through theIAB Europe Transparency & Consent Framework. This framework ensures settings are stored in consistent places for developers to access and determine their appropriate behaviour for the user.

These values are stored inNSUserDefaults on iOS and inSharedPreferences on Android.

With the AIR SDK we can access these values easily through theApplication extension. The Application extension allows access to the NSUserDefaults and the SharedPreferences through thedefaults functionality.

Firstly, we set theuseSharedDefaults flag to ensure we use the application's shared values.

Application.service.defaults.useSharedDefaults=true;
Enter fullscreen modeExit fullscreen mode

If we don't set this flag, then the values retrieved through thedefaults functionality will be isolated from values set via other methods and you won't retrieve the correct TC data values.

Once you have set this flag you can retrieve any of the TC data from the framework by using the appropriate key.

For example:

varvalue:String=Application.service.defaults.getString("IABTCF_TCString");
Enter fullscreen modeExit fullscreen mode

You can then use this value as required for your implementation of GDPR in your application.

For a full list of the available keys and a description of the values and types see thedocumentation here.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Location
    Australia
  • Work
    Director at distriqt
  • Joined

More fromMichael

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp