Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions docs/main/guides/push-notifications-firebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
The Push Notification API on iOS makes use of either Swift Package Manager or CocoaPods for dependency management. 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
First, open `ios/App/App.xcodeproj` in Xcode by runnning `npx cap open ios` or double click the file in finder.
First, open `ios/App/App.xcodeproj` in Xcode by running `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`:

Expand Down
Binary file added static/img/spm/firebase/firebase-spm-step1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/spm/firebase/firebase-spm-step2a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/spm/firebase/firebase-spm-step2b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/spm/firebase/firebase-spm-step3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/spm/firebase/firebase-spm-step4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.