Giter Site home page Giter Site logo

reverse-developer / flutter_siri_suggestions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from myriky/flutter_siri_suggestions

1.0 0.0 0.0 91 KB

ios siri suggestions plugin for flutter

License: MIT License

Kotlin 6.35% Ruby 25.32% Objective-C 28.90% Dart 39.42%

flutter_siri_suggestions's Introduction

flutter_siri_suggestions

Flutter plugin for exposure on Siri Suggestions.

Note: This plugin only work in iOS.

Getting Started

Add flutter_siri_suggestions as a dependency in your pubspec.yaml file.

Check out the example directory for a sample app.

Usage

Import the library via

import 'package:flutter_siri_suggestions/flutter_siri_suggestions.dart';

Example :

await FlutterSiriSuggestions.instance.buildActivity(
  FlutterSiriActivity(
     "Open App ๐Ÿ‘จโ€๐Ÿ’ป",
     "mainActivity",
     isEligibleForSearch: true,
     isEligibleForPrediction: true,
     contentDescription: "Did you enjoy that?",
     suggestedInvocationPhrase: "open my app"
  )
);

FlutterSiriSuggestions.instance.configure(
  onLaunch: (Map<String, dynamic> message) async {
      // Awaken from Siri Suggestion
      // message = {title: "Open App ๐Ÿ‘จโ€๐Ÿ’ป", key: "mainActivity", userInfo: {}}
      // Do what you want :)

      switch (message["key"]) {
        case "mainActivity":
          __text = "No Beer ๐Ÿ˜จ";
          break;
        case "beerActivity":
          __text = "Let's Beer Time ๐Ÿป";
          break;
        case "searchActivity":
          __text = "Search for meaning...";
          break;
        case "TalkActivity":
          __text = "Let's talk about you ๐Ÿ˜˜";
          break;
        default:
          __text = "hmmmm...... made a typo";
      }

      setState(() {
        _text = __text;
      });


  }
);

call buildActivity method if you want.


suggestedInvocationPhrase

suggestedInvocationPhrase, only available iOS 12+

enjoy! ๐Ÿ’ƒ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.