0

Well, my idea is to make an app that is installed on two or more devices. The main or "head" device can send out a call to one of the specific devices in the form of a push notification. The push notification could be preset or whatever. The goal would to be a simple notification system. All of the users who I am making this for have an iPad active and sitting on a desk in front of them. Imagine this as a doctor tool for calling the nurse into the room when the patient is ready. Tell me if this is clear enough.

How would this be done?

DanielsCaleb0
  • 81
  • 1
  • 2
  • 10
  • Why not just send the person an email? or a text message? – Dave DeLong May 04 '11 at 23:31
  • 1
    Not clear enough at all. You have (sort of) explained what you want to do. Now what is your question? What is the specific problem you would like us to help you with? And even on the application you might want to be more precise. What is the application? What does it do? etc. – Bart May 04 '11 at 23:32
  • 1
    Ok, I updated it with more detail. – DanielsCaleb0 May 04 '11 at 23:38
  • Well, a text message would work but they are using iPads. And we want it to be one button. not any typing involved. – DanielsCaleb0 May 04 '11 at 23:40

1 Answers1

1

If I understand your question correctly, you want to develop an app that can push notifications to other devices.

The best way to would be to have a server and have the device sending the notification to send a request to the server. The server would then store it in a database. Then when the other devices send a request to the server to check for anything new, they would see that newest entry and push a notification to the phone.

In reference to Dave DeLong's comment, this app might actually be good if people don't want to use their minutes/texts/3G/4G, but instead only want to use WiFi. Also would be good for a small corporation instead of having walki-talkis. (That last part may be a stretch.)

Good luck on developing!


In order to make the device check for new notifications from the server simply have it access a link during a set interval (maybe like every 5-10 seconds; an ideal situation would be to have a setting for users to change the time interval between checks):

hxxp://domain.com/checkForNew.php?deviceID=foo&otherSecurity=blah

Then have the PHP return some kinds of values that you may need. An example output would be:

fromID|toIDs|dateSent|message

On the iPhone you can get this content using:

NSString *googleString = @"hxxp://domain.com/checkForNew.php?deviceID=foo&otherSecurity=blah";
NSURL *googleURL = [NSURL URLWithString:googleString];
NSError *error;
NSString *googlePage = [NSString stringWithContentsOfURL:googleURL 
                                                encoding:NSASCIIStringEncoding
                                                   error:&error];

(This code can be found here: Reading HTML content from a UIWebView )

Finally, separate this string into appropriate variables and push the notification.

Community
  • 1
  • 1
Flipper
  • 2,589
  • 3
  • 24
  • 32
  • Thanks! You do understand it correctly it seems. I know how to set up a server for push and know how to have the device send the push to theserver but I have no clue how to make the other devices actively check for new notifications. – DanielsCaleb0 May 04 '11 at 23:42
  • 1
    You have at least two options: one is to build a "private" notification service... your apps simply poll the server and get notifications via whatever dataservice you publish on the server.. JSON, html, whatever. The second option is to actually use Apple's push notification service to send alerts to the "client" iPads. You should check out the docs for push notifications: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008194 – ChrisW May 04 '11 at 23:49
  • @DanielsCaleb0 I have updated my answer to explain how I would go about checking for new notifications. Please let me know if it makes sense. (And anybody else please provide a better way of implementing.) – Flipper May 04 '11 at 23:51
  • @ChrisW- Thanks, what would you consider to be the most easy/efficient solution? – DanielsCaleb0 May 04 '11 at 23:54
  • @Flipper-Awesome! I think I understand it now. – DanielsCaleb0 May 04 '11 at 23:54
  • 2
    @DanielsCaleb0 it depends on your needs. The polling solution is easiest to implement, but creates unneeded network traffic and only works while the iPad client app is running (and polling). The Apple notification service isn't difficult to implement, but you do have to have a server running somewhere to push the notifications to Apple, who will then deliver them. And the app has to be push notification certified, which is just a simple config setting you do on the Apple provisioning web site. However you don't have to poll and you get notifications even if your app isn't running. – ChrisW May 05 '11 at 00:11
  • Ok cool. I will give it some thought and try to decide with the team. – DanielsCaleb0 May 05 '11 at 00:16
  • Based on ChrisW's response I would definitely recommend you choose to use Apple's notification service instead of polling. Seems like a much better method. – Flipper May 05 '11 at 00:25