本地通知不会出现在iOS中,但它使用Phonegap在Android中工作?

时间:2016-06-24 09:34:41

标签: android ios cordova phonegap-plugins

在Android中它的工作正常,但在iOS中无法正常工作?

我正在使用katzer / cordova-plugin-local-notifications本地通知,因为它在androoid中运行良好,但它在iOS 8中无效。

我的代码在下面

BOOL CMyPropertySheet::PreTranslateMessage(MSG* pMsg) 
{
  switch (pMsg->message)
  {
  case WM_LBUTTONDOWN:
    {
    // here I need to handle if user clicks on page (Tabs)
       // But this is invoking if user clicking  inside page also      

    }

  return CPropertySheet::PreTranslateMessage(pMsg);
}

config.html

<script type="text/javascript" src="local-notification.js"></script>
        <script type="text/javascript">
            app.initialize();
        </script>
        <script>
        document.addEventListener('deviceready', function () {
        cordova.plugins.notification.local.registerPermission(function (granted) {
    //alert('Permission has been granted: ' + granted);
});

cordova.plugins.notification.local.schedule({
    text: "Wake up!",
    sound: "file://sounds/alert.caf",
    every: 30 // every 30 minutes
});

            var now             = new Date().getTime(),
            _5_sec_from_now = new Date(now + 5*1000);

            cordova.plugins.notification.local.schedule({
            text: "Delayed Notification",
            at: _5_sec_from_now,
            led: "FF0000",
            sound: null
            });
            var now                  = new Date().getTime(),
            _10_seconds_from_now = new Date(now + 10*1000);
            _20_seconds_from_now = new Date(now + 20*1000);
            window.plugin.notification.local.add({
            id:      1,
            title:   'Reminder 1',
            message: 'Only 10 Mins Left for parking expires',
            //repeat:  'weekly',
            sound:   "file://sounds/sound.mp3",
            date:    _10_seconds_from_now
            });
            window.plugin.notification.local.add({
            id:      2,
            title:   'Reminder 2',
            message: 'Parking time expires',
            //repeat:  'weekly',
            sound:     @#"file://sounds/sound.mp3",
            date:    _20_seconds_from_now
            });
            window.location="timer.html";
        }, false);

        </script>

我在过去三天试图解决这个问题。请帮我解决这个问题。

0 个答案:

没有答案