Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - Downloading from Apple server after inapp purchase

In iOS6, we have new feature to place the content on Apple Server so that after successful purchase, the content can be downloaded and use it appropriately.
I'm able to make the purchase successfully and when downloading the content, it stops at 75%.
I tried with different purchases and different content placed on apple server. but it stops at 75%... dont know why. I'm using the following delegate method to track the download progress:

-(void)paymentQueue:(SKPaymentQueue *)queue updatedDownloads:(NSArray *)downloads
{
    for (SKDownload *download in downloads)
    {
        switch (download.downloadState) {
            case SKDownloadStateActive:
                NSLog(@"Download progress = %f and Download time: %f", download.progress, download.timeRemaining);
                break;
            case SKDownloadStateFinished:
                NSLog(@"%@",download.contentURL);
                break;
            default:
                break;
        }
    }
}

Its never reaching "SKDownloadStateFinished"
Has any one faced similar issue. if yes, what's the resolution?

like image 658
Satyam Avatar asked Dec 29 '12 10:12

Satyam


People also ask

How long does it take for Apple to process an in-app purchase?

First, we'd like to say that you can double-check by adding up the pending transactions to verify there's enough money in your account to cover them. Also, remember that purchases can take 1-3 days, sometimes more, to clear with the bank. Pending means, it has not been charged to your bank account yet.

Why is my App Store stuck on downloading?

Refresh your Apple ID In the options that pop-up, select “Sign Out“. Once done, reboot your iPhone and then head back to the same page and sign back into the App Store through your Apple ID. Once done, open the App Store and start downloading apps and they should start like normal.

Why is my app stuck on downloading on iPhone?

A lot of the time when apps are stuck waiting or not downloading on your iPhone, there's an issue with your Apple ID. Every app on your iPhone is linked to a specific Apple ID. If there's an issue with that Apple ID, apps may get stuck. Usually, signing out and back into the App Store will fix the problem.

Why is my in-app purchase not working?

Restart the device Tap Power off or Restart (depending on your device this text may be different). If needed, hold down the power button again to turn the device back on. Wait for the device to start back up. Re-open the app or game and check if the in-app purchase has been delivered.


2 Answers

It wont work on simulator. The same code works perfect on Device.

like image 97
Satyam Avatar answered Sep 20 '22 01:09

Satyam


Well, looks like after all it's not supported:

http://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-6_0/

"

Simulator

For this release, iOS Simulator does not support testing In-App Purchase. Please use a device to test your apps that use this feature.

"

And it's still not supported on 6.1:

http://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-6_1/

like image 45
Adri Avatar answered Sep 21 '22 01:09

Adri