init static method

Future<bool?> init({
  1. String? testingId,
  2. bool testMode = false,
  3. bool iOSAdvertiserTrackingEnabled = false,
})

Initializes the Facebook Audience Network. testingId can be used to obtain test Ads. testMode can be used to obtain test Ads as well, it is more useful on iOS where testingId keeps changing.

testingId can be obtained by running the app once without the testingId. Check the log to obtain the testingId for your device.

Implementation

static Future<bool?> init({
  String? testingId,
  bool testMode = false,
  bool iOSAdvertiserTrackingEnabled = false,
}) async {
  Map<String, dynamic> initValues = {
    "testingId": testingId,
    "iOSAdvertiserTrackingEnabled": iOSAdvertiserTrackingEnabled,
    "testMode": testMode,
  };

  try {
    final result = await _channel.invokeMethod(INIT_METHOD, initValues);
    return result;
  } on PlatformException {
    return false;
  }
}