playMaker

Author Topic: iOS Native Restoring purchases?  (Read 3707 times)

serenefox

  • Full Member
  • ***
  • Posts: 135
    • Serenefox Games
iOS Native Restoring purchases?
« on: April 16, 2015, 03:51:13 PM »
Has anyone been able to successfully restore multiple purchases with "iOS Native" in Playmaker? I can't seem to find a solution. I know the restoring action works but I can't seem to separate the restored items to set player prefs.

I tried multiple different ways but no luck. If I press restore in my app it registers all the restore items(I can see it in Xcode) but here is the problem:

If the player buys item A and item B, then upgrades to a new device and presses restore, it will restore A and B but there seems to be no way to pull Item A and B from the restore action. You can only pull item B because the "current restored item" on the restore action only saves the last restored item. Therefore you can only set item B's player prefs to give that item back to the player.

Unless I am doing something wrong, please let me know if anyone has done this successfully. This is a huge show stopper.

I have sent and email to the support but they don't seem familiar with playmaker. I did sent an email to the developer directly but his solution doesn't seem to work because of what I described above. I replied to him, letting him know but I wanted to hear if anyone has been able to do this from here.

Thanks!
Most Recent Published Games:
Juicy Theater - Android

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: iOS Native Restoring purchases?
« Reply #1 on: April 17, 2015, 02:59:26 AM »
Hi,

 please an action for saving restored purchase entries in arrayMaker. [see post below for the correct version]

Untested ( it's been build, but integration ont he project I need this is planned for next month). This may need some work around it.

Let me know how it goes. I need this too.

Bye,

 Jean
« Last Edit: April 20, 2015, 11:28:02 AM by jeanfabre »

serenefox

  • Full Member
  • ***
  • Posts: 135
    • Serenefox Games
Re: iOS Native Restoring purchases?
« Reply #2 on: April 17, 2015, 07:16:12 PM »
As soon as I import the script it gives me this error:

Code: [Select]
Assets/Extensions/IOSNative/Addons/PlayMakerActions/IOS/Billing/ISN_RestorePurchasesInArrayMaker.cs(71,41): error CS0246: The type or namespace name `CEvent' could not be found. Are you missing a using directive or an assembly reference?
Most Recent Published Games:
Juicy Theater - Android

serenefox

  • Full Member
  • ***
  • Posts: 135
    • Serenefox Games
Re: iOS Native Restoring purchases?
« Reply #3 on: April 19, 2015, 04:24:44 PM »
I may have figured it out, I was going through the Android Native documentation (because I decided to make the game for android while I waited) and found a "Notes" section on updating. Long story short the scripts were changed since you made the array maker script for iOS native.

First I had to add a new namespace to the isn array maker script then I got a lot of errors. So I went back and checked for more changes in the documentation.

Second there were a few changes in the Transaction_Complete areas.

I am building out a test now and will report back with the results soon. I will upload the new changed script either way then because I believe it is a step in the right direction.

Note* There was one thing I was uncertain of and I will post the problem if it is one.
Most Recent Published Games:
Juicy Theater - Android

serenefox

  • Full Member
  • ***
  • Posts: 135
    • Serenefox Games
Re: iOS Native Restoring purchases?
« Reply #4 on: April 19, 2015, 05:28:37 PM »
Got it!!! It worked perfectly. I will attach the modified script if anyone needs to restore multiple non consumable in app purchases with iOS native version 5.3 or higher with Playmaker.

This was added:

Code: [Select]
using UnionAssets.FLE;
Due to this:

https://unionassets.com/iosnative/version-5-3-32

Everywhere there was a "Bought_Product" and "Transaction_Failed" it was replaced with "Transaction_Complete" due to this:

https://unionassets.com/iosnative/version-5-1-31

And finally the part of the script that said something like (I can't remember exactly)
Code: [Select]
resp.isSuccess
That was changed to something like:

Code: [Select]
resp.state == iOSResponseKit.state.restored
And I tested this with Unity 4.6.4p2 with the IL2CPP scripting backend and universal build. On an iPad Air 2.

Thanks for the script Jean!
Most Recent Published Games:
Juicy Theater - Android

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: iOS Native Restoring purchases?
« Reply #5 on: April 20, 2015, 11:27:24 AM »
Hi,

 Thanks for this update!

 Bye,

 Jean