cordova -v
): 7.1.0cordova platform ls
): android 6.3.0 - ios 4.5.3function nextweek(){
var today = new Date();
var nextweek = new Date(today.getFullYear(), today.getMonth(), today.getDate()+7);
return nextweek;
}
var SonrakiHafta = nextweek();
cordova.plugins.notification.local.schedule({
id: 1,
title: "Irregular Verbs",
text: "Learn with images now!",
sound: "file://sound/notify.mp3",
color: 'FF0000',
at: SonrakiHafta,
every: 'week'
});
Local notification should be sent when the set time is reached.
I get the error below:
TypeError: Object.assign is not a function
at Object.exports.mergeConfig (/android_asset/www/plugins/cordova-plugin-badge/www/badge.js:158:19)
at Object.<anonymous> (/android_asset/www/plugins/cordova-plugin-badge/www/badge.js:215:14)
at None (/android_asset/www/plugins/cordova-plugin-badge/www/badge.js:174:20)
at Object.cordova.callbackFromNative (/android_asset/www/cordova.js:294:58)
@faytekin That tickets belongs to my cordova-plugin-badge. However this plugin also uses Object.assign function.
Your Android version is not supported. Sorry but 0.9-beta requires at least Android 6 as target and Android 8 SDK for compilation.
Hi,
may I ask for a slightly more elaborated answer? Does the 0.9.0-beta.1 plugin not work on Android 6 or lower? Do you have an idea, how to make notifications work on older and newer Android versions? That would be really helpful! I'm trying to port my native app to cordova, but if I won't be able to get notifications to work, it will be a waste of time.
I get a similar error (see below) on:
Plugin version: 0.9.0-beta.1; Platform: Android; OS version: 6.0.1
Device manufacturer / model: Xiaomi Mi-4c; Cordova version (-v): 8.0.0
build.gradle shows: defaultCompileSdkVersion=26; cordova defaultTargetSdkVersion=26
Error in Success callbackId: Badge568134687 : TypeError: Object.assign is not a function
plugins/cordova-plugin-badge/www/badge.js:158 Uncaught (in promise) TypeError: Object.assign is not a function
at Object.exports.mergeConfig (file:///android_asset/www/plugins/cordova-plugin-badge/www/badge.js:158:19)
at Object.(file:///android_asset/www/plugins/cordova-plugin-badge/www/badge.js:215:14)
at file:///android_asset/www/plugins/cordova-plugin-badge/www/badge.js:174:20
at Object.cordova.callbackFromNative (file:///android_asset/www/cordova.js:291:58)
at processMessage (file:///android_asset/www/cordova.js:1114:17)
at processMessages (file:///android_asset/www/cordova.js:1137:9)
and
Uncaught TypeError: Array.from is not a functionexports.toArray @ local-notification-util.js:370fn @ local-notification-core.js:65(anonymous function) @ local-notification-util.js:321cordova.callbackFromNative @ cordova.js:291(anonymous function) @ VM51:1
I've added a polyfill for Object.assign
Most helpful comment
@faytekin That tickets belongs to my cordova-plugin-badge. However this plugin also uses Object.assign function.
Your Android version is not supported. Sorry but 0.9-beta requires at least Android 6 as target and Android 8 SDK for compilation.