Configuring the Application Manifest

,

An app that nominates itself for search integration must define the list of Bing search categories that the app can handle. This is done via the app’s WMAppManifest.xml file. Listing 31.1 shows an excerpt from the sample app’s WMAppManifest.xml file.

Each Extension element uses the following four attributes to describe the extension:

Image ExtensionNameSpecifies the category of the search result. If Bing determines that a search result falls into the category, the quick card for the result will include a link to your app. See the source code for a complete list of search extension names.

Image ConsumerIDIdentifies that the extension is for extending search. All search extensions require the same value of 5B04B775-356B-4AA0-AAF8-6491FFEA5661.

Image TaskIDCorresponds to the name of the default task that is specified in the Tasks element of the same file. Usually this value is _default.

Image ExtraFileThe location of the Extras.xml file. The file must reside in a folder Extensions and be named Extras.xml.

LISTING 31.1. WMAppManifest.xml (excerpt)


<Deployment ...>
  <DefaultLanguage .../>
  <App ...>
    <IconPath IsRelative="true" IsResource="false">
        AssetsApplicationIcon.png
    </IconPath>
    <Capabilities>
...
    </Capabilities>
    <Tasks>
      <DefaultTask  Name ="_default" NavigationPage="MainPage.xaml"/>
      <!--<DefaultTask Name="_default"
               NavigationPage="SearchExtras?PlaceName=Azteca Mexican Restaurants&amp;
               PlaceAddress=3040 148th Ave NE, Redmond, WA,
                98052&amp;Category=Bing_Places_Food_and_Dining" />-->
    </Tasks>
    <Tokens>
      ...
    </Tokens>

    <Extensions>
      <!-- All product extensions. In your application,
              only declare extensions that are relevant. -->
      <Extension ExtensionName="Bing_Products_Arts_and_Crafts"
                ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5661}" TaskID="_default"
                ExtraFile="Extensions\Extras.xml" />
      <Extension ExtensionName="Bing_Products_Baby_and_Nursery"
                ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5661}" TaskID="_default"
                ExtraFile="Extensions\Extras.xml" />
      ...

      <!-- All place extensions. In your application,
                 only declare extensions that are relevant. -->
      <Extension ExtensionName="Bing_Places_Arts_and_Entertainment"
                ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5661}" TaskID="_default"
                ExtraFile="Extensions\Extras.xml" />
      ...

      <!-- The movies extension. In your application,
                          only declare extensions that are relevant. -->
      <Extension ExtensionName="Bing_Movies"
             ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5661}" TaskID="_default"
             ExtraFile="Extensions\Extras.xml" />
    </Extensions>

    <ScreenResolutions>
...
    </ScreenResolutions>

  </App>
</Deployment>



Tip

During development, you can save time by simulating launching the app via the Search Experience. The NavigationPage property of the DefaultTask can be replaced during development. That way, you avoid having to perform a search every time you want to test your app.


By default, when you attempt to open the WMAppManifest.xml file, Visual Studio will open a GUI editor for the file. To edit the file using a text editor, right-click the file in the Solution Explorer and select View Code.


Warning

Limit your app to search extension names that the app is expressly designed to handle. Apps that misuse Search extensibility risk failing certification or being pulled from the Marketplace.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.106.9