int StoreRequestProductData(char *product_ids)

 

Requests store data for a list of product id's.

 

Return Value

 

Returns one if successful.  Be sure to use the global Store callback specified in StoreInit() to get results from the iTunes Store.

 

Parameters

 

product_ids

Specifies a comma-separated list of pre-defined product id's in your store to be requested.  It is recommended to use the reverse domain name format for your product id's, so that there is no chance of name collisions with other product id's.

 

Remarks

 

StoreRequestProductData() makes a request for a list of product id's for your application's store.  The response will be delivered to the callback specified by StoreInit().  In order to use In-App Purchase features, you will need an Apple Developer account with an application defined, and In-App Purchase enabled for your application.  Additionally, you will want to set up at least one item for sale before using In-App Purchase.

 

See iTunes Connect for more information on configuring your application for In-App Purchase.

 

Availability

 

Available in DragonFireSDK 2.0 and later.

 

Example

 

#include "DragonFireSDK.h"

 

const char *ErrorNoError(int value)

{

  if (value)

      return("ERROR! ");

  return("");

}

 

void OnStoreEvent(int type,int flag,int value,char *desc)

{

  switch (type)

   {

  case 1: // Product Request

       printf("Product Request event result: %svalue:%d desc:%s\n",ErrorNoError(flag),value,desc);

      break;

  case 2: // Provide Content

       printf("Provide Content event result: %svalue:%d desc:%s\n",ErrorNoError(flag),value,desc);

      break;

  case 3: // Record Transaction

       printf("Record Transaction event result: %svalue:%d desc:%s\n",ErrorNoError(flag),value,desc);

      break;

   }

}

 

int OnButton(int id)

{

  switch (id)

   {

  case 1:

       StorePurchaseProduct("com.mycompany.myapp.my_product_id");

      break;

  case 2:

       StoreRequestProductData("com.mycompany.myapp.my_product_id,com.mycompany.myapp.my_product_id2");

      break;

   }

     

  return(id);

}

 

void AppMain()

{

   StoreInit(OnStoreEvent);

 

   ButtonAdd("Images/Button", 10, 10, OnButton, 1);

   ButtonAdd("Images/Button", 10, 50, OnButton, 2);

}

 

void AppExit()

{

 

}

 

void OnTimer()

{

 

}