presentNotice static method

Future<void> presentNotice(
  1. bool force
)

Displays the CMP Notice if needed.

Once the CMP has been setup with setup, call this to display the Notice UI. Internally, this function checks if a user has already saved their preferences:

  • if yes, then the CMP Notice is not displayed.
  • if not, the CMP Notice is displayed, so the user can save their preferences.

The force option tells the Notice to always display the preferences screen, even if the user has already saved their preferences. The default behavior is false. If set to true, then the behavior changes has such:

  • if user has already saved their preferences before, the introduction and global choices screen is not shown, and the CMP Notice displays the detailed preferences page. This is used to allow the user to change their preferences.
  • if not, the CMP Notice is displayed as usual.

This function returns as soon as the CMP Notice has been displayed, so when it returns, the user may not have saved their preferences yet.

Implementation

static Future<void> presentNotice(bool force) async {
  await _channel.invokeMethod("presentNotice", {"force": force});
}