ios : iap failed

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

ios : iap failed

#1 Post by Jibus »

I used the latest version of Renpy in order to have the waiting screen when purchasing iap products.

I notice that the purchasing is not working anymore for me :

- Tap on the button to purchase the product (non-consommable product)
- Waiting screen
- Login screen
- Login successful
- Confirm purchase
- Purchase confimed by iTunes

Then loop to the screen where the user is invited to purchase the item. In the xcode console log, I have : Failed name_of_the_product.

I notice that restoring the purchase work. Meaning that the purchase seems to be made.

Any idea ?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: ios : iap failed

#2 Post by PyTom »

That's weird. I checked the code, and it looks like that can only print in one place - if a transaction reports itself as failed. You do need to be sure you're not purchasing two products (or the same product) twice in a row - that would likely cause the error.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: ios : iap failed

#3 Post by Jibus »

When you said not purchasing the same product twice in a row, you mean if iTunes said that i have already purchased the item, and i buy it again, it wont work ?

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: ios : iap failed

#4 Post by Jibus »

Here is the code :

In iap.rpc

Code: Select all

init:
    $ iap_chapter2 = iap.register(product = "iap_chapter2", identifier = "com.XXXXXX.XXXXXX.iap_chapter2", google = "iap_chapter2", ios = "iap_chapter2")
    

Below is the code to access to the iap product

Code: Select all

    label iap_chapter2:
        if iap.has_purchased("iap_chapter2") or iap.has_purchased("iap_chapter2_ipad"):
            jump chapter2
        else:
            jump ad_chapter2

    label ad_chapter2:
        s "{i}Continue the Story...{/i}"
        menu:
            "Continue":
                $ iap.purchase("iap_chapter2")
                jump iap_chapter2
            "I already bought this item":
                $ iap.restore()
                jump iap_chapter2
            "Return to the main menu":
                call screen main_menu

Code: Select all

    label chapter2:
        if not iap.has_purchased("iap_chapter2") and config.developer == False:
            jump iap_chapter2
        window show
        $ s = " "
        s "{i}…{/i}"

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: ios : iap failed

#5 Post by Jibus »

I just upgraded xcode, i have still the problem but the error Failed name_of_the_product doesn't appear anymore.

When i use the restore function, it restores all the iap i have made during the session.

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: ios : iap failed

#6 Post by Jibus »

Sorry to bump on this, but i still can't figure out whats wrong here.

I can't revert to the previous version of renpy, since one my app has been refused because there is not dialog screen when purchasing.

The purchase seems to work, but the loop continue. The only way is puchase then restore.

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: ios : iap failed

#7 Post by Jibus »

Updated to the latest version of xcode (7.2), the problem remains.

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: ios : iap failed

#8 Post by Jibus »

Little update in this. I decided to rollback to Ren'Py 6.99.6 in order to test the inapp purchase. And it's working.

In order to have the processing message, I just manually updated the IAPHelper file. I have just included the UI Alert part.

I still don't now why it's not working on 6.99.7.

PS : this thread should be moved in the Ren'Py Questions and Announcements section.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: ios : iap failed

#9 Post by PyTom »

Can you send a diff?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: ios : iap failed

#10 Post by Jibus »

Yes !
Attachments
diff.txt
Diff IAPHelper.m
(1 KiB) Downloaded 88 times

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: ios : iap failed

#11 Post by PyTom »

Did you make any changes to 00iap.rpy?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: ios : iap failed

#12 Post by Jibus »

I didn't made any modification except on the IAPHelper file.

I use the renios version shipped with 6.99.6

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: ios : iap failed

#13 Post by PyTom »

Can you try with the new 6.99.8 prerelease. I think it fixes the (rather boneheaded) problem.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Jibus
Regular
Posts: 135
Joined: Tue May 26, 2015 9:45 am
Contact:

Re: ios : iap failed

#14 Post by Jibus »

Sorry for the long reply. Yes it's working fine now. Thank you !

Post Reply

Who is online

Users browsing this forum: No registered users