In-App purchases with SDK 1.7.2, TiStoreKit 1.0 and iOS 4.3.5

You must Login before you can answer or comment on any questions.

Is there anybody who can confirm that the In-App purchases should work (or not) in the mentioned configuration?

All I get is an "unable to connect" error message (localised, so not exactly this) after a few minutes.

11 Answers

Hi Kristof,

do not know if this setting works, but I have troubles connecting all day long with 1.6.2. So, I think maybe there is some issue somewhere, not depending from your setup

— answered 3 years ago by Bruno Mandolesi
answer permalink
2 Comments
  • Thanks for your answer! Have you found any workarounds?

    — commented 3 years ago by Kristof Gruber

  • no, got crazy for a few hours, I am waiting for support in the helpdesk. But even the official appcelerator example is not working ...

    — commented 3 years ago by Bruno Mandolesi

I'm using SDK 1.7.2, TiStoreKit 1.0 and iOS 4.3.3 and am too experiencing IAP timing out, so think it must be Apple sandbox end.

— answered 3 years ago by Gary Crook
answer permalink
6 Comments
  • So, can we do anything on our side?

    — commented 3 years ago by Bruno Mandolesi

  • I am also experiencing it outside the sandbox, in the AppStore version. It is very urgent for me to have this fixed as soon as possible.

    — commented 3 years ago by Kristof Gruber

  • Well I'm handling it by first of all disabling the control that fires the purchase (a table in my case - I set touchEnabled = false) so the user can't keep invoking the purchase. And I show an activity indicator to let them know something is actually happening.

    I then basically follow the example ti.storekit code and show an alert to the user in the Ti.Storekit.purchase callback function when r.state == Ti.Storekit.FAILED

    — commented 3 years ago by Gary Crook

  • Show 3 more comments

Also has anyone else seen their app crash out while using ti.storekit? I get 'Job appears to have crashed: Segmentation fault: 11' in iPhone Configuration Utility console output.

