1

我正在 PGB 上实现推送通知功能。我使用科尔多瓦 2.9.0

我想在应用程序启动时更改主页(没有冷启动,没有前台)并且它有一个推送通知。所以我需要这样的代码:

if [app has push notification] { 
   $.mobile.changePage("X_Page", { transition: "pop", changeHash: false}); 
   ... 
   navigator.notification.alert([text]); 
} 

有什么提示吗?谢谢!

4

1 回答 1

0

You are probably going to have to use local storage to store the value.

For example, on first install, set the value to true and set the app to receive notifications. If a user changes this in your app's settings page, set the value to false in local storage. Then, whenever you want to check that value, just pull it from local storage.

于 2013-10-07T17:05:36.640 回答