init method

void init({
  1. CallEventHandler? onCallAccepted,
  2. CallEventHandler? onCallRejected,
  3. CallEventHandler? onCallIncoming,
  4. String? ringtone,
  5. String? icon,
  6. @Deprecated('Use `AndroidManifest.xml` meta-data instead') String? notificationIcon,
  7. String? color,
})

Initialize the plugin and provided user callbacks.

  • This function should only be called once at the beginning of your application.

Implementation

void init(
    {CallEventHandler? onCallAccepted,
    CallEventHandler? onCallRejected,
    CallEventHandler? onCallIncoming,
    String? ringtone,
    String? icon,
    @Deprecated('Use `AndroidManifest.xml` meta-data instead')
    String? notificationIcon,
    String? color}) {
  _onCallAccepted = onCallAccepted;
  _onCallRejected = onCallRejected;
  _onCallIncoming = onCallIncoming;

  updateConfig(
      ringtone: ringtone,
      icon: icon,
      notificationIcon: notificationIcon,
      color: color);

  initEventsHandler();
}