# Firebase Notification Integration - iOS Setup

**Creating Project In Firebase**

1. Go to Firebase site and sign in with your Google account if you have not already <https://firebase.google.com/><br>

   <figure><img src="https://lh4.googleusercontent.com/jdV58KDupCfTBmxB6dB9l1jz3LaGmm7j8SzihZFD6Xt_vr1UfA0bdNmopDxcSgxpFfcFGtI-vmBAAy5zvQHBYIXFTYFnSKjV3HrCkAEYA0YwYjLYU_LP5bahXfCb5ml6pf1rWesSpb6GRX9Oyi517hw" alt=""><figcaption></figcaption></figure>

2. Click on "Add project" and give it a name then continue<br>

   <figure><img src="https://lh5.googleusercontent.com/ryhmFNZ-H37lyQTKksePsw7p06_0uY0kRTb_Igg3Vjl-eAwKIr_z4PvoLyFhyPxp7Ytkqxx0BzufrHn8iefmgJgpR9KaoasBR1AnGX3giX8edkuteNY65jRQlV_2iwpkw9z1oFCU9fafo23A0moiwWo" alt=""><figcaption></figcaption></figure>

3. Click on Continue<br>

   <figure><img src="https://lh3.googleusercontent.com/Hv-JnJ4s3dDmkwk_myAQ9j7DQi8oKPy7DexPiEFOr3wHX_gXlpHhEiifCV4ejvw6WC0lOroqnKw8dW0U5Q1Os7NV8sARXLhwtLH27zlDJ9PZbmiY8juixVUwpLC11O-jm9Lj-nfxteeGNaLaLxUnU58" alt=""><figcaption></figcaption></figure>

4. Click on Default Account For Firebase or you can also create a new account. Then click on create project.<br>

   <figure><img src="https://lh4.googleusercontent.com/SvC-TMClQepYzZrt1WOWEDmqLMPNCSBzQWAesc129rBexkdZmdn6fUeqAg8JaLrjNV8BAGnQjAfnvlPEgCvQoMhH8AttyrIgvDUDXLFrmemuCsVlFo_B8RUcdx6u9KuJE0Nn734tHUkWIcFzvPlB9rk" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://lh4.googleusercontent.com/7B2IgYV0ZptvTUeufu3aNnd83rfwhj3i7Jlvg1yxlmiFcm6W0vBOnPpMWf5oMt2MXYvhluEpdwYayGgLav1cvVXdzPcAbq4EWmDCBu8g_ncHRZahvKNgkMo7sSaS-U3RxxRmewssOl0MM_rxuU_Kmyk" alt=""><figcaption></figcaption></figure>

5. You will see the “Continue” button once the project is created. Click on it and you'll be redirected to the firebase project dashboard<br>

   <figure><img src="https://lh4.googleusercontent.com/o2jT-q4vX2tvXO0qCzYEiCYU-rpCD4SGNTYrcQAlNos67WbsI9NqGuLqJWDr4rt6UP0_q4HuF4nVWZwq8wB66Z9vunnoKAv36meHxpF1clhTk37N3bQbn0a5tJwwm-vXZmJmltj0HJTrtlxgkDkAIxA" alt=""><figcaption></figcaption></figure>

**Add IOS App To Firebase Project**

1. Click on "iOS+" icon to add the ios app to your created firebase project.<br>

   <figure><img src="https://lh5.googleusercontent.com/MCeI5BHuXyoP5nvziVoQctNIGCUKxGBWsudyiT1RX5wS1w1Z6Ai7EMXGmwPrEnPaxz6nw6kFE5udbzFVXv89tujR8DrmXwaqIDKUx-Icu-Ruf8DH59OhefH8ks4Lhtv2_Q5NdhZF1tczL_w9Igw_tdw" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://lh5.googleusercontent.com/08M-1YBm_bpfvEH4N1yLWdoN50P514nfHFtvFOt_RgXGT1kAk22g-CwXmqB0YaI8soVthwar4zWar5Z1xG0d_Kz-V0EQckcmhnVmUDadyMgXHxeoHhS9StsTxl0uza07WjlBYxtiqpOqvkRSjjyIUuI" alt=""><figcaption></figcaption></figure>

2. Fill in the Apple bundle Id and Click on "Register app" button<br>

   <figure><img src="https://lh4.googleusercontent.com/oKyTD-LPYl-lEGCJ9ZljIJq8Y3WPVboeXrB04HAIb3hWGNqovVT0mG9ozhGuFQcZx8duSkH1GjuvxqZGFlM7y_YTlMVJrHs_Zq_TgfeX69NLNUQoz7HAr23i2bL1Dzh69J-5qLYLS2bG4-NJG08G_cg" alt=""><figcaption></figcaption></figure>

