diff --git a/docs/main/guides/push-notifications-firebase.md b/docs/main/guides/push-notifications-firebase.md index 32323afc3..d2dbbd51b 100644 --- a/docs/main/guides/push-notifications-firebase.md +++ b/docs/main/guides/push-notifications-firebase.md @@ -4,6 +4,7 @@ description: Learn how to get Firebase Cloud Messaging working on iOS and Androi contributors: - bryplano - javebratt + - markemer slug: /guides/push-notifications-firebase --- @@ -289,9 +290,38 @@ npx cap open ios ![Google Service Info Plist Location for iOS](../../../static/img/v6/docs/guides/firebase-push-notifications/google-plist-location-ios.png) -### Add the Firebase SDK via CocoaPods -The Push Notification API on iOS makes use of CocoaPods - an iOS dependency management system - and we need to tell CocoaPods to make use of Firebase. +### Add the Firebase SDK + +The Push Notification API on iOS makes use of either Swift Package Manager or CocoaPods for dependency managment. We need to tell them to make use of Firebase. + +#### Using Swift Package Manager (SPM) + +To add the SDK using SPM, you'll need to make a modification to your `ios/App/App.xcodeproj` + +First, open `ios/App/App.xcodeproj` in Xcode by runnning `npx cap open ios` or double click the file in finder. + +Select your App on the left side and select package dependencies on the right, as shown below. + +![SPM-FB-Step1](../../../static/img/spm/firebase/firebase-spm-step1.png) + +Then, select the plus icon to add a new package, something like the below should be shown. + +![SPM-FB-Step2a](../../../static/img/spm/firebase/firebase-spm-step2a.png) + +In the search box, enter `https://github.com/firebase/firebase-ios-sdk`, then select "Add Package." + +![SPM-FB-Step2b](../../../static/img/spm/firebase/firebase-spm-step2b.png) + +Now scroll and add Firebase Messaging to the App target. + +![SPM-FB-Step3](../../../static/img/spm/firebase/firebase-spm-step3.png) + +Click "Add Package", and wait for processing to finish. When it has you should see something similar to this image. + +![SPM-FB-Step4](../../../static/img/spm/firebase/firebase-spm-step4.png) + +#### Using CocoaPods To do this, we need to modify the `Podfile`, which can be found in Xcode under `Pods`: diff --git a/static/img/spm/firebase/firebase-spm-step1.png b/static/img/spm/firebase/firebase-spm-step1.png new file mode 100644 index 000000000..f441ce04c Binary files /dev/null and b/static/img/spm/firebase/firebase-spm-step1.png differ diff --git a/static/img/spm/firebase/firebase-spm-step2a.png b/static/img/spm/firebase/firebase-spm-step2a.png new file mode 100644 index 000000000..eb87de02d Binary files /dev/null and b/static/img/spm/firebase/firebase-spm-step2a.png differ diff --git a/static/img/spm/firebase/firebase-spm-step2b.png b/static/img/spm/firebase/firebase-spm-step2b.png new file mode 100644 index 000000000..170bf3104 Binary files /dev/null and b/static/img/spm/firebase/firebase-spm-step2b.png differ diff --git a/static/img/spm/firebase/firebase-spm-step3.png b/static/img/spm/firebase/firebase-spm-step3.png new file mode 100644 index 000000000..5640322d9 Binary files /dev/null and b/static/img/spm/firebase/firebase-spm-step3.png differ diff --git a/static/img/spm/firebase/firebase-spm-step4.png b/static/img/spm/firebase/firebase-spm-step4.png new file mode 100644 index 000000000..b9ce46806 Binary files /dev/null and b/static/img/spm/firebase/firebase-spm-step4.png differ