Chapter 6: PushNotifications project

Hi.

I’m at Chapter 6 trying to setup Vapor. I don’t get where I should find PushNotifications project? Here is the quote:

“Open the projects/starter folder, where you’ll find a starter project called PushNotifications which has the base configuration already taken care of for Vapor. It has been modified to use PostgreSQL as the database instead of SQLite and contains empty files for your model and a controller so that Vapor knows about them.”

Could you help me with that?

@gargoyle Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hi @suholet, did you download the project material with the book or just the PDF? If you grab the accompanying files you’ll see a directory called 06-server-side-pushes and in there is a ‘starter’ directory. That has the Xcode project that is being referred to.

I totally forgot about the files. Thanks :slight_smile:

no it does not. The Xcode project file is not there.

@tomtom it’s there but because it’s Vapor based you don’t yet have a .xcodeproj file. You need to run the vapor xcode -y command showin in the “Setting up Vapor” part of the chapter to build the project.

Thanks I did that once on one Mac and it worked yesterday for the life of me I could not. Since it had been a week or so I couldn’t remember how it worked. Eventually I gave up and just copied the working one to the other machine. Also the book has the paths as “Open the projects/starter folder” and that path doesn’t really exist. So you are left guessing.
Anyway many thanks for getting back. I really appreciate it. I have used push before but it was in 2008 so I wanted to see what is new. So far I am just doing setup so I a=m frustrated when it does not work since this is stuff I have done before. I am interested in Vapor now, so thanks for that

I am running into an issue running the command: $ vapor xcode -y

The error produced is:
Error: backgroundExecute(code: 1, error: “The file /Users/johntyler/Dev/rw_push/*.xcodeproj does not exist.\n”, output: “”)

Based on the book and this forum post, I believe am using the right files:

The files I am using are in this location:
Push_Notifications_by_Tutorials_v1<U+2069><U+2068>06-server-side-pushes<U+2069><U+2068>starter<U+2069>

I made a full copy into my dev folder which is located here:
Users<U+2069><U+2068>johntyler<U+2069><U+2068>Dev<U+2069><U+2068>rw_push<U+2069>

NOTE: The terminal session notes below provide file listing results so you can see for yourself whether the files are as expected.


Terminal Session Notes:

~ 150 $ cd Dev/rw_push
~/Dev/rw_push 154 $ pwd
/Users/johntyler/Dev/rw_push
~/Dev/rw_push 155 $ ls -l
total 72
-rw-r–r–@ 1 johntyler staff 5678 Sep 24 2018 Package.resolved
-rw-r–r–@ 1 johntyler staff 505 Sep 24 2018 Package.swift
drwxr-xr-x@ 3 johntyler staff 96 Sep 24 2018 Public
-rw-r–r–@ 1 johntyler staff 881 Sep 24 2018 README.md
drwxr-xr-x@ 4 johntyler staff 128 May 6 19:35 Sources
drwxr-xr-x@ 5 johntyler staff 160 May 6 19:35 Tests
-rw-r–r–@ 1 johntyler staff 6706 Sep 24 2018 api-template.paw
-rw-r–r–@ 1 johntyler staff 882 Sep 24 2018 circle.yml
-rw-r–r–@ 1 johntyler staff 92 Sep 24 2018 cloud.yml
-rw-r–r–@ 1 johntyler staff 1080 Sep 24 2018 license
~/Dev/rw_push 156 $ vapor xcode -y
Generating Xcode Project [Done]
Select the Run scheme to run.
Open Xcode project?
y/n> yes
Opening Xcode project…
Error: backgroundExecute(code: 1, error: “The file /Users/johntyler/Dev/rw_push/*.xcodeproj does not exist.\n”, output: “”)

[ NOTE: Running the file list command after the vapor command to confirm the project file is indeed missing ]
~/Dev/rw_push 157 $ ls -l
total 72
-rw-r–r–@ 1 johntyler staff 5678 Sep 24 2018 Package.resolved
-rw-r–r–@ 1 johntyler staff 505 Sep 24 2018 Package.swift
drwxr-xr-x@ 3 johntyler staff 96 Sep 24 2018 Public
-rw-r–r–@ 1 johntyler staff 881 Sep 24 2018 README.md
drwxr-xr-x@ 4 johntyler staff 128 May 6 19:35 Sources
drwxr-xr-x@ 5 johntyler staff 160 May 6 19:35 Tests
-rw-r–r–@ 1 johntyler staff 6706 Sep 24 2018 api-template.paw
-rw-r–r–@ 1 johntyler staff 882 Sep 24 2018 circle.yml
-rw-r–r–@ 1 johntyler staff 92 Sep 24 2018 cloud.yml
-rw-r–r–@ 1 johntyler staff 1080 Sep 24 2018 license
~/Dev/rw_push 158 $


Thanks very much for your assistance!!

Sincerely,
John Tyler

UPDATE:
After doing some more digging on this issue, I came across the following article on the Vapor GitHup repository.

The article described what I was running into exactly! Note the comment about HomeBrew “borking” the person’s Xcode setup.

After triple checking the recommended procedure… I updated my environment as described in the article.

[ I can understand this might give some readers pause and with good reason, however, since I recently rebuilt my machine and found the process sort of cathartic, refreshing, and fun, I figured, “what the heck” ].

After the environment update, I re-ran the command:

$ vapor xcode -y

After some time, and a rather satisfying bouncy period character progress display, the project was built and Xcode launched the project as expected… WOOT!!

Problem solved, onto the next sections of the book!!

I hope this helps anyone else with the issue

Sincerely,
John Tyler