3. Download the GoogleService-Info.plist, it will be used later.<br>

   <figure><img src="https://lh6.googleusercontent.com/VL8SDr3qSJhkVWb9fu1OR-m8cSN7WQ7ppcf7YpzlqCcNs_iK0ONNOebf0LJmL16qkxGtlLx48ex8TK6lT_MsbmjiXu4l0tnOsCGqu6fRfzqKI7K9uN4wi027goUrNJ5Ra2Jny4yNmN5Hh35dK-xttDY" alt=""><figcaption></figcaption></figure>

4. Then you can simply click on the Next button. You don’t need to worry about the code shown we've done that handling for you in the app. Then you can click on continue to the console.<br>

   <figure><img src="https://lh5.googleusercontent.com/oUCrmVOxqF-r7PeHDIlmf1LgH6S4v356-s5T9FbYyVG6PoFdetx-Cm26bEYrO2TMgJZm6EHEBXi6hF9S5PzZkLhRbHxcHPP3n4uk2CmhP9p8GWayPJC8ldldzUuSgwrcSstI0dcDJCRqDptsqWQ9OfY" alt=""><figcaption></figcaption></figure>

5. Now your dashboard will have the recently created ios app.<br>

   <figure><img src="https://lh4.googleusercontent.com/OEm-1wZtrYnyUOhpJH7WAzxML8MIiFkX_kCBRz7BRLGZDwqpJZgYoEhkimLk_-TsbiXPaHNBmzEDUOy8Srm5cQNcHOwI5S8gCC9fpkziUCT9SXO_bWa3_r9pDGqRwWsqHydEDd25FDVSGgFoxMwH4BQ" alt=""><figcaption></figcaption></figure>

6. Click on the settings for ios. Then we will configure a few things.

   <br>

   <figure><img src="https://lh6.googleusercontent.com/TfcoNAFNW6w3jaMFsecNfCXCkfUEdGUfj4WgLJJ7BxJCayGEojk8qu02p_PrPW2mSyxT3Jq3j15nPupiGpWougCgHLltF-IOdaCsMwLYmJDF88jLTu0gCIooX4JJazUauO5ya_QovNZcndq4DXXG6wA" alt=""><figcaption></figcaption></figure>

7. You can manage all your apps for this project from here.<br>

   <figure><img src="https://lh4.googleusercontent.com/nVfdOZZfLtKtEr6w20wsBdxkOdsa884xWgVWAK4kaNSXBTlaAfl_TWwkELlM0ks0JzrOn6MKtfiBFbxsnPU91aY-3s9cOkYp9WV-oEqQjmBehP0kzP6NxF6PkCKBiTU2BLpV4E3ZbEx1ok9L5TUPS3w" alt=""><figcaption></figcaption></figure>

8. Scroll down to the “Your apps” section and you'll be able to see all your apps added to this project.<br>

   <figure><img src="https://lh3.googleusercontent.com/7OO0-GYOGi2GeSsQ3hfOYTrhzp9Fa-rfPPUyEQwhk-b6gV5suJliggALFRHv6WzCPmJoqTBYgpN8MXuv87xc87k_HWN5YHUddBNFKYF8xP3VoG848OpuLCz9UDKQX71i-Pka3lIHj5CaGZVlzn4mPvM" alt=""><figcaption></figcaption></figure>

9. Since FCM uses APN to send notifications to Apple devices. We will need to upload the auth key (.p8) file generated from developer console to firebase. Go to this link:

   <https://developer.apple.com/account/resources/authkeys/list>

   <br>

   <figure><img src="https://lh6.googleusercontent.com/f6b8yqZRhGmJXaNzYskTvRX26g5J7HjqBN3IhSH20sGHAWRMjnRJKrimSckg0fd-Fyd0dY4kL_Uj2_wzVDqBMG_uImuVY-OolyLQwm_SPD6HdiVciVKj_J8cjSzwe3rd8dA_J8XJDp1GogJe6ZgQCqQ" alt=""><figcaption></figcaption></figure>

10. Click on plus icon and give key name and select the APNS option then click on continue.<br>

    <figure><img src="https://lh5.googleusercontent.com/PnJFMcRqRFK-BLBS-QO0XNC7x9DGZgkYcDyBsfc8xLXyY7Zkrj0vSbbGGbBKBK5yt9l8O0hwnJ0mhFjBx778NmYEoaQJWeMrqstgEJFfvw2GDJerw7Ry2a3sYPdRuZuH5LbA4ghtVM6aetKBZk9G42w" alt=""><figcaption></figcaption></figure>

11. Now you will see Register button and simply click on it

    <br>

    <figure><img src="https://lh4.googleusercontent.com/hiEFP9ri1mpZCQIm2TQAU1zz2gw4QRR3TicedVbmadEka2W5n6RNgzLl9E8cP1JfL3SDhTa-aLZDqrBQ2S16If8c9jx0xnQu5ZbNJHrnoRLeYIy6rg4cH5eC25EnktYh0Dv8rEB-AJGqZtVFu4XO0O4" alt=""><figcaption></figcaption></figure>

