2

I followed this tutorial for creating a today view extension. It works for a native Xcode 7.3 iOS 9 based app but when I try to follow the same steps for Cordova app. I get build error.

/Users/MAC/Desktop/RWS/RAD/[CORDOVA_APP_NAME]/platforms/ios/[CORDOVA_APP_NAME]/Bridging-Header.h:28:9: note: in file included from /Users/MAC/Desktop/RWS/RAD/[CORDOVA_APP_NAME]/platforms/ios/[CORDOVA_APP_NAME]/Bridging-Header.h:28:
#import <Cordova/CDV.h>
        ^
/Users/MAC/Library/Developer/Xcode/DerivedData/[CORDOVA_APP_NAME]-ggabeceockqrdjbqfzogiakufhxo/Build/Products/Debug-iphonesimulator/include/Cordova/CDV.h:20:9: note: in file included from /Users/MAC/Library/Developer/Xcode/DerivedData/[CORDOVA_APP_NAME]-ggabeceockqrdjbqfzogiakufhxo/Build/Products/Debug-iphonesimulator/include/Cordova/CDV.h:20:
#import "CDVAvailability.h"
        ^
/Users/MAC/Library/Developer/Xcode/DerivedData/[CORDOVA_APP_NAME]-ggabeceockqrdjbqfzogiakufhxo/Build/Products/Debug-iphonesimulator/include/Cordova/CDVAvailability.h:20:9: error: 'CDVAvailabilityDeprecated.h' file not found
#import "CDVAvailabilityDeprecated.h"
        ^
<unknown>:0: error: failed to import bridging header '/Users/MAC/Desktop/RWS/RAD/[CORDOVA_APP_NAME]/platforms/ios/[CORDOVA_APP_NAME]/Bridging-Header.h'
Akshay Shinde
  • 35
  • 1
  • 7

3 Answers3

2

I recently solved this by creating a cordova-plugin which adds a (already implemented) today widget to the cordova-ios project: see my answer here

David
  • 7,387
  • 3
  • 22
  • 39
  • I apologise for late reply. I was not able to solve this at the time. The requirements changed, so did not get back to this. I will mark this as answer based on upvotes. – Akshay Shinde Aug 03 '17 at 12:02
1

I was able to solve the above issues by adding the Foundation.framework and lib.Cordova.a to "Link Binary With Libraries" in the Build Phases. Make sure you select the Today Widget Extension as target when doing so. See the following screenshot: https://i.stack.imgur.com/dSQxG.png

mahnuh
  • 11
  • 2
0

I guess that you are using Cordova file plugin. I think It is currently impossible to write today extension with swift language, because this plugin is written in C-objective language and it's not compatible with swift. When I try to add today in C-objective I don't get this error.

Gregory
  • 1
  • 1