Group Group Group Group Group Group Group Group Group

Errata for Push Notifications by Tutorials, 3rd ed

Creating this topic to catch any typos and bugs in the 3rd Edition of Push Notifications by Tutorials.

1 Like

Really looking forward to this! do you have an ETA?

If I said anything other than “very very soon” @mandafrederick would hunt me down and hurt me, so…very very soon :]

1 Like

I found an error in the example code.

Chapter 7: Expanding the Application
See AppDelegate.swift in the Sending the token section.

guard let url = URL(string: "http://192.168.1.1:8080/api/token") else {
  fatalError("Invalid URL string")
}

I think it should be fixed as follows.

guard let url = URL(string: "http://192.168.1.1:8080/token") else {
  fatalError("Invalid URL string")
}

The code in the book (I think that’s what you’re referring to) is correct. In Chapter 6, when creating the TokenController, you setup the routes like so:

func boot(router: Router) throws {
  let routes = router.grouped("api", "token")
  routes.post(Token.self, use: storeToken)
  routes.delete(String.parameter, use: removeToken)
}

meaning you POST to …/api/token