12. Now you’ll need to download this key by clicking on the Download button. Make sure you save the file and have a backup somewhere since you won’t be able to download again.<br>

    <figure><img src="https://lh5.googleusercontent.com/u4LCy6piJ7-RJIa50z12dFs4TneCT_20s4ybkDWWWOAuKnAyUx6Dw54N_mW2Ul1ctXvn-esjM7VfcAfHrthWgSzK04CNebHr7SvpYB5S7ISwJTpEzlwsIt6z4C5wcMwX13ID-xd1VPs4R3ro08vzjDE" alt=""><figcaption></figcaption></figure>

13. Now we can go back to firebase project settings. You can add your team id also.

    <br>

    <figure><img src="https://lh3.googleusercontent.com/bxJfwmYldted2Izq6hGXy35b0NQs7iD7FJNUP-aNv0eyfGC5t-vObPF59BxPbZ_n-EtOP0PY51dW44T4q6HAf2xubz-dQpdLx9DMvXkOofq5SIhHxvUActxbWxH4HYsLoapWy5wWA8uGzPwuKfxxVlk" alt=""><figcaption></figcaption></figure>

14. After adding team id now we can upload our .p8 file to the cloud messaging section. Click on the Cloud Messaging tab and scroll down to apple app configuration.\ <br>

    <figure><img src="https://lh4.googleusercontent.com/e5ozJaZnVXzXUSfoc0A1SsUjHwZ1wBQ63x1UpcyWXUalH9MO_sQwS2VzAyFrH76vizKh7j3xUUf7tH7wud3U6X8hGxMG-cGLhiTB6GwlViDJJs46xyG2lSIuPGP0kcNHGqDTsy8ykJnklu04dheqBrw" alt=""><figcaption></figcaption></figure>

15. Click on Upload.

    <br>

    <figure><img src="https://lh4.googleusercontent.com/lLTMrNeNNOY30nJmWvLN7k_iBfVbqxezVm0jz6UbIQjD-jDJ0ksSi1ws9elpmevw3qBrlew5iehMbum8c4o7ZZ1qjiz3q4skNQgjEdk6m5hR9qwSvHdkbNJhGOKyOsNL9xPo3SJj3NZ9nCY8r-zCpko" alt=""><figcaption></figcaption></figure>

16. Now you can upload your .p8 file either by dragging file to that section or Clicking on Browse button<br>

    <figure><img src="https://lh6.googleusercontent.com/XiajRj9KvNpHo1EDcrLKDIVFew6PpiJfj9GKg0PzR5CpDQ59moa9BV9nAFoXYfvmWUUUlAED6OwnIRMZAMig5gWKOv7GG6Al392mj0wiwWxs4CF3THOvXR8YYLexWFApRxNiClUcxAqyydaB2M6vq8E" alt=""><figcaption></figcaption></figure>

17. Now to get the Key Id you’ll need to go back to the keys section.  <https://developer.apple.com/account/resources/authkeys/list>

    <br>

    <figure><img src="https://lh6.googleusercontent.com/E88nHuaCy51LbomvWuz-DlIsAiVXf8SGK-e50WjxhTWVxw_RX9YnCasQqN3wy2PcbRqZYy4auC1wbRQio-EQwK32kdPL1cfdlZkC4UHH5eql7O7zy7GtO6NJCd8l4i9FGE4v8Nr_uqWoWIhWR4nYNZo" alt=""><figcaption></figcaption></figure>

18. After Clicking on the key you generated for this firebase project you can see a screen something like this. You can see the Key Id simply copy it.\ <br>

    <figure><img src="https://lh3.googleusercontent.com/5Xt2ZANUu_YnzC-z-5wLajt8NmP275Q5ukao_jV-Z9I5i2fpkQtN8tWZQAm0zbXvq9uwjn4DZCKxd1m4YoDqhZZer8get9krxFQrxKWbUMMOyM5AzN5hCCb4dW5F1_60TNIgzxcc_NcAxjMSWbT6zk8" alt=""><figcaption></figcaption></figure>

19. Now you can paste your key id. Then click on upload button\ <br>

    <figure><img src="https://lh3.googleusercontent.com/gJTtY9WOmTLVysTXzoHv6IUe2p-9eU8AYlxelYI_eQeun2Jf574DI6ZTbi2vEMKRS8nw0XEHmo4wcFC7uywnbZMRIfkJ1lcYXvqnaTrNd5yEA4ScUNqHUxS2cyEYnVRhPaR0GAyyhAPxcG3Q6LTeE1Q" alt=""><figcaption></figcaption></figure>

20. Now you will need to upload the GoogleService-info.plist file that we had downloaded earlier while creating the ios app. You can download again from the project's settings.Click on save and submit for app build.\ <br>

    <figure><img src="https://lh3.googleusercontent.com/fhoWyg_gFIG-GTzMr-PGPIcF5lJhrh6sJMX_cz8PmX0gLosJf1x_gs4bfsWqqafzQnaBgR3QICqjWjfatuZ24q_7bexWNhgRlLYFelcxx5BKMdpoBs1R4VZFkih7zoUNtZt-jD37IxbdrtEbyFwwhGs" alt=""><figcaption></figcaption></figure>
