Chapter 6: Method Does Not Exist

Chapter 6 says " Open AppDelegate.swift and change the IP address in the sendPushNotificationDetails(to:using:) …" but the project we created in Chapter 4 does not have any method named “sendPushNotificationDetails”. You can even search for this term in Chapter 4 and it does not exist, so where did it come from?? Even Chapter 5 doesn’t say to add it.

I see it exists in Chapter 7 but when and where did we decided to even add it??

Even the downloaded sources from Github does not have any method with that name in their project 4 or 5.

Upon exploring, it gets even worse. The starter project for Chapter 7 doesn’t even have the “sendPushNotificationDetails” method either! So Chapter 6 is referencing a method that we haven’t even added yet until we complete chapter 7!

hi Galois! the first paragraph of the section you’re quoting from says to use the final project from Chapter 7:

Now that your server is operational and has an endpoint to store a token, you can make your iOS app send the token to the server once it registers for push notifications. Chapter 7, “Expanding The Application” already includes a ready-made app that performs this task in the final folder of its materials. First, build and run your server. Next, open the PushNotfications iOS app from Chapter 7 in a separate Xcode window.

it’s just to test your server setup.

you don’t actually need the Vapor server to do the exercises in the book, because you’ll use PHP scripts to send the notifications. When I did the video course for the previous version of this book, I showed the server stuff at the end of the first section, after showing the Common Scenarios.

1 Like