Closed lord-zeus closed 5 years ago
Please elaborate. A code sample would be nice.
let notification_id = 8248d304-d1ba-4665-8c22-46c2f0201bf9
LocalNotifications.schedule([{ id: notification_id, title: 'The title', body: 'Recurs every minute until cancelled', ticker: 'The ticker', color: new Color("red"), badge: 1, groupedMessages:["The first", "Second", "Keep going", "one more..", "OK Stop"], //android only groupSummary:"Summary of the grouped messages above", //android only ongoing: true, // makes the notification ongoing (Android only) icon: 'res://heart', image: "https://cdn-images-1.medium.com/max/1200/1*c3cQvYJrVezv_Az0CoDcbA.jpeg", thumbnail: true, interval: 'minute', channel: 'My Channel', // default: 'Channel' sound: "customsound-ios.wav", // falls back to the default sound on Android at: new Date(new Date().getTime() + (10 * 1000)) // 10 seconds from now }]).then( function() { console.log("Notification scheduled"); }, function(error) { console.log("scheduling error: " + error); } )
it just keeps replacing my id with the generated one
iOS/Android/both? And I guess notification_id
is a string
?
I'm testing for Android
iOS/Android/both? And I guess
notification_id
is astring
?
yes it is a string
According to this code I think you should use a number
instead:
According to this code I think you should use a
number
instead:nativescript-local-notifications/src/local-notifications-common.ts Lines 286 to 295 in 1e7a876 protected static ensureID(opts: ScheduleOptions): number { const id = opts.id;
if (typeof id === "number") { return id; } else { // We need unique IDs in all notifications to be able to persist them without overwriting one another: return opts.id = LocalNotificationsCommon.generateNotificationID(); } }
is there a way to make it use strings since its just to keep the uniqueness and my ids are unique
AFAIK on Android the id must be an int
. I'm sure you can think of a way of making unique numbers.
generated id is preventing me from using my own id and each time I give the id a value it just generates its own id and its really a problem any help please