setHostCallbacks method

  1. @override
Future<void> setHostCallbacks({
  1. void onNotificationTap(
    1. AppwinCommunityPostTarget target
    )?,
})
override

Installs the host's handler, or removes it when null, and tells the native SDK whether it exists. See AppwinCommunity.onNotificationTap.

Implementation

@override
Future<void> setHostCallbacks({
  void Function(AppwinCommunityPostTarget target)? onNotificationTap,
}) async {
  _onNotificationTap = onNotificationTap;
  // Installed before telling native, so a tap native replays as soon as it
  // knows about the handler already finds one here.
  methodChannel.setMethodCallHandler(_handleNativeCall);
  await methodChannel.invokeMethod<void>('setHostCallbacks', <String, bool>{
    'notificationTap': onNotificationTap != null,
  });
}