init static method

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

Initializes the Facebook Audience Network. testingId can be used to obtain test Ads.

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 iOSAdvertiserTrackingEnabled = false}) async {
  Map<String, String?> initValues = {
    "testingId": testingId,
    "iOSAdvertiserTrackingEnabled": iOSAdvertiserTrackingEnabled.toString(),
  };

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