我创建了一个移动应用程序(Ionic Cordova).已安装Cordova Push Notifications、Cordova Local-Notification Plugin,但是当我收到推送通知或离开屏幕时,我会丢失所有本地通知.如果通过isScheduled函数检查它们,则为TRUE.如果我删除了推送通知代码
var config = null;
if (ionic.Platform.isAndroid()) {
config = {
"senderID": "111111111111" // REPLACE THIS WITH YOURS FROM GCM CONSOLE - also in the project URL like: https://console.developers.google.com/project/434205989073
//"ecb": "window.onNotificationGCM"
}
} else if (ionic.Platform.isIOS()) {
config = {
"badge": "true",
"sound": "true",
"alert": "true"
}
}
$cordovaPush.register(config).then(function(result) {
// ** NOTE: Android regid result comes back in the pushNotificationReceived, only iOS returned here
if (ionic.Platform.isIOS()) {
$rootScope.regId = result;
scheduleNotifications.storeDeviceToken("ios");
}
}, function(err) {
navigator.notification.alert("Register error " + err);
});
可以.这有什么问题呢?
解决方法:
我认为您感觉不错,因为我什至无法一起运行它们.
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support
/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfo
VersionImpl;
本地通知正在将android.support.v4安装为与Ionic其余部分冲突的依赖项.
编辑:通过在platform / android / libs下对v4.jar文件进行修改来解决.