I’m working on a custom plugin and I’m running into issues with iOS’s Core Data. The intention is to have the plugin write to Core Data so that an app extension I’m writing can read from Core Data. The problem I’m currently facing is that I don’t seem to find the ManagedObjectContext necessary to create the instance of a new Core Data object. Is it possible to access Core Data from a Capacitor Plugin? I can’t seem to find an example of anybody successfully doing it.
Here is the Ionic Info for the main app
These are the dependencies from the package.json for the plugin
“devDependencies”: {
“@capacitor/android”: “^4.0.0”,
“@capacitor/core”: “^4.0.0”,
“@capacitor/docgen”: “^0.0.18”,
“@capacitor/ios”: “^4.0.0”,
“@ionic/eslint-config”: “^0.3.0”,
“@ionic/prettier-config”: “^1.0.1”,
“@ionic/swiftlint-config”: “^1.1.2”,
“eslint”: “^7.11.0”,
“prettier”: “~2.3.0”,
“prettier-plugin-java”: “~1.0.2”,
“rimraf”: “^3.0.2”,
“rollup”: “^2.32.0”,
“swiftlint”: “^1.0.1”,
“typescript”: “~4.1.5”
},
“peerDependencies”: {
“@capacitor/core”: “^4.0.0”
},