Can a custom keyboard extension communicate with the companion app at runtime?

痞子三分冷 提交于 2019-12-13 09:04:39

问题


Can a custom keyboard communicate with the companion app at runtime? Can a custom keyboard dynamically display content based on states set in the companion app?

If so, what API’s/documentation is available for this communication between the extension and app?


回答1:


Here is a nice paragraph from the documentation that could get you started in sharing data with your companion app: https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW6

I have this working with a today extension and the companion app. They both share the same NSUserDefaults so they can communicate in real time each other. If NSUserDefaults is what you're looking for, here there is a nice tutorial: http://www.glimsoft.com/06/28/ios-8-today-extension-tutorial/



来源:https://stackoverflow.com/questions/24943657/can-a-custom-keyboard-extension-communicate-with-the-companion-app-at-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!