Julian Le Calvez
Julian Le Calvez

Reputation: 453

Cordova - Local notifications plugin does not compile on iOS

I'm trying to integrate the local-notification plugin on my cordova app. It work well on my Android version but when I try to compile it on iOS, I get the following error. If I uninstall the plugin, the app compiles on iOS. I tried to remove and re-add the plugin. I tried to remove and re-add the iOS platform. But I still have the same error.

/Users/julianlecalvez/Documents/MyApp/MyApp/platforms/ios/MyApp/Plugins/de.appplant.cordova.plugin.local-notification/APPLocalNotification.m:28:9: fatal error: module 'UserNotifications' not found

@import UserNotifications;

~~~~~~~^~~~~~~~~~~~~~~~~

1 error generated.

** BUILD FAILED **

The following build commands failed: CompileC build/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/i386/APPLocalNotification.o MyApp/Plugins/de.appplant.cordova.plugin.local-notification/APPLocalNotification.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure)

Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/julianlecalvez/Documents/MyApp/MyApp/platforms/ios/cordova/build-debug.xcconfig,-project,MyApp.xcodeproj,ARCHS=i386,-target,MyApp,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/julianlecalvez/Documents/MyApp/MyApp/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/julianlecalvez/Documents/MyApp/MyApp/platforms/ios/build/sharedpch

I checked in the platform folder (platform/ios/MyApp/Plugins/de.appplant.cordova.plugin.local-notification) if the plugin files are copied correctly, and they are! (I have 4 .m files and 4 .h files).

What am I missing ?

Thank you !

Upvotes: 0

Views: 1026

Answers (1)

chmac
chmac

Reputation: 12625

At a guess, you're using the ios10 branch of the plugin. It doesn't work.

I've just successfully tested notifications on both iOS 9 and iOS 10 using this fork instead.

https://github.com/dpalou/cordova-plugin-local-notifications

Upvotes: 0

Related Questions