0

I'm developing a website and would like to implement Safari Push Notification support to it. I've gone through this tutorial by Apple. They wrote once there is a hit at webServiceURL/version/pushPackages/websitePushID we have to deliver our pushPackage, but they haven't mentioned clearly on where it should be delivered and stored. Do we have to code on the client side to save that package somewhere safe? or Safari itself would just handle the package?

And a bonus question, would the following code work just fine to deliver the package?

@GET
@Path("/zip")
@Produces(MediaType.APPLICATION_OCTET_STREAM)

public Response downloadFile() {
    File file = new File("/../pushPackage.zip");
    ResponseBuilder response = Response.ok((Object) file);
    response.header("Content-Disposition", "attachment;filename=pushPackage.zip");
    return response.build();
}
Sivaprasanna Sethuraman
  • 4,014
  • 5
  • 31
  • 60

2 Answers2

1

Here is a java implementation for safari push package delivery. If you are implementing this for a webapp, same push package can be used.

Browser-push repository

TRiNE
  • 5,020
  • 1
  • 29
  • 42
0

safari do it itself, (look to Listing 2-3 Handling permissions for website push notifications)

u just ask it to download and store your package

karaken
  • 94
  • 3