Ios 本地通知应用程序崩溃模拟器

Ios 本地通知应用程序崩溃模拟器,ios,cordova,plugins,ionic-framework,Ios,Cordova,Plugins,Ionic Framework,我将本地通知插件与ng cordova一起用于爱奥尼亚项目: 这是我的控制器: .controller('DashCtrl', function($scope, $state, $cordovaLocalNotification) { $scope.addNotification = function() { $cordovaLocalNotification.add({ id: 'some_notification_id'

我将本地通知插件与ng cordova一起用于爱奥尼亚项目:

这是我的控制器:

.controller('DashCtrl', function($scope, $state, $cordovaLocalNotification) {
    $scope.addNotification = function() {
        $cordovaLocalNotification.add({
            id: 'some_notification_id'
                // parameter documentation:
                // https://github.com/katzer/cordova-plugin-local-notifications#further-informations-1
        }).then(function() {
            console.log('callback for adding background notification');
        });
    };
    $scope.checkIfIsTriggered = function() {
        $cordovaLocalNotification.isTriggered('some_notification_id').then(
            function(isTriggered) {
                alert('isTriggered');
            });
    };
})
我在默认视图上有一个按钮,当应用程序以ng单击启动时加载该按钮,如下所示:

  <button ng-click="addNotification();" class="button button-stable">button-stable</button>
是否有人在ng cordova文档之后使用它,或者是否有其他方法我应该尝试


谢谢你

如果你仍然有这个问题,我今天也遇到了

进入插件代码,Xcode中的APPLocalNotifications.m,并将这一行更改为底部:

NSString*notId=[[notification.userInfo objectForKey:@id] 字符串值]

并将其替换为:

NSString*notId=[notification.userInfo objectForKey:@id]


这对我今天起作用了

您使用的Cordova版本是什么?如果你有旧的3.5.0-安装新的oneHi,我使用的是4.0。我现在在ios7之前的ios8中尝试它,即使它不工作,应用程序也不再崩溃。我会继续挖。谢谢你!我对cordova 4.1.2也有类似的问题,@Werbower回答帮助了我。为我工作,谢谢!也许在插件站点上记录问题,或者请求修复程序?@Werbower您在哪里更改的?我已经更新了文件/plugins/de.appplant.cordova.plugin.local notification/APPLocalNotification.m,但是当我通过xcode在手机上运行应用程序时,同样的错误出现,并且调试器中的代码行显示不变。@我会在xcode中的plugins->APPLocalNotification.m的第514行中更改此项吗。不确定它是否是相同的行号,但它位于注释下,表示通过其ID检索本地通知。希望这有帮助。@Werbower-确实如此,谢谢。在我花了很多时间追查这件事之后,我终于收到了一份回复表,上面有一些其他的bug和ngcordova插件问题。“耶!”威尔太棒了,很高兴听到这个消息!
: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-     [__NSCFString stringValue]: unrecognized selector sent to instance 0x7a840850'
*** First throw call stack:
(
0 CoreFoundation 0x002cc1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x023848e5 objc_exception_throw + 44
2 CoreFoundation 0x00369243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x002bc50b forwarding + 1019
4 CoreFoundation 0x002bc0ee CFforwarding_prep_0 + 14
5 new 0x0011f917 -[APPLocalNotification notificationWithId:] + 503
6 new 0x0011f6a6 -[APPLocalNotification isNotificationScheduledWithId:] + 86
7 new 0x0011bccf __28-[APPLocalNotification add:]blockinvoke + 207
8 libdispatch.dylib 0x0293d7b8 dispatchcall_block_and_release + 15
9 libdispatch.dylib 0x029524d0 dispatchclient_callout + 14
10 libdispatch.dylib 0x02940eb7 dispatchroot_queue_drain + 291
 11 libdispatch.dylib 0x02941127 dispatchworker_thread2 + 39
12 libsystem_pthread.dylib 0x02c89dab pthreadwqthread + 336
13 libsystem_pthread.dylib 0x02c8dcce start_wqthread + 30
)
 Oct 19 11:54:21 xxxx-MacBook-Air.local backboardd[27466] : Application    'UIKitApplication:com.ionicframework.new903016[0xde04]' exited abnormally with signal 6: Abort trap: 6"