Bug Issue: [Purchase] Use an item


Pages: 1 2

RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 10, 2018, 01:16:45 am
Hi,
as I reported here http://community.stencyl.com/index.php?action=reporttm;topic=54898.144;msg=299233 I have some problem with free unmanaged block, because it seems not working with 3.5 9876.
I have attach the code that I have tested and with no-one I could buy the items for the second time.

My tests has been made with android.test.purchased and with the correct product ID
« Last Edit: May 18, 2018, 03:22:44 am by RulezTeam »


New attachment added by RulezTeam - May 10, 2018, 01:17:27 am


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 11, 2018, 10:05:13 am
Hi Rob, hi Justin,

someone can take a look at this problem ? Or is it something about wrong code ?

Thank you


Issue updated by RulezTeam - May 18, 2018, 03:22:44 am
  • Issue renamed from "Unmanaged block" to "[Purchase] Use an item"


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 18, 2018, 03:51:00 am
Hi,
after some test, I have found that the block buy/use product ID doesn't work.
I have seen (with android log) that when I use the block mode "USE product ID", it doesn't make the correct call.

It seems that the use block doesn't make the call and send/receive the token string, even if when you debug it, the block USE turn to true itself.
It doesn't deleted the product from purchased list.

I have make a simple test: in the first scene I check if there are product quantity = 0 and if it so, I use my product ID. Well, I can use it even if I haven't any of my product ID bought. And the block use product id, turn itself to true (make something, but what ? )

So, I've tried to free unmanaged product before and after the block USE without any success. I've tried to use before block BUY (and wait 2 seconds) before make the action inapp, but no one solution is working. So I think that there are some problems with these blocks.

All the events purchased should be revised. When I check if the purchased is failed, this call, is make two times

Please consider to resolve this but/problem very soon.


Also, the guide on Stencylpedia shoul be updated.





rob1221

  • Master Stencyler
  • *
