matthewpalmer / Locksmith

A powerful, protocol-oriented library for working with the keychain in Swift.
MIT License
2.92k stars 266 forks source link

Today extension update data only save in extension service #187

Closed hhgz9527 closed 6 years ago

hhgz9527 commented 6 years ago

I has been open keychain sharing, both set same group id.

  1. Today extension call updateData(data:, forUserAccount:, inService)
  2. inService is app bundle id
  3. Launch app, call readFromSecureStore() data not update.

How to update data in today extension?

hhgz9527 commented 6 years ago

I've solved the problem.

Add access group is success save data in today extension.


All step:

  1. Keep two target keychain sharing group id same.
  2. Add access group id. https://github.com/matthewpalmer/Locksmith/issues/165#issuecomment-352540577 (appGroupID is AppIdentifierPrefix, you can go to developer web site, in app ids find this prefix.)
  3. Use same service. https://github.com/matthewpalmer/Locksmith/issues/174#issuecomment-339741645
  4. Now you can load and update data in extension, sync to you main app.