UniPay - In App Purchase (IAP) Billing - Shop solution

@jerotas
You are very welcome :slight_smile:

Thank you very much to those of you who participated in the early bird sale, an extra gratitude goes to those who have donated to support us!

In the coming week, I will package it up for sale on the Unity Asset Store and on our website (once reviewed).
Simple IAP System will be unavailable for sale during this time.

Guess its true the early worm does get the bird

Hahaā€¦ well as a worm youā€™re in serious trouble every part of the day. Would be interesting to see the opposite!
The later birds will get their worm too, it will just take another week or two :wink:

Version 1.0.1 has been released on our website (and will be on the Asset Store soon).

This version bypasses app export regulations which would previously require you to apply for an encryption registration number (ERN) when submitting your app. If you havenā€™t published an app with SIS already, please delete existing PlayerPref entries (if encrypted) and upgrade to this version. You can dowload it through the same link in your purchase confirmation mail.

V1.0.1
Changes

  • DBManager: Encryption mode changed to avoid app export regulations registration. Documentation contains further information on usage
  • IAPManager: Added additional platform check to indicate IAPManager wonā€™t initialize on build targets other than iOS/Android

Hello Baroni!

Bug report. At the start the DBManager checks if there is a new currency, but does not check whether it was removed. Thus, gameObject [currency].Count more then IAPObject.virtualPrice.Count!

Please see at line 278, the VerifyVirtualPurchase function, DBManager.cs.

Hi and thanks! Do you get an error message?

Basically the case where your currency array is greater than your virtual price array (or the other way round) should not happen, ever: if you create a new currency, you should adjust your existing virtual items with this new currency; by default their price for the new currency is 0. Or if you remove a currency, you will need to adjust the virtual items again.

Actually DBManager checks if a currency was removed. I also stated it in the documentation, but itā€™s worth mentioning that you shouldnā€™t remove currencies after publishing your app for consistency purposes. If you really want to delete obsolete currencies (and purchases!) on the userā€™s device (what I do not recommend), set the keepLegacy variable to false.

What was done:

  1. Copied scene ā€œListVerticalTabsā€
  2. I opened a SIS input window (Window-> Simple IAP System ā†’ IAP Settings)
  3. Deleted all the elements for Android
  4. Added two new elements for Android
  5. Deleted all the elements for ā€œin Game Contentā€
  6. Removed currency
  7. Added new currency
  8. Added new items for "in Game Content "
  9. Started the scene, went to the ā€œItemsā€ section, try to buy, and got the error:

ArgumentOutOfRangeException: Argument is out of range. Parameter name: index

Analytics.

  1. In DBManager :: InitDB, line 188. We get a list of currencies (IAPManager.GetCurrency ()). The list will contain only one currency (I deleted one old and added one new)

  2. Then in DBManager :: InitDB, line 202 add the new currency in gameData[currency]

if (string.IsNullOrEmpty (gameData [currency] [cur]))
gameData [currency] [cur]. AsInt = curs . amount;
Before this gameData[currency] is contained one currency as this information is stored in PlayerPrefs, and after it contains two correncies. On the second step we changed data fields IAPManager :: currency, but not the data in PlayerPrefs!
Of course at the release no one will change the currency, but during the development this can happen very often!
I think itā€™s not right that the gameData[currency] stores only the amount of currency as a result we can not validate what currency we have removed, all the work with currencies is based ont index in array. Perhaps we should keep at least a KeyPair of name plus number.

Thanks again for your detailed breakdown. I could reproduce the error and will fix this in the next update. I submitted SIS to the Asset Store nearly two weeks ago, so I would like to wait until it has been approved before submitting another package. In the meantime you can delete the PlayerPrefs file between testing stages. The DBManager (gameData) stores the name of the currency along with its amount, but you are right that it shouldnā€™t loop over the count and access the currency directly instead.

Any chance you could add support for Unibill?

http://outlinegames.com/unibill-documentation/

Sure, thanks for your feedback. Iā€™d like to add support for Unibill if thereā€™s demand for it, but my submission to the Asset Store has been declined because of external links in the description (duhā€¦), thatā€™s why Iā€™m busy preparing the next update first which will include local and server-side IAP receipt validation.

So here is the current roadmap:

  • finish update 1.1 with receipt verification
  • integrate Neatplug plugins
  • More Neatplug plugins or Unibill?

Yes, I would like to see Unibill too. It has virtual currency system built in now.

If there will be support for Unibill, would you like to use Unibillā€™s virtual currency tools then? Correct me if I am wrong, but wouldnā€™t this mean that the only reason to use SIS is its shop template system? I think Unibill has a cross-platform wrapper too, maybe I am missing something.

Yes, it has a cross platform layer, and yes, SIS will be more of a shop template.

Version 1.1 has been released on our web store (for early bird buyers) and submitted to the Unity Asset Store (yet again).

This version fixes various bugs with shop templates, which had something to do with how NGUI handles multi touch input. Also, the way we handled virtual currency in IAPObjects changed. Please backup your project, you will have to re-create your IAPs in the IAP Settings Editor! A new feature is the online receipt verification request, which forwards receipts to your external server that verifies them with Google (newest API) or Apple. Minimum Unity version has changed to 4.2.1.

v1.1

Fixes Changes

  • ShopManager: fixed NullReferenceException when trying to overwrite an IAP Item with online data that doesnā€™t exist
  • ShopManager: disables multi touch to avoid pressing two buttons at once
  • IAPObject: for virtual currency, now holds a list of IAPCurrency instead of an int array, fixing null references when trying to access removed currencies
  • DBManager: keepLegacy = false removes old currency entries too
  • DBManager: does not select items automatically if their price is set to zero
  • DBManager: GetAllPurchased(), GetAllCurrencies() and GetAllSelected() return lists and dictionaries, allowing for better access to the desired item
  • ListVertical-/ListHorizontalMenu scenes: added InputBlocker gameobject to avoid animating two menus at the same time if one is active already
  • All scenes: fixed collider of the notification popup, correctly blocking inputs
  • All scenes: rebuild IAPEditor with new IAPObject structureFeatures
  • Added online receipt verification, comes with PHP scripts for your external server. Apple: implemented App Store validation. Google: implemented recently released Purchase Status API. See the docs for setup instructions

I have Unibill, but Iā€™d be interested in the shop template aspect.

Thanks for your feedback, I will definitely consider Unibill support. Now that I know that they will add virtual products at some point (source), this will make an integration with our shop template system much easier.

Hello Dan,

the Asset Store team take their time to review Simple IAP System. I submitted it 2 times, and the total review time soon reaches 5 weeks. I donā€™t like it either, thatā€™s for sure. Unfortunately I canā€™t do anything to speed up the process.

Well then Iā€™m sorry for the nastiness on my part.

Simple IAP System is now available to download!

Get it here

Stay tuned for the next update, which is already in the testing phase.

How customizable is this? Can I change the skin/icons to match the design/ look feel of my game?