# iOS configuration for advanced notifications

### How to configure my iOS build for advanced push notifications?

To send advanced notifications to your app users, you must first configure your app build first. Watch the step-by-step tutorial to understand the process of configuring advanced push notifications.

{% embed url="<https://scribehow.com/shared/iOS_configuration_for_rich_notifications__tbkVe5U-Rom4Sk-pN04JRg>" %}

#### Step 1: Generate APNS certificate and Upload

* Log in to your [**Apple developer account**](https://appstoreconnect.apple.com/)**.**
* Click on Certificates, Identifiers & Profiles.
* Navigate to the Certificate screen. Click on the add(+) button to generate a new Certificate.
* Select Apple Push Notification services SSL (Sandbox & Production).
* Next, click on Continue.
* Select the App ID (Bundle ID) corresponding to your app.
* Upload a Certificate Signing Request. Follow this [guide to generate a CSR file](https://support.appmysite.com/app/download/ios/certifications/certificate-signing-request). If you already have a CSR, you can use the existing one.
* Download the certificate.&#x20;
* The downloaded to certificate will be in the CER format, which will need to be converted into p12 using keychain access.
* Double click .cer file to open Keychain Access window.
* Click on Login and navigate to the My Certificates tab in the Keychain Access window.
* Right-click on the .cer file and export it to your system.
* Give your certificate a unique name and select .p12 File Format.
* Protecting your certifcate with a password is optional
* Upload the certificate in the APNS Certificate in your Notification Build Settings.&#x20;
* Submit the password if you protected your certificate.&#x20;

{% hint style="warning" %}
APNs certificates authenticate push notifications sent to iOS devices. Ensure you generate and upload the correct certificate to enable notification functionality.
{% endhint %}

#### Step 2: Generate Notification Identifier

* Log in to your [Apple developer account](https://web.archive.org/web/20240226195544/https://developer.apple.com/).
* Click on Certificates, Identifiers & Profiles.
* Select Identifiers from the side bar.
* Click on + next to the Identifiers.
* Select App IDs then click on Continue to proceed.
* Select App & enter a description of the identifier.
* Copy the Notification Bundle ID from the [Build Settings](https://app.appmysite.com/app/notifications/build-settings) screen from AppMySite.
* The notification bundle ID is the one that ends with **AppNotificationServiceExtension**.
* Paste it in the Bundle ID field.
* Then, click on Continue to proceed.
* Register to confirm the app identifier that you’ve created.
* Your Notification Identifier has been created.

{% hint style="warning" %}
The notification identifier allows your app to communicate with Apple Push Notification Services (APNs) and must be correctly configured to enable push notifications.
{% endhint %}

#### Step 3: Obtain and Upload Your Notification Provisioning Profile

* Navigate to the Certificates, Identifiers & Profiles section in your dashboard.
* In the sidebar, click on Profiles under the Provisioning Profiles section.
* Click the + icon in the top-right corner to create a new provisioning profile.
* In the profile creation screen, select App Store Connect as the distribution type and click Continue.
* From the list of available App IDs, select your Notification Bundle ID associated with the app and click Continue.
* [Choose the certificate](https://support.appmysite.com/app/download/ios/certifications/iphone-distribution-certificate) associated with your app's provisioning profile and click Continue.

{% hint style="danger" %}
Select the distribution certificate that is associated with your iOS app build. Creating more certificates can cause issues with notifications.
{% endhint %}

* Provide a name for your provisioning profile in the Profile Name field (e.g., "Notification Provisioning Profile").
* Click Generate to create the profile.
* Once the profile is generated, click Download to save the file. It will have a .mobileprovision extension.
* Return to your AppMySite dashboard.
* Navigate to the Notification Build Settings section for your app.
* Upload the .mobileprovision file in the Provisioning Profile field.
* Save the changes to complete the configuration.

{% hint style="warning" %}
The notification provisioning profile is required to authenticate your app with Apple's notification servers and must be uploaded before enabling push notifications.
{% endhint %}

#### Step 4: Upload the APNs certificate in Firebase

* Go to your[ Google Firebase](https://firebase.google.com/) account.
* Select the project you created for your iOS app.&#x20;
* In the Project Overview screen, click the gear icon near the top-left and select Project settings from the dropdown menu.
* In the Settings page, navigate to the Cloud messaging tab.
* Scroll down to Apple app configuration and expand APNs Certificates section.
* Upload the certificate in the “No production APNs certificate” field.

{% hint style="danger" %}
If you haven’t set up a Firebase project yet, [**refer to this guide**](https://docs.appmysite.com/app/notifications/basic-notifications/create-firebase-project)**.** If you already have a Firebase project for plain notifications, ensure you use the same project to upload the APNs certificate.
{% endhint %}
