I am pretty new to Objective-C and want to write an iPhone app.
The iPhone app should send the device-ID to a server when it is started the first time,
and even if the app is in the background, the device should send its position in a given time interval and the current position is stored with the ID.
If the iPhone is near a given other position, the server should send a message to the device such an alert view appears on the screen.
I don't expect a manual to program this, but I would be happy if you can give me some key words to look up and classes I definitely need to use.
Well, sounds like your gonna need the CoreLocation framework
http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CoreLocation_Framework/_index.html
That'll handle the positioning of the device.
The UDID (device id) is fairly straight forward, a quick google will get you that code.
You'll also need to look into multitasking, specifically the link below, to execute code when the app is in the background.
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html
Related
I'm not sure if it is possible or not, I just need some hints here - let's assume a scenario like this:
users install my app on their iphones
one day I put a gps coordinates on my webservice and some small info
this information + coordinates are pushed to the iphones around (e.g. +/- 10 miles) to the coordinations I gave at the beginning
all users in this area (+/- 10 miles) gets a push notification and can open my app
on some other time I repeat the scenario but with different coordinates (so that it equals different target group)
Is that possible? I was thinking about Deferring location updates while app is in the background but I'm not sure if that can also work with different locations each time given by webservice...
The other solution that I thought about was to push the message and coordinates to all users of my app, but display it only within the ones with matching gps coordinates - but I guess it's not possible since when I do a push message - everyone will see it even before calculating their gps coordinates, is that correct?
Sorry if that's a terrible question, I'm just starting with iOS now...
Thanks for any hints guys!
ArcGIS has some good tools for this, that is, if you're willing to pay for access to their APIs. They also have a full development team on standby that will develop the app for you. Partnering with ArcGIS is overkill for this situation though.
What I would suggest is to keep a database of coordinates, the actual notification, and the radius on an app management site like: socket.io and have it push any new data to the client apps, have the client apps check their GPS location against the database one...do some simple math to decide if the client device is inside the raduis, if so, display the pushed notification...and there you go.
I am fine with Jailbreaking the phone if it helps.
I'm trying to make my iPhone 4s ping its current location to a server every time the volume is pressed.
Here are the main steps for the desired functionality
Press the volume button. Ideally, this should only trigger the next event if the phone is locked.
The iPhone gets it location and makes a HTTP POST to send it to my server.
I haven't actually done any iOS programming, but I'm wondering if this is possible and what are the main steps I would take to begin learning the technologies required and building.
Thanks.
You should be able to detect the button press programmatically, and from that point you can handle it however you'd like. More information about that already exists in a question/answer made previously in this year:
Detect Volume Button Press
From here, in order to get the location, you'll have to use the CLLocationManager class. There is documentation on Apple's developer website that actually shows you exactly how to do this task.
Furthermore, you'll want to check out the Apple developer page for using NSURLConnection, and find the section about making an HTTP POST request: NCURLConnection Documentation
In order to be able to do this, you would likely have to have knowledge of: Swift/Objective-C, iOS, PHP, and HTTP. You also probably want to have the determination to do a bit of research. You won't be able to get this all done by copying and pasting code. However, you shouldn't have to jailbreak the iPhone. Just some solid programming work will get you the functionality you want.
Hope this helped.
I'm looking for solution that will enable my app to get an event from the server while the phone is in lock mode, when the event occurs the app will open the camera and take a picture.
while the phone remains locked and send the picture to the server in the back ground.
is it possible?
will apple store allow this kind of application?
Clarification:: the idea is not to take a picture without the user knowledge, the goal is to have him take a quick picture without having to open the phone & the application in order for that picture to be taken. If there is a solution that allows me to add a button like the camera build in next to the lock that's a great solution too.
Short answers
No,
No.
This is a huge violation of privacy, and has a great potential for abuse, therefore, there is no way to sneak pictures away from the user's device on demand.
You could send a push notification and ask a user to take a photo and upload it to your server on the other hand.
I want to give to the user of my app the ability to share a photograph without having an internet connection. It is quite hard to explain but I'll do my best. Basically in my app a user can press on a plus button to take a shot using their iPhone. This image is then uploaded on the Internet (Dropbox) in a common folder that can be accessed by all app users. When other users open the app, the image that has been uploaded is downloaded on their device. Since there might be more than one image, the app refreshes itself once in a while, and downloads the new photographs. I want to do the same thing using the bluetooth (or airdrop). When one device takes a picture, this is saved on the device, and sent to all app users nearby. These users can edit it, send it back to the original device where it can be accessed by everyone. basically the original device acts as a server, and all other devices stream the information from that device. The whole purpose of this is to have, say 15 different iOS devices all in the same room in sync which display the same exact thing. When someone edits, all the other people will see it, as if they where in sync with "the cloud" (which now is Dropbox).
I understood that this might be possible with MultipeerConnectivity.framework as it permits more than one device to be connected at the same time. I also found an example app called beam it: http://arctouch.com/beamit/
What I'm asking here is not really for some code, rather some indications on how I could approach the problem.
Let me first begin by explaining my goal for this app. I am looking for ideas on the best way to accomplish my goal (or at least close to my goal). This app is completely internal and thus does not need to comply with any apple guidelines (aka, can use private api's).
Our company has ~20 iOS devices. These devices are used by multiple people throughout the organization. Often times we are looking for a specific device and need to be able to track it down. So I am looking for a way to track who has what device.
My initial thought was to make an app that allows the user to pick their name from the list and then have a server that keeps track of who has what device. This worked well for a while, but now people have decided its too much work and have stopped using it. Users can just not open the app or press the home button to exit it. So now I'm looking for alternatives.
Here are some ideas that didn't work:
Custom Lock Screen - (Requires jailbroken devices so not an option)
"Lock To App" from Apple Configurator - (No way to exit our app. We don't want to hinder normal use. Note exit(0) will just cause iOS to restart our app)
MDM options - (Didn't see any that would provide this functionality. Let me know if otherwise. We would like to implement it ourselves, but a 3rd party is an option)
At this point I'm just looking for ideas or knowledge. Any help would be appreciated.
Thanks
I would add a sticker on each device and then, if i need a specific device, i would push a notification with a message like: "person with the device X ..we need it in room Y " .Then it's up to the person who has it to return it (or smth).
The sticker itself would be a numbered decal... or a picture..or something like that.
It's just an idea