Index App Content

Contents

This plugin gives you a Javascript API to interact with Core Spotlight on iOS (=> iOS 9). You can add, update and delete items to the spotlight search index. Spotlight Search will include these items in the result list. You can deep-link the search results with your app.

https://github.com/johanblomgren/cordova-plugin-indexappcontent

Ionic Index App Content插件的安装(Installation)

ionic cordova plugin add cordova-plugin-indexappcontent npm install @ionic-native/index-app-content

Ionic Index App Content插件支持的平台(Supported Platforms)

  • iOS

Ionic Index App Content插件的用法(Usage)

import { IndexAppContent } from '@ionic-native/index-app-content';


constructor(private indexAppContent: IndexAppContent) { }

...

var items = [
     {
       domain: 'com.my.domain',
       identifier: '88asdf7dsf',
       title: 'Foo',
       description: 'Bar',
       url: 'http://location/of/my/image.jpg',
   },
   {
       domain: 'com.other.domain',
       identifier: '9asd67g6a',
       title: 'Baz',
       description: 'Woot',
       url: 'http://location/of/my/image2.jpg',
    }
];

this.indexAppContent.setItems(items)
  .then((res: any) => console.log(res))
  .catch((error: any) => console.error(error));