Push Notification coding

Discussion in 'iOS Programming' started by RunToTheHills, Jan 6, 2010.

  1. RunToTheHills macrumors member

    Joined:
    Jun 9, 2009
    #1
    Heyo :apple:s,

    Is push notification easy to do? For instance (and just for a second, let's assume the person I am speaking of is still alive), let's say Sam Kinison had his own app and Twitter account. Could I make it so each time Sam posts a new tweet online, I got a "push" update on the app's icon on the home screen? Is this doable? Further, could I make it so instead of a simple vibration, it's an audio sample of Sam's signature scream?

    Would this be relatively easy to develop or moreso difficult and highly expensive?

    Thanks people :D
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Well, you need your own server running all the time that sends notifications to Apple that then get pushed to the devices. And then there's a whole device register/unregister thing so you need a database for that.

    From the sounds of it you've not even bothered reading the documentation so I suggest starting there.
     
  3. RunToTheHills thread starter macrumors member

    Joined:
    Jun 9, 2009
    #3
    Well, no, as far as reading documentation, you're correct. The reason for this is because I personally am not a developer. I merely think up the ideas for my boss; he gives the green or red light; I then meet with the developer to discuss the idea.

    As far as servers go, I have a few questions if you or anyone would be inclined to answer:

    1. Do the servers house everything? The RSS from the Twitters? Photographs if the person/talent wants to load new photos? Etc.

    2. In order to receive said push notifications, does the person have to register say, a username/pw upon download of the app?

    3. Is there a benefit for a server- whose only purpose is to house info for an iPhone app- to be dedicated vs. shared? Would that affect the speed by which updates get sent out to users?

    4. Finally, is it possible for the actual notifications themselves to be soundbites instead of mere vibrations?

    Thanks very much.
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    1. No, they don't have to: the purpose of the server is discussed in the docs

    2. No, but they do have to accept them

    3. Would depend on the volumes really

    4. You cannot send a custom sound.
     
  5. RunToTheHills thread starter macrumors member

    Joined:
    Jun 9, 2009
    #5
    Thanks very much, sir. Truly appreciate it.
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    Sorry robbieduncan but notifications can trigger a custom alert sound that is already built into the iPhone app.
     
  7. RunToTheHills thread starter macrumors member

    Joined:
    Jun 9, 2009
    #7
    Ah, really? Curious about "already built into the phone." That means that the customer alert sounds must only be the ones pre packaged with the OS? What if, for my application, I build a custom set. Would/could they be installed into the Sound Settings to work for my idea? Refresher: Each time Sam Kinison tweets, you get a push notification with a custom sound of Sam's signature scream. This is possible?
     
  8. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #8
    Yes. You can include your custom alert sounds in your application bundle and the notification can trigger them to play. This is all covered in the Apple Push Notification Service Programming Guide, if you care to read it.

    P.S. Oh, and of course you would need to have the rights to use Sam Kinison's scream.
     
  9. RunToTheHills thread starter macrumors member

    Joined:
    Jun 9, 2009
    #9
    Very much appreciative of your help, sir. You & others in this thread. Thanks again people.
     
  10. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #10
    Sure, I worded it badly: what I meant was that your notification message from the server to the device could not include a custom sound for that alert. So it's impossible to have a different sound for every alert you send (unless you pre-load an infinite number of sounds) but if you only want one sound that would work as noted above.
     
  11. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #11
    Yeah, infinite is not possible, but more than one different sound is. As part of the notification payload you send to the APNS server, you can specify which, from among multiple, custom sound alert you'd like the notification to play. But, of course, all those sounds must already reside in the app bundle.
     

Share This Page