debugging - IOS In App Purchase never leaves active state -
I have an app purchase in Swift with hosted content No errors. My download queue is as follows:
function paymentQueue (line: SKPaymentQueue!, UpdatedDownloads download: [AnyObject]) {To: Download showed AnyObject {if degrade: as SKDownload = download? Download encode {switch down downstatestate {case}. Active: NSLog ("active% @% @", down progress, downtime remanning) break case. Canceled: NSLog ("% @", "Cancel download") break case. : NSLog ("% @", "Download Failed") productTitle.text = "Download Failed" break case. End: NSLog ("% @", "Download Finished") var source = down.contentURL.relativePath var path = NSBundle .mainBundle () pathForResource ("Config", ofType: "plist") on dict = NSDictionary (contentsOfFile: source.stringBeeAppendingPathComponent (Path)). If dict.objectForKey ("files") {SKPaymentQueue.defaultQueue () finishTransaction (Down.transaction) return} if if arr = dict ["files"] as? [String] {{to be content to file arrival: String = source.stringByAppendingPathComponent ( "Content") stringByAppendingPathComponent (file) self.copyPathToDocsFolder (source, target material).}} SKPaymentQueue.defaultQueue () finishTransaction (down.transaction .) NSLog ("download full"); ProductTitle.text = "Download Complete"; Break case NSELog ( "% @", "SKDownloadStateWaiting") is the default Breaks: Brake}}}} Adielog ( "% 1", "SKDownloadStatePaused" and said here is my copy method gets copyPathToDocsFolder is never
function. (source: string, target: string) {NSLog (called "copy function") are filemgr: NSFileManager = NSFileManager.defaultManager ( ) Doripth = NSSearchPathForDirectoriesInDomains give (.document.directory, .UserDomainMask, true) [0] as string Docs Dior Derpath; Letpasspath = docsDir.stringByAppendingPathComponent (Goals) var error: NSError? {Filemgr.copyItemAtPath (Source, Sent: Target, Error: and Error)) {NSLog ("Great Success");} Else {NSLog ("Error copying file:");}} I am working on a real, licensed and provisioning tool. When the download rep begins, the representative's statement is active in the first case of the switch statement, but the download progress and the remaining time are both zero Are there. any idea? I really do not know how to debug any errors.
In this case. Statement
at source = down.contentURL.relativePath path = NSBundle.mainBundle () pathForResource ("config", ofType: "plist"). Var dict = NSDictionary (contentsOfFile: source.stringByAppendingPathComponent (path)) should
var source = down.contentURL.relativePath var dict = NSMutableDictionary ( ContentsOfFile: source.stringBeeAppendingPathComponent ("ContentInfo.plist")) NSBundle.mainBundle () is not a business.
Comments
Post a Comment