registerIntentHandler method

void registerIntentHandler(
  1. String identifier,
  2. Future<Map<String, dynamic>> handler(
    1. Map<String, dynamic> params
    )
)

Registers a handler for the specified intent.

When an intent with the given identifier is executed from iOS (via Siri or Shortcuts), the handler will be called with the intent's parameters.

The handler should return a map containing the result of the intent execution, which will be passed back to iOS.

Example:

AppIntentsPlatform.instance.registerIntentHandler(
  'com.example.AddTaskIntent',
  (params) async {
    final title = params['title'] as String;
    // Add the task...
    return {'taskId': 'new-task-id'};
  },
);

Implementation

void registerIntentHandler(
  String identifier,
  Future<Map<String, dynamic>> Function(Map<String, dynamic> params) handler,
) {
  throw UnimplementedError(
      'registerIntentHandler() has not been implemented.');
}