jeudi 12 novembre 2020

How to create an app/share extension in iOS similar to Instapaper page saver in iOS

I'm working on an iOS app for saving and watching URLs for changes on webpages. The app is complete and I'm trying to implement a share extension so users can simply save a webpage they are looking at, similar to how Instapaper's extension you can tap share in iOS Safari and tap Instapaper. This requires the user to already be signed into the main app first. I've been trying to get Realm and Firebase/Firestore integrated with my extension via cocoapods but running into a lot of compile issues. I wanted to do a sanity check and ask if there's a best practice for how to have extensions interact with a cloud database.

  1. Use coredata/userdefaults to save an object with necessary data into app group for main app to handle after the fact (or as a background task?)
  2. Share login/auth information from main app into extension and have it write directly to the DB (what I'm trying to accomplish now)
  3. Some other design pattern I'm not aware of

Aucun commentaire:

Enregistrer un commentaire