This answer linked below is a little easier than the solutions suggested here. You can simply fix using the xCode UI without having to manually create any new files. Just flip the switch for push notifications in the Capabilities section.
https://stackoverflow.com/a/39420213/4076298