- Home /
What is the best way for me to have In-App Purchases?
I am interested in creating an app with in app purchases but not power-usp, gold, or the like. I would like my app to be more like a "shell" where you can purchase other games of the same theme within the main app. I would like it to be somewhat like the iOS way you scroll through your albums on the iPhone by swiping left and right but instead of music, it would be separate games that you would buy within the app and then tap on the "cover art" to play. It would be something like the Atari app with all the games within it.
Now, here's my question. What is the best way for me to do that? I have looked at Unibill and SOOMlA for in app purchasing but I can't figure which is best for what I want to do OR if there is something even better that I don't know about.
I would appreciate any help you may offer. Thanks so much in advance!!! Tom
Try using Cross Platform Native Plugins. Very easy setup, lots of features, unified API's and supports both iOS and Android platforms.
Answer by Narv · Aug 25, 2013 at 02:41 PM
Check out Prime 31's website. They have tons of stuff for all the mobile platforms: http://prime31.com/plugins#
Only issue is it gets expensive fast if you want to buy a lot.
Thanks for your response, @Narv. I am still very confused. The information on the site doesn't give much information about how to do what I want to do (or how much they will charge). And that goes for all the sites for in-app purchasing.
I'm wondering if you or anyone else might know if there is any form of instruction (a book, video, or document) that would give step-by-step instruction as to HOW to make in-app purchases for your apps. I have checked YouTube, Amazon, and iBooks but there is nothing that $$anonymous$$ches you how to do it.
I would really appreciate it if you (or anyone) could share a source for what I'm trying to do.
Thanks so much! $$anonymous$$
So the problem with in-app purchases is that it depends on the platform you are targeting. iOS implements it differently than Android that implements it differently than Windows Phone, etc. So because of this, Unity does not innately support in-app purchases.
HOWEVER, Unity does support the addition of plugins via DLLs. So for android, you could write the android code for an in-app purchase in android's native language of Java, and then compile the classes into a .jar file or use a different program to compile it into a DLL (there are other pieces of software out there that will wrap your functions). You can then call these DLL functions from your C# or JavaScript (UnityScript) code in the game. You will also need to make changes to the manifest files that go with the apps for the operating system to know how to properly handle your app.
Plugins like Prime 31 have done most of the heavy lifting for you, which is why it costs so much. Basically, they have wrapped generic enough function calls into a DLL for you, so you can call those functions in your program.
As stated above, each platform implements things differently, so there is no 1 DLL to rule them all, which is why most of the in-app purchases assets you will find are for a particular platform.
If you want to implement this on your own, then you would need to first find the platform you are targeting and learn how to implement an in-app purchase in the system's native language (iOS: Objective-C Android: Java Windows (Phone) 8: C# ) and then write a plugin (.jar or .dll) to expose methods to Unity that you want to be able to use (such as placing an actual purchase).
Then include that wrapper into your plugins folder and then implement it into your code.
For your question speficially: you would have setup in the app store of choice which game you want to have purchased and the price. Then you would have a function for displaying the price and one for sending the request to purchase with a callback event with a status variable saying if it was completed, cancelled, etc. If it was completed, you can either A.) have the "game" already included in your app and now you flip a switch somewhere and they can access the game. or B.) you use assetbundles (Pro feature) and stream the content in or download it to run. As for the layout, that is done in Unity's GUI features OR an asset for UI such as NGUI (or making your own textured planes that look like buttons with scripts on them, but that's a different question).
Hope that helps, should be everything you need if you wish to implement this yourself, though if you have the money (and it does get expensive quickly if you're hitting a lot of platform) I would recommend using an asset from the store or from prime31 (seems to be the best so far, with rather good support).
Wow! That's exactly what I was looking for, @Narv. Thanks so much for your totally complete answer! I really appreciate your time. I'm wonder... If I could ask one more thing... If I'm developing in Unity for the iOS, is Prime31 the best plugin to go with? I have seen three so far. Prime31, Unibill, and SOO$$anonymous$$LA. I just don't know which is best for what I'm doing. I just feel like I'm having a little bit more to my in app purchases than some extra gold.
Thanks again for your help!!! $$anonymous$$
Answer by Banderous · Feb 06, 2014 at 10:41 PM
Unibill will let you do all that you suggest, and do so across 6 different platforms.
Unibill is the one plugin that works exactly the same way on every platform, taking care of all platform differences for you, not to mention managing virtual currencies automatically.
Note - I am the author of Unibill.
Your answer
Follow this Question
Related Questions
What's the Logic for In App Purchases? 2 Answers
In app purchase of content 0 Answers
How to set up a non digital item store inside app? 0 Answers
Unity IAP doesn't work on Android 0 Answers
IAP Restore purchase on Android "Already Recorded Transaction" 0 Answers