• Save
Apple notification push
Upcoming SlideShare
Loading in...5
×
 

Apple notification push

on

  • 2,938 views

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

Statistics

Views

Total Views
2,938
Slideshare-icon Views on SlideShare
2,914
Embed Views
24

Actions

Likes
1
Downloads
0
Comments
0

6 Embeds 24

http://inforeseau.blogspot.com 17
http://kolibria.jonathanramier.fr 3
http://localhost 1
http://www.inforeseau.blogspot.fr 1
http://inforeseau.blogspot.be 1
http://inforeseau.blogspot.fr 1

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Apple notification push Apple notification push Presentation Transcript

    • Apple notification push
    • Summary
      Example of notification
      Architecture APN
      IPHONE Authorization
      Yourcode in Xcode
      Myprovider Register
      Certificate
      Send a notification
      Return disableddevices
      Receive a notification push
    • Example of notification
      Exist 2 notification versions :
      • Local Notification Push
      • Remote Notification Push
      We work with second type of notification
    • 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
    • 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)
    • 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 …
    • 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.
    • 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
    • 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)
    • My PHP code register IDIPHONE
    • 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 
    • 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
    • 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
    • Create a certificate
    • 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)
    • Certificate .PEM
      Open your terminal and tapez
      Test yourconnection, if failreverifyyour certificat, it’sbad
    • 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.
    • Script sendNotif.php
    • Return disableddevices on feedback.sandbox
    • Receive a notification push
      • Whenyoureceive a notification, more often you must specify the good view to show
      • You have 2 options
      • when application enter in background
      • when application didn’tstart
      • When application enter in background you must use thismethod
      • -(void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
      • When application start because a notification, our information concerning notification
      • -(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"]
    • 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.
    • 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