Sandeep Dhama
Sandeep Dhama

Reputation: 614

Choose random text and set it in alert for local notification?

I want to local notifications inside my iPhone app. There are different categories by which user can set Notification along with time. The categories are:-

  1. Daily

  2. Weekdays

  3. Weekends

  4. Every Monday

  5. Every Tuesday

  6. Every Thursday

  7. Every Friday

  8. Every saturday

  9. Every Sunday.

For each category user can choose multiple time and set the local notifications for that. For example if i choose Daily notification i can add multiple time 10AM, 11AM, 12PM and so on. So maximum notification a user can set on each day is 24(24 hour in a day). On each notifications i need to fetch a random/unique text and set it in alert for local notification. So if a user choose all these 9 category then maximum notification he can set is 24*9(24 for each category) = 216.

So my Questions are:-

  1. Can i set 216 local notifications to fire?

  2. How can i get the random text and set it in alert of local notification, so that i get the unique text each time local notification fire?

Upvotes: 0

Views: 766

Answers (1)

rckoenes
rckoenes

Reputation: 69499

  1. No you can only set a maximum of 64 Local notifications. The Local and Push Notification Programming Guide states:

    Each application on a device is limited to the soonest-firing 64 scheduled local notifications. The operating system discards notifications that exceed this limit. It considers a recurring notification to be a single notification.

  2. You will have to set the text before scheduling the notification, so the notification with the same interval (ex. daily at 10 am) will have the same text until you remove it to add an other.

Upvotes: 0

Related Questions