Good news: I got it working. It seems somebody fixed something on some :) server side, so 1.7.x builds get constantly crashing. And there is also a fix for the crash: building with Titanium SDK 1.6.3 (you can download it from http://builds.appcelerator.com.s3.amazonaws.com/mobile/1_6_X/mobilesdk-1.6.3-20110524190802-osx.zip ) makes the whole thing working again. \o/

— answered 3 years ago by Kristof Gruber
answer permalink
2 Comments
  • I see there's now v1.1 of ti.storekit available - I was using v1.0 so hopefully this has fixed crashes with SDK 1.7.2

    — commented 3 years ago by Gary Crook

  • Please let me know if it works or not.

    — commented 3 years ago by Kristof Gruber

I downloaded the Titanium SDK 1.6.3, but don't know how to install it, the latest SDK that I have now is 1.6.2.

I have version 1.2 of TiStorekit, and still the app crashes on device, but before it crashes it shows me an empty table view (supposed to hold the in-app purchase products), then after couple of seconds the app crashs. Knowing that I compiled it with Titanium SDK 1.6.3 as was advised here. I don't even know if it is due to apple's end, so I uploaded my app yesterday to wait and see after approval if the issue will be resolved as my in-app purchases products are still under review. I'll update you here guys of what I shall experience too as i never found a satisfying answer yet to resolve the crashing issue here.

1.7.3 SDK worked for me with TiStorekit version 1.2; no crashes now when testing on device; however, I get an empty table ! and the following error: Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo=0x686c420 {NSLocalizedDescription=Cannot connect to iTunes Store}. I have a test user account. I wonder if it will be resolved when the app is approved in the app store. I'll hope so.

Just tried with 1.7.3 SDK and TiStorekit 1.2 - I don't get a crash now either, but after tapping Buy button it's eventually coming back with this in iPhone Config Utility console:

calling finish transaction for <SKPaymentTransaction: 0x32c1d0>
 
[ERROR] Invalid type passed to function. expected: TiBlob, was: NSDictionary  in -[TiStorekitModule verifyReceipt:] (TiStoreKitModule.m:103)
 
[WARN] Exception in event callback. {
line = 23;
message = "Invalid type passed to function. expected: TiBlob, was: NSDictionary  in -[TiStorekitModule verifyReceipt:] (TiStoreKitModule.m:103)";
sourceId = 54965304;
sourceURL = "file://localhost/var/mobile/Applications/62568710-57C1-4A06-8B96-786D61B60958/XXX.app/lib/ui.js";
}

— answered 3 years ago by Gary Crook
answer permalink
6 Comments
  • Can you paste here your corresponding code fragment?

    — commented 3 years ago by Kristof Gruber

  • Sure. The payment is invoked as the result of a click event on a table row. I think the problem is around the r.receipt that comes back not being of the correct type:

    viewTablePaymentOptions.addEventListener('click', function(e) 
        {
            viewTablePaymentOptions.touchEnabled = false;
            indicator.show();
            var product = e.row.product;
     
            Ti.Storekit.purchase(product, function(r) 
                {
                    if (r.state == Ti.Storekit.FAILED) {
                        Ti.UI.createAlertDialog(
                            {
                                title: 'Subscription Purchase',
                                message: 'Your purchase was not completed this time.'
                            }
                        ).show();
                        viewTablePaymentOptions.touchEnabled = true;
                        indicator.hide();
                    }
                    else if (r.state == Ti.Storekit.PURCHASED || r.state == Ti.Storekit.RESTORED) {
                        var receipt = r.receipt;
                        Ti.Storekit.verifyReceipt(receipt, function(e) {
                            if (e.success) {
                                if (e.valid) {
                                    App.Properties.setSubscriptionIsActive(true);
                                    App.Properties.setSubscriptionExpiryDate();
                                    labelSubscription.text = 'Subscription expires in ' + getExpiryDays() + ' days';
                                    Ti.UI.createAlertDialog(
                                        {
                                            title: 'Successful Purchase',
                                            message: 'Congratulations, your purchase receipt has been verified.\n\nMany thanks for extending your subscription.'
                                        }
                                    ).show();
                                }
                                else {
                                    Ti.UI.createAlertDialog(
                                        {
                                            title: 'Purchase Error',
                                            message: 'Unfortunately, purchase receipt verification failed.'
                                        }
                                    ).show();
                                }
                            }
                            else {
                                Ti.UI.createAlertDialog(
                                    {
                                        title: 'Purchase Error',
                                        message: 'Unfortunately, there was a problem verifying your purchase receipt: ' + e.message
                                    }
                                ).show();
                            }
                            viewTablePaymentOptions.touchEnabled = true;
                            indicator.hide();
                        }, true);
                    }
                    else {
                        Ti.API.info('Purchasing...');
                    }
                }
            );
        }
    );

    — commented 3 years ago by Gary Crook

  • What is your e.row.product variable's value?

    — commented 3 years ago by Kristof Gruber

  • Show 3 more comments

Can some body send me a link to the older version of TiStorekit 1.1 to test it compared to the 1.1 please

thank you for the 1.1 tistorekit. ONE IMPORTANT question to ask, do we need the APNs SSL certificate for in-app purchase apps (testing and deployment)? or is the normal certificate is suffecient!

— answered 3 years ago by Talal Manaa
answer permalink
1 Comment
  • I've never used the APNs SSL cert. and it has nothing to do with IAP to my knowledge - it's for allowing the app to register itself for push notifications. I've always been able to successfully complete a test IAP in the sandbox.

    — commented 3 years ago by Gary Crook

did anyone figure out that 1.2 problem? i am having that same problem now with

Invalid type passed to function. expected: TiBlob, was: NSDictionary in -[TiStorekitModule verifyReceipt:] (TiStoreKitModule.m:103)

— answered 3 years ago by d b
answer permalink
1 Comment
  • No, I just stuck with 1.1 and SDK 1.7.3 - seems stable.

    — commented 3 years ago by Gary Crook

Your Answer

Think you can help? Login to answer this question!