question: Do we need to edit AppDelegate.swift?
mesqueeb opened this issue · comments
Some things to note about the AppDelegate.swift file:
- A fresh install of iOS capacitor 3.x ends at line 67.
- The documentation on
@capacitor/push-notifications
has lines 69 ~ 79 but without the#if USE_PUSH
- The example app has a lot of extra code below 79:
https://github.com/capacitor-community/fcm/blob/master/example/ios/App/App/AppDelegate.swift#L81
Questions:
- Do we need to manually add all these methods for the FCM plugin to work? (the stuff below line 81)
- Do we need to include that
#if USE_PUSH
or not?
I'm sorry to ask so many questions, but I'm not familiar with Swift : S
- no, it's not required
- yes, but the
#if USE_PUSH
is optional, if you plan to implement push you need the whole block, otherwise you can remove it.
@stewones In order to get push notifications to work on iOS, I had to add the following to my AppleDelegate.swift
: https://d.joshf.xyz/LBSR8X, which is also documented here.
I just wanted to make sure that this was expected (and that there wasn't something I was missing), since I was under the impression that this package made it so that you didn't have to modify any native code. I also don't see this mentioned in the iOS setup
(in the README).