How do I set “skipLocalNotificationReady” for ionic-native plugin 'Local Notifications'





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I need to set window.skipLocalNotificationReady = true but in an ionic 4 project.



I want to stop the local notification events until the device is ready. Therefore I need to set window.skipLocalNotificationReady = true, according to the plugin.



But in app.component.ts this doesn't work.I get the error, that 'skipLocalNotificationReady' is not part of 'Window'.



Itried cordovaPropertySet() but it tells me, that the plugin is not installed (it is).



constructor(
private localNotifications: LocalNotifications,
) {
//window.skipLocalNotificationReady = true

cordovaPropertySet(
this.localNotifications,
'skipLocalNotificationReady',
true);

this.initializeApp();
}


Is there any workaround or a possibility that cordovaPropertySet() will work?










share|improve this question





























    1















    I need to set window.skipLocalNotificationReady = true but in an ionic 4 project.



    I want to stop the local notification events until the device is ready. Therefore I need to set window.skipLocalNotificationReady = true, according to the plugin.



    But in app.component.ts this doesn't work.I get the error, that 'skipLocalNotificationReady' is not part of 'Window'.



    Itried cordovaPropertySet() but it tells me, that the plugin is not installed (it is).



    constructor(
    private localNotifications: LocalNotifications,
    ) {
    //window.skipLocalNotificationReady = true

    cordovaPropertySet(
    this.localNotifications,
    'skipLocalNotificationReady',
    true);

    this.initializeApp();
    }


    Is there any workaround or a possibility that cordovaPropertySet() will work?










    share|improve this question

























      1












      1








      1








      I need to set window.skipLocalNotificationReady = true but in an ionic 4 project.



      I want to stop the local notification events until the device is ready. Therefore I need to set window.skipLocalNotificationReady = true, according to the plugin.



      But in app.component.ts this doesn't work.I get the error, that 'skipLocalNotificationReady' is not part of 'Window'.



      Itried cordovaPropertySet() but it tells me, that the plugin is not installed (it is).



      constructor(
      private localNotifications: LocalNotifications,
      ) {
      //window.skipLocalNotificationReady = true

      cordovaPropertySet(
      this.localNotifications,
      'skipLocalNotificationReady',
      true);

      this.initializeApp();
      }


      Is there any workaround or a possibility that cordovaPropertySet() will work?










      share|improve this question














      I need to set window.skipLocalNotificationReady = true but in an ionic 4 project.



      I want to stop the local notification events until the device is ready. Therefore I need to set window.skipLocalNotificationReady = true, according to the plugin.



      But in app.component.ts this doesn't work.I get the error, that 'skipLocalNotificationReady' is not part of 'Window'.



      Itried cordovaPropertySet() but it tells me, that the plugin is not installed (it is).



      constructor(
      private localNotifications: LocalNotifications,
      ) {
      //window.skipLocalNotificationReady = true

      cordovaPropertySet(
      this.localNotifications,
      'skipLocalNotificationReady',
      true);

      this.initializeApp();
      }


      Is there any workaround or a possibility that cordovaPropertySet() will work?







      cordova-plugins angular7 ionic-native ionic4






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 20 '18 at 13:49









      dmnkthfxdmnkthfx

      1817




      1817
























          1 Answer
          1






          active

          oldest

          votes


















          0














          enter image description here
          Yes! I have the same problem. After 20 times to try. I see that I call it too late. So I move that line sooner, before call app.component.ts. It is in main.ts.



          you can see the picture or view this:



          // main.ts
          import { enableProdMode } from '@angular/core';
          import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

          import { AppModule } from './app/app.module';
          import { environment } from './environments/environment';

          (<any>window).skipLocalNotificationReady = true;

          if (environment.production) {
          enableProdMode();
          }

          platformBrowserDynamic().bootstrapModule(AppModule)
          .catch(err => console.log(err));


          beside that. You must make sure that you have this function .fireQueuedEvents() because only cordova-plugin-local-notification@0.9.0-beta.3 have that feature:



          enter image description here






          share|improve this answer
























          • Thank you for the answer but it isn't completely working. After updating to beta 3 I tried the things you said but nothing happened when the app was terminated.

            – dmnkthfx
            Jan 7 at 14:01






          • 1





            It worked when i used (<any>window).skipLocalNotificationReady = true; and the ionic-native interface. And I needed to fire the Events in a hasPermisson() promise.

            – dmnkthfx
            Jan 7 at 14:34












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53870013%2fhow-do-i-set-skiplocalnotificationready-for-ionic-native-plugin-local-notific%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          enter image description here
          Yes! I have the same problem. After 20 times to try. I see that I call it too late. So I move that line sooner, before call app.component.ts. It is in main.ts.



          you can see the picture or view this:



          // main.ts
          import { enableProdMode } from '@angular/core';
          import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

          import { AppModule } from './app/app.module';
          import { environment } from './environments/environment';

          (<any>window).skipLocalNotificationReady = true;

          if (environment.production) {
          enableProdMode();
          }

          platformBrowserDynamic().bootstrapModule(AppModule)
          .catch(err => console.log(err));


          beside that. You must make sure that you have this function .fireQueuedEvents() because only cordova-plugin-local-notification@0.9.0-beta.3 have that feature:



          enter image description here






          share|improve this answer
























          • Thank you for the answer but it isn't completely working. After updating to beta 3 I tried the things you said but nothing happened when the app was terminated.

            – dmnkthfx
            Jan 7 at 14:01






          • 1





            It worked when i used (<any>window).skipLocalNotificationReady = true; and the ionic-native interface. And I needed to fire the Events in a hasPermisson() promise.

            – dmnkthfx
            Jan 7 at 14:34
















          0














          enter image description here
          Yes! I have the same problem. After 20 times to try. I see that I call it too late. So I move that line sooner, before call app.component.ts. It is in main.ts.



          you can see the picture or view this:



          // main.ts
          import { enableProdMode } from '@angular/core';
          import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

          import { AppModule } from './app/app.module';
          import { environment } from './environments/environment';

          (<any>window).skipLocalNotificationReady = true;

          if (environment.production) {
          enableProdMode();
          }

          platformBrowserDynamic().bootstrapModule(AppModule)
          .catch(err => console.log(err));


          beside that. You must make sure that you have this function .fireQueuedEvents() because only cordova-plugin-local-notification@0.9.0-beta.3 have that feature:



          enter image description here






          share|improve this answer
























          • Thank you for the answer but it isn't completely working. After updating to beta 3 I tried the things you said but nothing happened when the app was terminated.

            – dmnkthfx
            Jan 7 at 14:01






          • 1





            It worked when i used (<any>window).skipLocalNotificationReady = true; and the ionic-native interface. And I needed to fire the Events in a hasPermisson() promise.

            – dmnkthfx
            Jan 7 at 14:34














          0












          0








          0







          enter image description here
          Yes! I have the same problem. After 20 times to try. I see that I call it too late. So I move that line sooner, before call app.component.ts. It is in main.ts.



          you can see the picture or view this:



          // main.ts
          import { enableProdMode } from '@angular/core';
          import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

          import { AppModule } from './app/app.module';
          import { environment } from './environments/environment';

          (<any>window).skipLocalNotificationReady = true;

          if (environment.production) {
          enableProdMode();
          }

          platformBrowserDynamic().bootstrapModule(AppModule)
          .catch(err => console.log(err));


          beside that. You must make sure that you have this function .fireQueuedEvents() because only cordova-plugin-local-notification@0.9.0-beta.3 have that feature:



          enter image description here






          share|improve this answer













          enter image description here
          Yes! I have the same problem. After 20 times to try. I see that I call it too late. So I move that line sooner, before call app.component.ts. It is in main.ts.



          you can see the picture or view this:



          // main.ts
          import { enableProdMode } from '@angular/core';
          import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

          import { AppModule } from './app/app.module';
          import { environment } from './environments/environment';

          (<any>window).skipLocalNotificationReady = true;

          if (environment.production) {
          enableProdMode();
          }

          platformBrowserDynamic().bootstrapModule(AppModule)
          .catch(err => console.log(err));


          beside that. You must make sure that you have this function .fireQueuedEvents() because only cordova-plugin-local-notification@0.9.0-beta.3 have that feature:



          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 3 at 9:03









          Trần Quang HiệpTrần Quang Hiệp

          1,179914




          1,179914













          • Thank you for the answer but it isn't completely working. After updating to beta 3 I tried the things you said but nothing happened when the app was terminated.

            – dmnkthfx
            Jan 7 at 14:01






          • 1





            It worked when i used (<any>window).skipLocalNotificationReady = true; and the ionic-native interface. And I needed to fire the Events in a hasPermisson() promise.

            – dmnkthfx
            Jan 7 at 14:34



















          • Thank you for the answer but it isn't completely working. After updating to beta 3 I tried the things you said but nothing happened when the app was terminated.

            – dmnkthfx
            Jan 7 at 14:01






          • 1





            It worked when i used (<any>window).skipLocalNotificationReady = true; and the ionic-native interface. And I needed to fire the Events in a hasPermisson() promise.

            – dmnkthfx
            Jan 7 at 14:34

















          Thank you for the answer but it isn't completely working. After updating to beta 3 I tried the things you said but nothing happened when the app was terminated.

          – dmnkthfx
          Jan 7 at 14:01





          Thank you for the answer but it isn't completely working. After updating to beta 3 I tried the things you said but nothing happened when the app was terminated.

          – dmnkthfx
          Jan 7 at 14:01




          1




          1





          It worked when i used (<any>window).skipLocalNotificationReady = true; and the ionic-native interface. And I needed to fire the Events in a hasPermisson() promise.

          – dmnkthfx
          Jan 7 at 14:34





          It worked when i used (<any>window).skipLocalNotificationReady = true; and the ionic-native interface. And I needed to fire the Events in a hasPermisson() promise.

          – dmnkthfx
          Jan 7 at 14:34




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53870013%2fhow-do-i-set-skiplocalnotificationready-for-ionic-native-plugin-local-notific%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          'app-layout' is not a known element: how to share Component with different Modules

          android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

          WPF add header to Image with URL pettitions [duplicate]