ios - no visible interface for 'GAITransaction' -


i'm trying implement in app purchase tracking in ios google analytics receive these errors:

the exact example code taken google analytics page has 2 errors:

- (void)onpurchasecompleted {   gaitransaction *transaction =   [gaitransaction transactionwithid:@"0_123456"            // (nsstring) transaction id, should unique.                     withaffiliation:@"in-app store";       // (nsstring) affiliation 

when compile here above says "]" inserted

   transaction.taxmicros = (int64_t)(0.17 * 1000000);           // (int64_t) total tax (in micros)   transaction.shippingmicros = (int64_t)(0);                   // (int64_t) total shipping (in micros)   transaction.revenuemicros = (int64_t)(2.16 * 1000000);       // (int64_t) total revenue (in micros) 

here below error: "no visible interface 'gaitransaction' declares selector 'additemwithsku:name:category:pricemicros:quantity'"

  [transaction additemwithsku:@"l_789"                         // (nsstring) product sku                      name:@"level pack: space"             // (nsstring) product name                  category:@"game expansions"               // (nsstring) product category               pricemicros:(int64_t)(1.99 * 1000000)        // (int64_t)  product price (in micros)                  quantity:1];                              // (nsinteger)  product quantity     [[gai sharedinstance].defaulttracker sendtransaction:transaction]; // send transaction.    } 

what's wrong here?

error 1: yes, code pasted not have square bracket @ end, add before semicolon , error go away.

error 2:

no visible interface 'gaitransaction' declares selector 'additemwithsku:name:category:pricemicros:quantity'

that means transaction instance not respond additemwithsku:name:category:pricemicros:quantity method. did import required files? there additemwithsku:name:category:pricemicros:quantity method signature in .h file?


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo