setDelegate static method

Future<void> setDelegate(
  1. HackleDelegate? delegate
)

Sets the delegate that handles links from push notifications and in-app messages.

When a delegate is registered, the SDK passes links to HackleDelegate.handleUrl instead of opening them.

delegate - The delegate to register. If null, the SDK returns to its default behavior of opening links itself.

Must be called after HackleApp.initialize. Calls made before initialization are ignored, and a later HackleApp.initialize replaces the delegate with HackleConfig.delegate (or removes it if none is set). To register a delegate before or at initialization, use HackleConfigBuilder.delegate.

Note: A push link tapped while the app is not running (cold start) is only delivered when the delegate is registered with HackleConfigBuilder.delegate.

Implementation

static Future<void> setDelegate(HackleDelegate? delegate) {
  return HacklePlatform.instance.setDelegate(delegate);
}