- (void) postCommerceAddProductName: (NSString *) productName productId: (NSString *) productId nameSpace: (NSString *) nameSpace unitPrice: (double) unitPrice quantity: (int) quantity; - (void) postCommerceAddProductName: (NSString *) productName productId: (NSString *) productId nameSpace: (NSString *) nameSpace unitPrice: (double) unitPrice quantity: (int) quantity properties: (NSDictionary*) properties;
Example of use - buy 1 Babelfish (item number 42) for the price of 10 currency:
NSString *namespace = @"http://myiosapp.company.com"; // Set product name NSString *productName = @"Babelfish"; // Set product SKU/ID NSString *productId = @"42"; // Set price long unitPrice = 42; // Set quantity long quantity = 1; // Set optional product properties // Color: Yellow // Category: Translator // NOTE: initWithObjectsAndKeys uses reverse order: Value, Key, ..., Value, Key, nil NSDictionary* properties = [[NSDictionary alloc] initWithObjectsAndKeys: @"Yellow", @"Color", @"Translator", @"Category", nil]; [[NMTracker sharedTracker] postCommerceAddProductName:productName productId:productId nameSpace:namespace unitPrice:unitPrice quantity:quantity properties:properties];