【发布时间】:2019-06-11 12:01:27
【问题描述】:
我正在尝试向我的应用程序添加通知,但似乎没有任何效果。 我已经在应用程序模块以及我正在实施通知的页面中添加了导入。我希望看到通知,但单击按钮后什么都没有出现。
import { LocalNotifications } from '@ionic-native/local-notifications';
play(){
this.localNotifications.schedule({
id: 1,
text: 'Hello there',
data: 'notified'
});
}
按钮代码:
<button class="login-button" ion-button round color="secondary"(click)="play()">NOTIFICATION</button>
【问题讨论】:
-
你是在本机设备上测试这个吗?还是通过离子服务?
-
@Sergey Rudenko,我用的是真机
标签: cordova ionic3 angular5 localnotification