Couple of suggestions. I would recommend you use this routine after the 'InAppPurchaseActivate(0)' command:
This will wait until the user completes the IAP process, if available. Then checking the availability again should be done after. The first error you observed is expected. Casting the app to the player through broadcast will not work with IAP's since the product name, keys, and ID will not match (your app will carry different values compared to the AppGameKit player). So the IAP option will only work once you've uploaded the bundle to Google Play.
Then if you are receiving the message about the IAP setup failing, something may not be matching. Verify the following:
- The title you are specifying in 'InAppPurchaseSetTitle()' matches the GooglePlay value exactly (compare your 'getAppName()' result with the app name as it appears in Google Play).
- The 'InAppPurchaseSetKeys()' value matches the string as displayed in GooglePlay exactly.
If those check out, perhaps there is a lingering issue with the IAP list index (or you may be using an older version with the issue). Try adding this line after your first 'InAppPurchaseAddProduct()' line, so it would look like this:
+ Code SnippetInAppPurchaseAddProductID("token_0",0)
InAppPurchaseAddProductID("null",2) // Add a second redundant value as type 2
Then upload to Google Play and test again.