Limit user participation to a server regulated competition? (iphone sdk) - iphone

I am new to programming for the iPhone. I want to allow my users to participate in a competition, to a maximum of n times a day. Is there anyway of going about that programmatically and/or through a server for optimal security (i have done NSUserDefaults). ?
Is it possible to get the database server to check the number of entries made by a device and send a call back to the application if it has exceeded n number of attempts for that day?
thank you for any suggestions.

Sure you can!
Each iPhone/iPod Touch device has a unique identifier you can get from the UIDevice class. When the app launches, bring up a screen that says "authenticating" and send that unique ID to your server in a simple HTTP GET request. On the server, you can log the identifier and a timestamp to a database and see how many times that same identifier has been seen in a 24 hour period. For this, you could use standard MySQL + PHP. The server could send back a simple "Yes" or "No" depending on the competition rules.
You definitely want it to go through a server. People can get around limitations saved in your NSUserDefaults by uninstalling and reinstalling the app. Using a server also has other benefits. It would allow you to modify the competition rules after deploying the application without waiting for a 14-day app update review from Apple.
Ben

Related

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.

Is it possible to send location data silently from the iphone (with users agreement ofcourse)?

I was wondering if it possible to create an application that will send my 9 year old's iPhone location let's say each 30 minutes, even when the iPhone is not active.
If not, then is it possible to send it each time he uses his phone?
Why not using an existing solution?
http://www.apple.com/icloud/features/find-my.html
See find my friends - it has also parental restrictions. This is excatly what you want.
You're probably looking for startMonitoringForReigion:desiredAccuracy:. This function will allow you to set the iPhone to notify your app anytime a defined boundary is crossed. When you receive this notification, I believe you can send that info to a server or wherever.
That said, if monitoring your child's location is what you want, you'll have great luck with the Find My Friends app from Apple.

iPad: Force iPad Updates

I've been developing an application for our client and they are requesting that we add in compulsory updates for their application. The app allows sales-team members to showcase their product and they are worried that if a product gets re-called then the sales-team must reflect this in the app immediately or else there could be legal implications for the company. How feasible is this to implement? Are there any examples of this in use?
Cheers for the help guys,
Dan
The way you could do this is to get the app to call the server and ask for the latest version number. If it's different then stop the app and tell the user to upgrade. However, this won't work if they start the app without a network connection :)
I also don't know if this will be allowed by Apple?
A better way to do it is for the app to download a list of products each time it runs (cahcing it incse it starts with no connection of course!) so that the products in the app are always up to date and the users never need to upgrade at all.

Possible? Use Google Maps/GPS to tell how long someone has been in a location?

I'm thinking about building an iphone app that would use the GPS feature to track where someone is and for how long. I realize I could probably get the current location from the iphone from a website but the only way I'm familiar with is using ajax calls, etc (Sorry if this is a rather newbie concept) but I fear that would bog down my servers with constant calls to track time. Is there a better way to do this? Any resources I could consult on this idea/concept? Is it even plausible at this point?
I'm more versed in php/mysql but trying to branch out on some new ideas I've had. Any help would be greatly appreciated!
You could keep a local datastore then only send updates to the server when the app detects that the user has moved. I'm pretty sure that would work and on the server side you just work out the last time a user checked in and then compare that against the current time to see how long they have been somewhere. The only technical issue I can see with this is that this requires the user to have the iphone on and the app open the ENTIRE time they are somewhere, which would mean the iphone is now just a rather expensive GPS tracker with a built in phone!
you could store user locations on a local list on the iphone and once an hour you send the list with location/timesptamp pairs to server.
As James Raybould says, you can compute on server how long a user stayed inside a range for a given position. And also by sending data once an hour... not each time the iphone detects that user moved, then you save your server for continuously pings.

What usage/analytics information is available for iPhone applications?

If you deploy an application through the iTunes app store, what usage information do you get from Apple? Do you only get the number of downloads/sales, and does this differ for free vs. paid apps? Do you get any information regarding how often it is used, crash logs, demographics info, etc? Is the only way to build hooks to your own server to track this information and would such an app even get approved?
I've seen articles such as this one that includes quotes like:
only about 20 percent of users return to use a free app the day after they first download it and by 30 days out, less than five percent are using the app.
Is that based on surveys, or is it data that comes from Apple? There doesn't appear to be much publicly available data except when Apple shows the top applications, but that is just based downloads or ratings, and nothing deeper.
Most of this information comes from companies like Pinch Media and Admob. They supply libraries you can include in you app which inform their servers of events in your app (specifically launch but also other events decided by you).
They use these events to provide aggregate information on iPhone apps. Several reports have been published recently referencing this data.
You only receive usage information if you somehow program the reporting of such information into your app.
Number of Downloads (Sales if a non-free app) and more recently crash logs are the only information you receive from Apple. you do not even receive personal information about WHO is was that bought your app, only that they did.
You won't get usage statistics from Apple, only download and sales statistics. The reporting is slightly different for free apps(as they won't show up in the financial report), but basically the same information is provided.
You can however track usage information on your own by having your application ping a remote server every time the app is accessed. You can use the unique device id to track a specific user. This will be dependent on internet access for the iPhone/iPod Touch.
Apple does give you how many downloads have occurred as well as what countries they are from. If you want more detailed usage statistics you will have to go to a third party solution, or write it yourself.
Unless Apple is secretly sending usage information when an app is opened, I don't see how anyone can get aggregate statistics about the whole app store. When I upload an app, it is in binary format, and it is probably unlikely that anyone adds in their own code to secretly do this.