May 19, 2018, 12:06:01 pm
In b9881, consuming a purchase (via the free unmanaged block) no longer requires the local quantity to be greater than 0.  It still requires the purchase data to exist locally, so you need to restore purchases if that local data isn't there.  Does this solve the problem for you?
  • Status changed from New to Need Info


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 20, 2018, 12:54:05 am
Hi rob,
no, the problem persist. As you have seen, there is a problem with "use block" too, so I think that if "free unmanaged block" work even if local quantity is 0 (and this isn't so right), the "use block" must send the consume call to google server otherwise the free unmanaged block doesn't work.


rob1221

  • Master Stencyler
  • *
May 20, 2018, 04:56:36 am
The free unmanaged block ends up calling this in the Android code:
AndroidBilling.inAppPurchaseHelper.consumeAsync(purchase, mConsumeFinishedListener);
I'm assuming that part sends the consume call to Google.
The use block is local only.  If you want the local and remote use of the purchase to happen at the same time, then you use the "use" block and the free unmanaged block together at the same time.

If that still isn't working for you, have you restored purchases first?
« Last Edit: May 20, 2018, 04:58:02 am by rob1221 »


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 20, 2018, 12:02:54 pm
hi rob,
why should I restore a purchase ? The unmanaged item aren't managed as the managed. The restore event should be used only for managed product, while unmanaged shouldn't have the possibility to restore any item that it has been purchased.
So, I don't understand what you mean with your last question.

I rewrite what Google tell about consuming in-app products :

To retrieve the list of products owned by the user, your application sends a getPurchases call to Google Play. Your application can make a consumption request by sending a consumePurchase call. In the request argument, you must specify the managed product's unique purchaseToken string that you obtained from Google Play when it was purchased. Google Play returns a status code indicating if the consumption was recorded successfully.
Link : https://developer.android.com/google/play/billing/api


rob1221

  • Master Stencyler
  • *
May 20, 2018, 12:58:43 pm
I see where the confusion is coming from.  All purchases are actually managed now despite the name of that block which was created at a time when that wasn't the case.  The Stencylpedia makes a mention of this.


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 21, 2018, 12:18:51 am
Yes,
since about 2 years, Google have delete the possibility to configure at its side, an unmanaged product, but you can always choose "to consume" it, so you can repurchase, and so this action makes it became as the old unamanaged.

If I remeber well, the free unamanged block was create just for this action, but when Stencyl upgrade to 3.5 version, it seems doesn't work anymore
« Last Edit: May 21, 2018, 12:20:47 am by RulezTeam »


rob1221

  • Master Stencyler
  • *
May 21, 2018, 05:10:02 am
The consume code looks the same to me in 3.4.  so I suspect what changed is the save location for shared objects.  Assuming that is true, if you upgrade a game to 3.5 then you have to do restore purchases as if it's a new device.
« Last Edit: May 21, 2018, 05:12:25 am by rob1221 »


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 21, 2018, 05:15:25 am
I have seen the post of Justin about save location, but my problem is that if you try to implement the purchase code, with a new 3.5 project, you have all those problems that I have reported, so, not only if you upgrade from 3.4 to 3.5, but even if you create a new products in 3.5


rob1221

  • Master Stencyler
  • *
May 21, 2018, 05:59:03 am
So just to clarify, using restore purchases with b9881 does NOT solve the problem for you?


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 21, 2018, 09:40:30 am
Yes, the problem remain. But remember that I write about unmanaged products that cannot be able to restore the purchase, so the block "restore" isn't used.
If I use the restore block for an unmanaged products, the user can get the benefits for PAID user even if he don't pay for it, because unmanaged product are used during the game and then if you want more benefit you should buy another unmanaged products (coins, etc.)


rob1221

  • Master Stencyler
  • *
May 21, 2018, 09:50:33 am
I'll need to do more testing with real purchases to see if I have the same problem.  The test ID works completely fine for me now.


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 21, 2018, 01:57:09 pm
ok, I'll wait your test with real purchase.

So, now, you confirm that with test ID, you can re-purchase more and more times the same product/test ID ?


rob1221

  • Master Stencyler
  • *
May 21, 2018, 03:00:15 pm
No, I can't buy the test ID more than once, but I can buy and use/consume as many times as I want.  I probably need to set up real purchases to test multiple purchases in a row.

EDIT: Am I missing something here, or do I really need to upload every change I want to test and then wait hours so my test account can download?
« Last Edit: May 21, 2018, 03:56:30 pm by rob1221 »


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 22, 2018, 12:58:19 am
Hi,
you can use/consume if you make a restore or you can use/consume because you use "free unmanaged block" with "use block" ?

you should not wait hours to test your product ID.


rob1221

  • Master Stencyler
  • *
May 22, 2018, 04:59:34 am
Quote
you can use/consume if you make a restore or you can use/consume because you use "free unmanaged block" with "use block" ?
Consuming with the free unmanaged block lets me buy the test ID again.  Maybe that's the same for real purchases too.  So the order of buy > free unmanaged > buy > free unmanaged, etc. should be working as long as the local purchase map exists.  Does that not work for you?


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 22, 2018, 07:27:22 am
Hi,
I haven't tested with only block buy > free, because as written on Stencylpedia, as working on 3.4, the order should be : buy > use > free or free > buy > use, but "use block" is always present. In fact, also Google specifications tell that you buy, then consume (use), then you can re-purchase after the product is been consumed.
So, now is the order of functioning changed ?
« Last Edit: May 22, 2018, 07:27:43 am by RulezTeam »


Pages: 1 2

Details

  • Reported
    May 10, 2018, 01:16:45 am
  • Updated
    May 23, 2018, 07:57:55 am

  • View Status
    Public
  • Type
    Bug
  • Status
    Resolved
  • Priority
    Normal
  • Version
    3.5.0 beta 1
  • Fixed in
    (none)
  • Assigned to
    rob1221
  • Category
    Engine

Tags


Attachments


* Unmanaged.png (24.72 kB, 588x998 - viewed 24 times.)

* Purchase Test.png (19.69 kB, 386x386 - viewed 12 times.)