Setting end date for repeating local notification in iPhone OS4 SDK - notifications

In the iPhone OS4 SDK, does anyone have a suggestion for how I would implement a repeating local notification that ends on a particular date?
Looking at the API documentation, there doesn't appear to be a built-in property of UILocalNotification to allow you to set an end date on a repeat.
Any suggestions would be much appreciated.
Thank you!

Two ways that you could go about it:
Track the end date in your app. Whenever the app launches, check for notifications which are now "expired" and call cancelLocalNotification on them.
Alternatively, instead of using the repeatInterval property of the notification, manually schedule the x number of repeat notifications.

Set notification for each repeat date and check programatically that repeat date is not greater than end date by NSDateComparator.

Related

How to implement the seekto functionality in ionic 4?

How can i track till where the user have watched the video in order to resume the video from that position when the user returns?
Like youtube,
it actually knows which video is played till where.
Have checked the AndroidExoPlayer but the only supported platform is Android.
I need in both Android and iOS.
link for AndroidExoPlayer in ionic 4
https://ionicframework.com/docs/native/android-exoplayer/
To check Instance members for AndroidExoPlayer
https://ionicframework.com/docs/v3/native/android-exoplayer/
Have even checked the plugin Media in ionic 4 but it is only for audio
https://ionicframework.com/docs/native/media
Videogular might be a good option.
Here a couple of tips:
vgUpdateTime($currentTime, $duration): Called when progress time has been updated. Returns the current time and the total duration.
seekTime(value, byPercent): Seeks to a specified time position. Param value must be an integer representing the target position in seconds or a percentage. By default seekTime seeks by seconds, if you want to seek by percentage just pass byPercent to true.

Run task in background in iOS 10

Can one use UNCalendarNotificationTrigger or UNTimeIntervalNotificationTrigger to run a snippet in background in fixed interval, say once per day, without notifiying user? For example just with playing a sound and the running custom code?
I need this to calculate exact time of a special alarm in background everyday and then set notification for it.
You can't trigger a block of code to run when the notification is fired. You can, however, trigger a block of code to execute with a UNNotificationAction by adding an action to your notification and using userNotificationCenter(_:didReceive:withCompletionHandler:) on UNUserNotificationCenter.currentNotificationCenter().

iphone message center - how to get the message arrival time

When I open the message center (by sliding it down from the top) I can see that each message is associated with "how long ago it arrived". How to get that info?
I also have checked out and it seems that when I create a local notification with the repeatInterval the fireDate remains the same as in the original for all repetitions.
Thus I don't know how to distinguish between the dates of each local notification since the popups are non-modal. Any suggestions?
Thanks.
Regards, Victor
I don't believe the time of arrival is available to you. You can send additional details with the notification's JSON though with a timestamp that you then read in your applicationDidLaunch:(NSNotification *) method.

Updating application icon Badge in iPhone 3.0, when application is not running

I have an application, which lists number of IM sent by any of my friend using my application. And application icon show number of unread IMs to me. If my application is running in foreground, I can update badge by calling web service every 1 minute which will return number of unread IMs. Suppose, if the person is using iPhone3.0 and application is not running, how can i update the badge? Push notification without alert, but with just number of unread IMs as badge number will work?
Please advice, Thank you.
Yes if the user enables push notifications and allowes it for your app then you can use them to just adjust the badge counter.
At last, we found the problem, the problem is passing badge parameter as string in JSON payload, Now we are sending it as number, so even when the application is in background, badge getting set properly.
Thank you for your all help.

How can I make an app restart every time it is opened?

I have an app that lets say, shows the alphabet. Each time I start the app, I'd like it to start at the letter A.
Right now, I guess because of multi-tasking, the app starts wherever it left off.
Is there a good way to force it to start at the beginning each time?
Thanks.
There is a parameter to set in the Info.plist. Look for UIApplicationExitsOnSuspend
You can also setup your app delegate to handle the wake up as you want. Have a look at this http://www.cocoanetics.com/2010/07/understanding-ios-4-backgrounding-and-delegate-messaging/