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 /
  • Help Room /
avatar image
0
Question by diegomh7 · May 21, 2016 at 10:26 AM · unity 5scripting problemapiiap

[SOLVED] Unit IAP google play response to update result

Hi all, This is the last hurdle for me before I launch my app.

As it stands this is what I got : Buttons on screen which call the template unity purchase IAP script. I click a button caling this function :

 public void BuykProductIDConsumable99p()
     {
     // Buy the consumable product using its general identifier. Expect a response either through ProcessPurchase or OnPurchaseFailed asynchronously.
     BuyProductID(kProductNameGooglePlay99);
     //BuyProductID(kProductNameGooglePlay99);
     }


That works fine, I goes to google and works great.

When it comes back is where I have a probelm.

I have a file called GamePreferences, a static class which runs this function :

public static int GetGlobaltoys(){ return PlayerPrefs.GetInt(GamePreferences.Globaltoys); }

The problem is, the purchaser script from unity wont allow me to interact with my script. I tried adding gamepreferences into a shared namespace and also including different libraries at the top, I also tried addng the script directly to it but it 'Can't add script behaviour GamePreferences. The script class can't be abstract!'

All I want to do is update the player preferences when a successful purchase happens. I tried getting the purchase script to save directly to playprefs but the results arent saved. I'll look at encrytion after this. I've also considered storing online but the app does that alsready afterwards.

I just can't get the result from the google play and update anything at all locally as I don't understand how the purchaser script saves info.

Help would be awesome on this one, I can get it live then. I'll give a cheat code out to anyone who helps.

Until then all I can offer is this to make you smile :

alt text

[SOLVED] The purchaser script needed to be in my Assets folder

47a11v.jpg (34.5 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by diegomh7 · May 21, 2016 at 11:27 AM

Could it be anything to do with the folder structure? IAP is in the plugins and my other scripts are in the assets / script folder

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

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

85 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Steam Leaderboards in Unity, upload time since level load 0 Answers

Unity Monodevelop script missing all its lines entirely 0 Answers

[Steamworks.NET] SteamAPI Problem help !,[Steamworks.NET] Problem 0 Answers

Calling Unity API Reference from MonoDevelop 2 Answers

How to assign an absolute area to a moving gameObject? 1 Answer


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