Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
6
Question by crazyKnight · Jun 15, 2011 at 09:32 AM · androidin-app-purchase

in app purchase android

hey ,

i am trying to implement in app purchase in my android game,the game currently has 20 levels what i am trying to do is, when the user downloads the game from the market(the game would be free)the first 10 levels will be unlocked(from the starting) but to play the next 10 levels the user has to pay some amount of money(in app purchase).

i dont want a 10 level add on package sort of thing,when the game is first time downloaded from the market it will have all the 20 levels in it but 10 levels will be locked(by a simple loop condition).

my idea of implementing this was,

i would create a gui button for the purchase and trigger a event with playerprefs(by suppose setting a int value to 1)and then in eclipse(i used the following link to convert the game into an eclipse supportable format http://unity3d.com/support/documentation/Manual/Android-Integrating%20Unity%20With%20Eclipse.html ) i heard we can get the playerprefs event called in eclipse and then in eclipse i can do the entire coding related the purchase(i am not concerned about the coding in eclipse regarding purchase as i have done that many times for my non unity apps) but what concerning me is that how will i return a confirmation to unity that the purchase is complete and i can unlock the levels in the game.

i dont know what i am thinking is feasible or not...any suggestion on how this could be implemented or how i could a return a confirmation back to unity about the completion of the purchase.

i would also appreciate any new idea for implementing this..

Thanks in advance

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

7 Replies

· Add your reply
  • Sort: 
avatar image
6

Answer by maxgreen · Sep 23, 2012 at 06:57 PM

You might want to check out the free Soomla Store plugin on the Asset Store.

It's also an open source project on Github, and they have a sample app there as well, with properly documented code.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
3

Answer by Voxel-Busters · Aug 09, 2015 at 10:33 PM

This can be setup with some little effort. Create a gameobject and add a class with a method. On purchase successful in Android, Call

UnityPlayer.UnitySendMessage(UnityDefines.NATIVE_BINDING_EVENT_LISTENER, methodName, message);

Where UnityDefines.NATIVE_BINDING_EVENT_LISTENER is the name of gameObject. Message needs to be a string and you need to convert your purchase info to a string format so that you can parse back in unity.

You can try Cross Platform Native Plugins for a smoother and quick solution. It provides necessary callbacks with very easy setup and lots more features. alt text

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by One Platform Foundation · Feb 06, 2014 at 09:50 PM

No need to compile OpenIAB from sources anymore.

OpenIAB also can be found in Asset Store or download from Releases on GitHub

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image liju · May 08, 2014 at 09:28 AM 0
Share

How to use OpenIAB unity plugin ? any tutorial available ?

avatar image
0

Answer by ddfire · Nov 07, 2011 at 07:05 PM

hi i think the best choice is make an activity outside unity, call it for the in-app billing and using a native plug in check a database or preferences. you only need to check it when the user want to load level 11... or any level above 10... hope this help. please post what did you do. thanks David

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image crazyKnight · Nov 23, 2011 at 12:57 PM 1
Share

@ddfire : that what i asked in my question ....how to proceed about this....even i know i have to make a plugin for this,i have a suggestion for u please read the question carefully before posting a answer.

avatar image ddfire · Jul 05, 2012 at 05:24 PM 0
Share

@CrazyBoy, i think you did not understand my answer... again simplified... make an activity to handle in-app puchace... make a plugin to read sharedprefs so you use your own activity to sell and the plugin to check if the user had bougth the new levels.

avatar image ddfire · Aug 21, 2012 at 03:36 PM 0
Share

@CrazyBoy i dont know why i got a -1 the answer is clear... the native plugin check in shared preferences for a boolean and return it to unity... i think you do not understand about progra$$anonymous$$g.

avatar image
0

Answer by PolityAI · Jul 04, 2012 at 09:01 AM

I've written an in app billing plugin for android, currently it is half-price for a limited amount of time! Please find it at http://www.platoevolved.com/blog/unity-plugins/

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

If a player purchases a Non Consumable item in my game, will they be able to do so again after restarting the app? 1 Answer

Free android plugin for in-app purchase 3 Answers

In App plugins free 1 Answer

In-App-Purchases not working (Android) 1 Answer

How to add .properties files to apk root programmatically? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges