1

The problem I'm having is, I cannot figure out how to transfer the user log in token from the main app to the today extension.

So the user opens the app, logs in, and can add data to their profile. If they then pull down the today view from notification center, no user data can be pulled in because the user is not logged in.

My Firebase test project is here: https://bitbucket.org/gilosborne/firebasetest

In this example I am just trying to pull the users email address into the today extension the same way I am in the log in view controller. The button is not hooked up to anything yet.

Using Swift 2.3 with the latest version of Firebase.

Thank you for any help!

FelixSFD
  • 6,052
  • 10
  • 43
  • 117
Gil
  • 173
  • 1
  • 15

1 Answers1

0

I guess you are looking for shared container. Similar question.

Basically you can user NSUserDefaults for storing normal details like name.

You can use SwiftKeychainWrapper to store sensitive details like passwords.

Community
  • 1
  • 1
Mohammad Zaid Pathan
  • 16,304
  • 7
  • 99
  • 130
  • 1
    This would work for displaying data but I would like to be able to write to Firebase as well which I don't think I could do this way without the today extension view actually being logged in. Or are you saying store their username and password into NSUserDefaults and log them in that way? Sorry, I'm pretty new and I don't think I understand the concepts well enough to pull whats relevant out of the other thread you sent. :/ Thank you – Gil Aug 24 '16 at 14:06
  • 1
    I store the credentials or the needed tokens (depends on login method) in the keychain using a keychain wrapper and use them in my share extension. – cybergen Oct 12 '16 at 00:37