Hey @ido,
I just updated Xcode to version 9.2 and the CocoaPods Pod File in my Xcode project ( which is written in Swift) to use:
pod ‘Particle-SDK’
pod ‘ParticleSetup’
instead of
pod ‘Spark-SDK’
pod ‘SparkSetup’
After going through and updating all the code inside the project everything is running fine in the simulator, but when I try to build the app on my iPhone, I am getting a strange crash and wondered if anyone could shed any light on this issue.
This crash is occuring directly after entering my login information into the ParticleSetupMainController and clicking login.
I redacted a couple spots, but you should still be able to see the what im doing. Here are my login functions, which work fine in the simulator, but crash on the iPhone. I a
func mySparkCloudLogin(){
self.customMyCarSetup()
guard let setupController = ParticleSetupMainController.init(authenticationOnly: true) else{return}
setupController.delegate = self
self.present(setupController, animated: true, completion: nil)
}
func customMyCarSetup(){
let custom = ParticleSetupCustomization.sharedInstance()
custom!.brandName = "Some Brand"
custom!.allowPasswordManager = true
custom!.brandImage = nil //brandImage
//custom!.productImage = UIImage(named: "my app icon product image")
//custom!.pageBackgroundImage = UIImage(named: "checkered flag")
custom!.linkTextColor = UIColor.white
//custom?.normalTextFontName = "Gotham-Medium"
//custom?.boldTextFontName = "Gotham-Medium"
//custom?.headerTextFontName = "Verdana"
custom!.lightStatusAndNavBar = true
custom!.tintSetupImages = true
custom!.normalTextColor = UIColor.white
custom!.brandImageBackgroundColor = UIColor(red: 0.1, green: 0.1, blue: 0.1, alpha: 0.25)
custom!.elementTextColor = UIColor.black//(red: 0.098, green: 0.859, blue: 0.435, alpha: 1.0)
custom!.elementBackgroundColor = .red
custom!.modeButtonName = "Reset"
//electron
custom!.productMode = true
custom!.productName = "Some App"
custom!.productId = 0000
let keys = xxxxx()
ParticleCloud.sharedInstance().oAuthClientId = keys.oAuthClientId
ParticleCloud.sharedInstance().oAuthClientSecret = keys.oAuthSecret
}
Error:
2017-12-06 16:41:06.606189-0800 [1350:369413] *** Assertion failure in -[KeychainItemWrapper writeToKeychain], /Users/s /Pods/Particle-SDK/Pod/Classes/Helpers/KeychainItemWrapper.m:328
2017-12-06 16:41:06.607290-0800 [1350:369413] *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Couldn’t add the Keychain Item.’
*** First throw call stack:
(0x18397e364 0x182bc4528 0x18397e238 0x1843197f4 0x1055a04f0 0x10559f934 0x1055b4bf0 0x1055b44f4 0x1055a24cc 0x104fcb3f8 0x104fed8a0 0x1063b12cc 0x1063b128c 0x1063b5c20 0x183926544 0x183924120 0x183843e58 0x1856f0f84 0x18cec367c 0x1046c4fa0 0x18336056c)
libc++abi.dylib: terminating with uncaught exception of type NSException
Keychain Sharing is on