Ionic framework 离子本地通知
我有一个无法解决的问题。 我与woocommerce创建了一个电子商务。我使用onesignla发送更新通知等。 但我希望每个用户在订单状态更改时都有自己的通知,例如: 从收到到完成。。。 我尝试过localnotification,但没有成功,有人能帮我吗 my-orders-page.tsIonic framework 离子本地通知,ionic-framework,localnotification,Ionic Framework,Localnotification,我有一个无法解决的问题。 我与woocommerce创建了一个电子商务。我使用onesignla发送更新通知等。 但我希望每个用户在订单状态更改时都有自己的通知,例如: 从收到到完成。。。 我尝试过localnotification,但没有成功,有人能帮我吗 my-orders-page.ts orderstatus: any; orderChangeStatus(){ if (this.orderstatus == 'processing') { this.LocalNo
orderstatus: any;
orderChangeStatus(){
if (this.orderstatus == 'processing') {
this.LocalNotifications.schedule({
title: 'My first notification',
text: 'flight is landed',
foreground: true
});
}
if (this.orderstatus == 'completed') {
this.LocalNotifications.schedule({
title: 'My first completed',
text: 'flight is landed',
foreground: true
});
}
}
html
{{'Status'| translate}}
{{order.status | translate}}
爱奥尼亚本地通知适用于从应用程序本身触发的通知,而不使用推送通知服务器(例如,日历提醒)。它们不适合推送通知,除非您已经使用后台工作人员设置了自己的推送通知框架
您应该改用Ionic OneSignal插件。请在此处查找文档:
在此阶段,我无法为您提供更多帮助,您应该尝试使用此插件,如果您有进一步的问题,请提出另一个问题。使用onesignal时,不要自动发送订单信息,还是我错了?推送通知应该从后端触发,而不是从应用程序触发
</ion-row>
<ion-row [class.pending]="order.status=='pending' || order.status=='refunded'"
[class.cancel]="order.status=='cancelled' || order.status=='failed'"
[class.inprocess]="order.status=='processing'" [class.complete]="order.status=='completed'">
<ion-col size="6">
{{'Status'|translate}}
</ion-col>
<ion-col class="ion-text-right" size="6">
<strong>{{order.status|translate}}</strong>
</ion-col>
</ion-row>