iOS - Downloading from Apple server after inapp purchase

十年热恋 提交于 2019-12-09 03:34:44

问题


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?


回答1:


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




回答2:


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/



来源:https://stackoverflow.com/questions/14080791/ios-downloading-from-apple-server-after-inapp-purchase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!