Your SlideShare is downloading. ×
Apple notification push
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Apple notification push


Published on

this ppt explain how use and create a notification on your application in xcode

this ppt explain how use and create a notification on your application in xcode

Published in: Technology, News & Politics

1 Like
  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Apple notification push
  • 2. Summary
    Example of notification
    Architecture APN
    IPHONE Authorization
    Yourcode in Xcode
    Myprovider Register
    Send a notification
    Return disableddevices
    Receive a notification push
  • 3. Example of notification
    Exist 2 notification versions :
    • Local Notification Push
    • 4. Remote Notification Push
    We work with second type of notification
  • 5. Architecture APN
    FeedBack server send notification
    In JSON. It indicate you, device who uninstall application or device dysfunctional
    Gateway server receive notification
    In JSON. After reception, it sends notification to selected device
  • 6. IPHONE Authorization
    To receive notification in IPHONE, users must accept to notification reception. Once to accept, you must register identifier of IPHONE to send it to corporate server (your provider)
  • 7. In yourAppDelegate
    Always use application:didFinishLaunchingWithOptions: method for launching your application when it have options
    This method, we ask iphone ID user to receive notification or not …
  • 8. Your code in Xcode
    This code sends device identifier to your provider to register them.
    This code must be always in AppDelegate Application
    Delegate of UIApplication must be use
    Next slide presents my code
    Application:didRegisterForRemoteNotificationsWithDeviceToken must be called;
    The register always must be made.
  • 9. My code
    Function which recover Device ID and remove space blank. After call a function in background
    Function which send info to your provider. Baseurlregister is my url address of my serveur
  • 10. My provider
    My script make in PHP and may be use in other programming language
    Your server must be accessible (choose a web server much easier)
  • 11. My PHP code register IDIPHONE
  • 12. Message Format
    To transfer a message, you use JSON
    Format includes alert message, badge, and sound
    You can use a personalize sound to put in you application 
  • 13. Example
    This code send a alert message, use a default sound of IPHONE and notify app to 1
    Don’t worry to write json, PHP have a function which allow to convert a table to json
  • 14. certificate
    Don’t think to send notification without minimum security level
    You must create a security certificate and send it to iphone provisionning portal and recover the new one in iphone provisionning portal of your application. Procedure explained on developer portal, don’t forgot enable notification push service
  • 15. Create a certificate
  • 16. certificate
    After to inform apple of your certificate, we transform it to regroup all information with openssl (download it if you didn’t have it)
  • 17. Certificate .PEM
    Open your terminal and tapez
    Test yourconnection, if failreverifyyour certificat, it’sbad
  • 18. Send a notification on gateway
    To communicate with gateway sandbox, we go to create a secured network by using ssl protocol.
    My script is in php, my certificate recently created must put in folder protected by htacess
    Warning if you do not protect your certificate, an hacker can send a lot of notification in your place.
  • 19. Script sendNotif.php
  • 20. Return disableddevices on feedback.sandbox
  • 21. Receive a notification push
    • Whenyoureceive a notification, more often you must specify the good view to show
    • 22. You have 2 options
    • 23. when application enter in background
    • 24. when application didn’tstart
    • 25. When application enter in background you must use thismethod
    • 26. -(void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
    • 27. When application start because a notification, our information concerning notification
    • 28. -(BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  • Receive notification when Application enter in background
    Informations regarding notification is in userInfo. To readthat, use commande
    [[userInfoobjectForKey:@"aps"] objectForKey:@"alert"]
  • 29. Receive notification when application wasn’tstarting
    You verify if option isnull. If null, youstart application normallyotherwiseyoutake information insidelauchoptions variable. if user, duringalert notification, close it, youdidn’t have badge on your application execpt in applicationIconeBadge.
  • 30. Conclusion
    If there are a lot of mistakes, sorrymyenglishis middle but in the picture, youunderstandusing of push notification.
    Regardingdevolepment i use feedback.sandox and gateway.sandbox and developmentcertificate, but whenyourun in production you must use feedback an and not feedback.sandboxeventhings for gateway. You must have production certificate