Setting a Recurring Event using Appcelerator Titanium - iphone

I've got an app I'm building using Appcelerator Titanium that will be a combination alarm clock/url fetcher. The part I'm having problem with is that I need to be able to set a time for the app to go fetch the url and then perform actions as necessary (in this case alert the user if data that should be entered in a time system has been entered). I also want it to do this every day (or every week day) at the prescribed time, and I want it to not have to be 'launched' every time. I'd rather it come up and run as a service, or at least run as a service when sent to the background. I'm most focused on the iPhone, but I've got a few Android users that would like it as well.
Is it even possible to have an Appcelerator app hooked into the system like that? If so, are there any tutorials or examples? I can't even find an alarm clock example, which scares me a bit.

I think that localNotifications should work for you.
there is a sample in the bg.js file included in the kitchenSink.
It is also helpful to know that all of the keys/properties available to you are documented here in the source code.

This guy has a nice alarm module written for android.
https://github.com/benbahrenburg/benCoding.AlarmManager

Related

Set internal clock from code in Objective C

I have a requirement where I need to set the internal clock of iPad from inside my code. I did some google on it with no fruitful result. Is it at all possible to do it and if yes, how ?
I'm afraid you can't using official APIs, it's up to the user to change the time on the device. Moreover, the user can't even control when it's set/updated if it's using Apple's time servers.
You can however maintain your own time inside your app using for example this:
https://code.google.com/p/ios-ntp/
If you really need to change the clock, you might have a look on Cydia, this app for instance can change the device's internal clock connecting to custom NTP servers.
Also, some time ago I read this article about how time synchronisation works on iOS that you might find helpful.
It is not possible unless you jailbreak. That is a setting for the user, not for your app.
In my view, No its not possible. Setting system settings is out of the purview of the iPhone developers' SDK. The API's to access such functions are not documented for users to set.

iOS give users default downloadable content

I'm facing this problem while designing my iOS app. Suppose that a user purchases an app and downloads it to the iPhone. I would like to provide him with a default consumable item the first time he runs the app to use whenever he wants , however I would also like to track if the user has already consumed the item. This way if he decides to reinstall the app we can restore the transactions (if he used the item) or we can avoid possible intents to download different kind of content by reinstalling app and consuming default items each time. (Guess NSUserDefaults is not an option here).
One approach that came to my mind was using UDID(or any iOS 6 alternatives) to keep a record on server of the user's device the moment he uses the default item. But this will limit items just to the device from which they consumed content.
It would be great to support all the user's devices (like inAppPurchases), but I can't figure out a way to implement this.
Any suggestions or help would be great.
Thanks a lot.
In order to tie information to a user (not just a device she used at one time), you'll need to ask the user to identify herself and save it someplace other than the device. In other words, a backend that implements registration and login.
From scratch, this can be a lot of effort that an iOS developer didn't count on. Fortunately, there are several services in the world that provide a substantial head start. Here's a nice round-up. I've had direct experience only with Parse.com, and think it's excellent.

Get alarm time set in Clock app from another app in objective c using IOS sdk

How to get alarm time set in default Clock app available in iPhone programatically inside another iphone application. I have found someone say that CFPreferences api can be used but cannot find the exact way of using it to get alarm time from Clock app. Any help is much appreciated.
Looks like there's no straightforward solution to what you're looking for. Regarding CFPreferences API, you'll first need to know how the Clock app stores the alarm information, or even if it does use the Preferences to store the alarm details in the first place. Once you figure this out then only you could use the CFPreferences API to achieve what you want.

How to regularly check for RSS/email-like updates online with iOS4

Is it possible to have an App (running iOS4 on hardware supporting multi-tasking) which starts on iPhone startup and then regularly checks for online updates (every 15 minutes) and then refresh the badge, so the user can see how many unread items there are with-out having a push-server?
I was hoping this would be possible with iOS4 Programming Guide seems to suggest it is only possible to to this regarding Locations tracking, VoIP and playing background audio. There is also the possibility to do local-push notifications, but I don't see to find how to trigger a specific function that way.
Thanks in advance for any help!
edit:
Just having read a bit more, if the application is in the background/inactive state, and I son want to update the badge-number without displaying a message, is there an action triggered like didReceiveLocalNotification? There must be a way to schedule something on a regular basis (like email checking) without having to implement a full server-push-nitification system!
Is it possible to have an App ... which starts on iPhone startup and then regularly checks for online updates (every 15 minutes) and then refresh the badge
As you already figured out, the answer is no.

iPhone trial period for app

I need to implement trail period in my app. How to do it? Store day count in NSDefault? or some other?
You could store a counter in the preferences as you mention, although that counter would disappear if the user reset their phone.
However, I think it's all slightly besides the point. In general, Apple frowns upon apps that have this kind of functionality, so don't be surprised if your app gets rejected. Consider launching two different versions of your app instead, a "Lite" app and a "Full" app. The Lite app should have a reduced feature set, but it should never stop working.
Apple is against the idea of you disabling features to prompt people to pay money for something. Your app needs to be fully functional and a 'lite' version and a paid version seems to be how things work at the moment.
That being said - if you implemented it properly you could add in app purchase items to enhance your app. Your original 'lite' app could be $0 and additional features can be added for a fee.
The most bullet-proof method would be to send and maintain a copy of the iPhone's UUID in a database.
Then if the App is not "unlocked" it requires a "key" form the database every time it launches. You can then implement the trial period on the server side.
However, if you decide to use some type of encryption to store or transmit keys etc you will need a licence to distribute the App.
You make a light version of your app. There is no official way to have a trial version at this time. Hopefully Apple will eventually address the need, but I can't say I would hold my breath...