ios - Error Domain=SSErrorDomain Code=0 "Cannot connect to iTunes Store" -


i'm getting nuts error. please have exact @ error message! it's "sserrordomain" not "sk..." in combination code=0. wasn't able find same issue anywhere on net far. people seem have either sserrordomain code=2 or skerrordomain code=0. combination described , nothing helped far.

ok, here's try: app working fine without in-app since 1st january available on store. i've added in-app purchases app. try test them above error. not try ask me test user or anything.

i'm absolutely sure, i'm logged out of store, working on real device , did other tests (many times) find on net. nothing! still "cannot connect..."

i've checked things described here ray wenderlichs in-app tutorial. i've created new app scratch tutorial. same problem. waiting several days didn't either.

i've done things described here cannot connect itunes in baker factory. can guess result.

here's code. start called in viewdidload():

internal class inapp : nsobject, skproductsrequestdelegate, skpaymenttransactionobserver { private var request: skproductsrequest!  // start communication apple store retrieve list of available products internal func start() {     if let url = nsbundle.mainbundle().urlforresource("inappproducts", withextension: "plist") {         if let productids = nsarray(contentsofurl: url) {             nslog("inapp: product-id \(productids)")             skpaymentqueue.defaultqueue().addtransactionobserver(self)             request = skproductsrequest(productidentifiers: set(arrayliteral: productids))             request.delegate = self             request.start()             nslog("inapp: request started")        }     } } 

the log prints 2 product id's, read plist, correctly. log shows "request started". after calls directly error routine:

    internal func request(request: skrequest!, didfailwitherror error: nserror!) {     nslog("error: decription: \(error!.description), reason: \(error!.localizedfailurereason), options: \(error!.localizedrecoveryoptions), suggestion: \(error!.localizedrecoverysuggestion)") } 

i'm using xcode 6.3 , iphone 6 ios 8.3. gamecenter iadbanner , other features work perfectly.

any any suggestions, @ , do, highly welcome!

finally found it. it's duplicate of one: swift cannot connect itunes.

here's code snippet i've changed: old/wrong:

            if let url = nsbundle.mainbundle().urlforresource("inappproducts", withextension: "plist") {             if let productids = nsarray(contentsofurl: url) {                 let request = skproductsrequest(productidentifiers: set(arrayliteral: productids))                 request.delegate = self                 request.start()                 return true             }         } 

new/right:

            if let url = nsbundle.mainbundle().urlforresource("inappproducts", withextension: "plist") {             if let productids = nsarray(contentsofurl: url) {                 var set = set<string>()                 productid in productids {                     if let productid = productid as? string {set.insert(productid string)}                 }                 log("inapp: product-id \(productids) = \(set))")                  let request = skproductsrequest(productidentifiers: set)                 request.delegate = self                 request.start()                 return true             }         } 

basically, made mistake in reading plist stored in set 1 object, containing 2 strings. set of 2 strings.

in end "interesting" error message not being able init request @ all!


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -