Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by Saint34x · Jul 01, 2014 at 06:30 AM · u3dxtin-app-purchase

U3DXT from App store to players in-app wallet?

so i've watched the five minute video you guys posted on how to get in app purchases to work and i THINK i've got it all incorporated into my in app purchase GUI Button script . But heres my question say i have an IAP for 100 coins. in my if (GUI.Button ... ) bit i have IAPXT.Buy(coinsProductID, 100); how then do i move those coins from there to the players wallet? do i just go

     if (GUI.Button(new Rect(row1,coll1,iconSize.x,iconSize.y),purchase1,noGuiStyle)) 
         {
             IAPXT.Buy(coinsProductID, 100);
                        currentCoins = currentCoins + 100;
         }

because i feel like that would give the player coins successful purchase or not. any help you guys can offer would be GREATLY appreciated.

Comment
Add comment · Show 1
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 Saint34x · Jul 01, 2014 at 09:35 PM 0
Share

not sure if it notifies you when i comment to your comments so i'm gonna post this here. sorry if it emails you twice..

so e. quantity is that value at the end correct ( IAPXT.Buy(coinsProductID, 100); )?

thanks for being patient with me. I'm pretty new at the program$$anonymous$$g side of stuff and i'd like to understand as much as i can with out just coping and pasting.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by u3dxt · Jul 01, 2014 at 07:26 AM

Please take a look at the sample code here: http://unity3d.tutsmobile.com/5-minute-guide-to-inapp-purchases-for-ios/

The highlight is the subscribe events function, specifically:

         IAPXT.TransactionCompleted += delegate(object sender, TransactionEventArgs e) {
             Log("TransactionCompleted: " + e.productID + ", " + e.quantity);
                         // add the coins here
 
         };

You may also want to handle the TransactionFailed delegate by showing a message to the player.

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 Saint34x · Jul 02, 2014 at 07:30 PM 0
Share

so e. quantity is that value at the end correct ( IAPXT.Buy(coinsProductID, 100); )?

thanks for being patient with me. I'm pretty new at the program$$anonymous$$g side of stuff and i'd like to understand as much as i can with out just coping and pasting.

avatar image
0

Answer by Saint34x · Jul 01, 2014 at 05:43 PM

so could i do something like ` coinsProductID

 IAPXT.TransactionCompleted += delegate(object sender, TransactionEventArgs e) {
             Log("TransactionCompleted: " + e.productID + ", " + e.quantity);
                       if ( e.productID  == coinsProductID)
 {
 currentCoins = currentCoins + 100;
 } else if ( e.productID  == coins2ProductID)(
 
 )


 
     };


and so on? sorry I'm sure this is crazy simple i just can't seem to crack it. i really appreciate the help tho.

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 u3dxt · Jul 01, 2014 at 05:59 PM 0
Share

That's close, you should the quality into consideration: currentCoins = currentCoins + (100*e. quantity)

If the transaction is successful, you should see the log message on the screen.

Also, be sure to log out of your real itunes account and use the test accounts created in itunesconnect.apple.com.

Let us know if you have other questions.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to import *just* the IAP plugin? 1 Answer

In-app purchase "Invalid product" on Mac Store build 0 Answers

U3DXT In-app Purchase Maybe Do Not Work On IOS 5? 0 Answers

Step by step andriod In-App purchase 0 Answers

Testing IAP: non-consumable "purchase reset"? 3 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