0

my app is based on UILocalnotification actions. it has 2 action buttons, one of then use a method that get data from Core Date, modify and save it. Also, i use SSKeychain to store user's token. And the problem is with that, if the app is closed and calls a notification action this method is called on AppDelegate

func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification)

to handle notification action, and in this method i do the stuff with Core Data (get, modify and save), it's working fine. But when open the app after that, the SSKeychain don't find any user's token, it only happens on the first time, if i close the app and open it again, works fine.

UPDATE the problem is not only with SSKeychain, i changed the framework and now happen the same thing with Core Data. get, modify and save with notification action; open the app and nothing of that action was saved; close the app and open again, and the notification action changes appear.

  • Not sure since there is no actual code, but it sounds like your object is not initialized before the first time it saves, but it gets initialized after you do it again. Check to make sure nothing is nil on that first action – Knight0fDragon Oct 13 '15 at 00:52
  • Is the device locked during the test? Does it have a pin code? Is the keychain accessible at all?? – Wain Oct 13 '15 at 06:49
  • yes, was locked with passcode. i solved the problem with keychain changing the framework (but, i prefer SSKeychain), now the problem is with Core Data, i was think about some kind of cycle that not happens with app closed, but i don't know nothing yet. – Lucas Marçal Oct 13 '15 at 08:49

0 Answers0