问题
An app I am working on needs a Today Extension / Widget. Are there any resources on how to build one into an Cordova app?
I found this, but it's not written very clearly and from what I understood seems to be a native app that only uses a HTML5 element in the app and widget to display some data :/
回答1:
Yes you are right, today extension are a native thing. I recently also did a lot of research on how to integrate one into a cordova project dynamically and ended up creating my own cordova-plugin for that. You can find it here, maybe it will be useful for you too! Nevertheless you will have to implement the widget in Swift.
The plugin takes an already developed widget and integrates it in an cordova-ios project on every cordova platform add ios
using a hook which parses and modifies the project.pbxproj via the help of cordova-node-xcode.
来源:https://stackoverflow.com/questions/43172101/how-to-build-a-today-widget-app-extension-with-cordova