当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript LocalNotifications.schedule方法代码示例

本文整理汇总了TypeScript中@ionic-native/local-notifications.LocalNotifications.schedule方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LocalNotifications.schedule方法的具体用法?TypeScript LocalNotifications.schedule怎么用?TypeScript LocalNotifications.schedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ionic-native/local-notifications.LocalNotifications的用法示例。


在下文中一共展示了LocalNotifications.schedule方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: Date

    this.platform.ready().then(()=>{
      this.localNotifications.schedule({
        id: 1,
        title: 'TrackoMed',
        text: 'Sleep Time',
        data: { mydata: 'Have you Slept Yet?' },
        icon: '../../icon.png',
        at: new Date(new Date().getTime() + 2 * 1000)
      });

    });
开发者ID:maazkabir,项目名称:trackomed,代码行数:11,代码来源:care.ts

示例2: addFavorite

  addFavorite(id: number): boolean {
    if (!this.isFavorite(id)) {
      this.favorites.push(id);
      this.storage.set('favorites', this.favorites);

      // Schedule a single notification
      this.localNotifications.schedule({
        id: id,
        text: 'Dish ' + id + 'added as a favorite successfully'
      });
    }      
    console.log('favorites', this.favorites);
    return true;
  }
开发者ID:sandy100,项目名称:Coursera,代码行数:14,代码来源:favorite.ts

示例3: setInterval

    this.interval = setInterval(() => {

      this.now = new Date();

      if (this.notifications) {

        let { period, timeLeft } = this.getCurrentClassInfo();

        if (period) {
          this.notif.schedule({
            id: 0,
            title: period.name,
            text: `${timeLeft} mins remaining`,
            badge: timeLeft
          });
        }

      }

    }, 5000);
开发者ID:sshh12,项目名称:CyRanch-App,代码行数:20,代码来源:bells.ts


注:本文中的@ionic-native/local-notifications.LocalNotifications.schedule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。