weixin_39968128
2021-01-06 07:25 阅读 6

Sencha Touch integration

Hi,

I'm trying to integrate this plugin in to a Cordova based Sencha Touch app but when compiling it is causing an error when trying to load the necessary files of your plugin.

From what I can work out, it is looking for two files, APPLocalNotification.m and APPLocalNotification.o but they cannot be found. Other Cordova plugins work as expected and compile properly.

I have also posted this on Sencha's forum if you'd like a bit more explanation http://www.sencha.com/forum/showthread.php?279613-Native-build-plugin-dependancy-problem

该提问来源于开源项目:katzer/cordova-plugin-local-notifications

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • weixin_39968128 weixin_39968128 2021-01-06 07:25

    Forget the mention of the .m and .o files. I think I've managed to pinpoint the error. It's throwing up errors for unknown variables in this block of the AppLocalNotification.m..

    (NSMutableDictionary_) repeatDict { NSMutableDictionary_ repeatDict = [[NSMutableDictionary alloc] init]; / [repeatDict setObject:[NSNumber numberWithInt:NSCalendarUnitHour] forKey:@"hourly"]; [repeatDict setObject:[NSNumber numberWithInt:NSCalendarUnitDay] forKey:@"daily"]; [repeatDict setObject:[NSNumber numberWithInt:NSWeekCalendarUnit] forKey:@"weekly"]; [repeatDict setObject:[NSNumber numberWithInt:NSCalendarUnitMonth] forKey:@"monthly"]; [repeatDict setObject:[NSNumber numberWithInt:NSCalendarUnitYear] forKey:@"yearly"]; [repeatDict setObject:[NSNumber numberWithInt:0] forKey:@""]; / return repeatDict; }

    It doesnt know what NSCalendarUnitHour,NSCalendarUnitDay,NSCalendarUnitMonth,NSCalendarUnitYear are. Commenting out this block allows the app to compile successfully.

    点赞 评论 复制链接分享
  • weixin_39581719 weixin_39581719 2021-01-06 07:25

    Hello,

    because I develop and test the plugin within a Sencha Touch app, sencha app build -run native works well with that plugin.

    Maybe a framework or library is missing. The constants are defined through the Foundation framework (NSCalendar.h) But I had never to import them by myself.

    Is your problem fixed if you add the additional header?

     c
    #import <foundation> 
    </foundation>
    点赞 评论 复制链接分享
  • weixin_39968128 weixin_39968128 2021-01-06 07:25

    For a completely unrelated matter I had to upgrade my OS from Snow Leopard to Mavericks and annoyingly, this problem is now non existent. That upgrade did also include an upgrade of XCode from 4.6 to 5 so I guess it just compiles slightly differently? I'm not sure.

    Anyway, everything is now working beautifully.

    点赞 评论 复制链接分享
  • weixin_39581719 weixin_39581719 2021-01-06 07:25

    Sometimes I have that issues with Xcode too.

    点赞 评论 复制链接分享

相关推荐