Skip to content

Commit

Permalink
Merge pull request #345 from viktor-yoc/patch-1
Browse files Browse the repository at this point in the history
Default value for getting int in mPreferences.getInt() set to 0
  • Loading branch information
lamrowena authored Nov 8, 2023
2 parents 4657e0f + 3ab383f commit af2930b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TCFv2/IAB Tech Lab - CMP API v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ The TC data values can be retrieved from the application Shared Preferences by k
Context mContext = getApplicationContext();
SharedPreferences mPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
String consentString = mPreferences.getString("IABTCF_TCString", "");
int gdprApplies = mPreferences.getInt("IABTCF_gdprApplies", "");
int gdprApplies = mPreferences.getInt("IABTCF_gdprApplies", 0);
```
A callback can be registered to update settings when a preference is changed using the `registerOnSharedPreferenceChangeListener` method for the `android.content.SharedPreferences` class.

Expand Down

0 comments on commit af2930b

Please sign in to comment.