Quantcast
Channel: Developer Feed - Snippet
Viewing all articles
Browse latest Browse all 178

How to sent Push Notification for APNS in Java?

$
0
0
  1. importcom.notnoop.apns.APNS;
  2. importcom.notnoop.apns.ApnsService;
  3.  
  4. ApnsService service =
  5.          APNS.newService()
  6.          .withCert("../config/push-prod-cert.p12", "xyz")
  7.          .withProductionDestination()
  8.           .build();
  9.            
  10.                    
  11.             String payload =
  12.                 APNS.newPayload()
  13.                 .alertBody("This is alert")
  14.                 .badge(0)
  15.                 .sound("default")
  16.                 .build();
  17.  
  18.             String deviceToken ="47ca8f029ccb4aa609fee5d2bd6de800998afa3a2a02817de0e3614f84997c56a";
  19.             service.push(deviceToken, payload);

Viewing all articles
Browse latest Browse all 178

Trending Articles