How to send local notification daily at random time?


i have tips in my app like this

alltips=[ {“tip”: “1”,
“title”: “title1.”
},{“tip”: “1”,
“title”: “title1.”
{“tip”: “1”,
“title”: “title1.”
{“tip”: “1”,
“title”: “title1.”

i have stored these tips locally.i want to send local push notification of these tips.i want to send push notification randomly with random tips.


check out this plugin

Personally i wouldnt show the notifications completly random, consider the times when people are sleeping.


But can we send random tips. I also do not want to send push notifications at random time.

    id: 1,
    title: tip.title
    text: tip.content
    firstAt: monday_9_am,
    every: "week",
    sound: "file://sounds/reminder.mp3",
    icon: "",
    data: { meetingId:"123#fg8" }
  var tips = [{
    title: 'tip1',
    content: 'tip1'
  }, {
    title: 'tip2',
    content: 'tip2'
  }, {
    title: 'tip3',
    content: 'tip3'

  var tip = tips[Math.floor(Math.random() * tips.length)];

This could be a way to do what you want. You really just want to generate a random number, based on the length of tips you have in the array.


A post was split to a new topic: Problem with local notification