# Safari Certificate

{% hint style="warning" %}
Currently, this is a legacy method - new Safari browsers (since 16) support PushAPI and VAPID. Use this instruction only when you want to support old Safari browser versions.
{% endhint %}

Integration with Apple Push Notification Service allows you to send push notifications through Safari browser.

Authorization takes place via certificates. In order to integrate your project with APNS, you will need to request a certificate in a p.12 file format from a Certificate Authority in your Certificate Assistant first.

Integration content:

* certificate store - store containing a private key and a public key issued for a specific appBundleId,
* passphrase for a certificate - can be empty if the store is not secured with a password

### Create Certificate Signing Request

To generate Safari certificate you need to create **Certificate Signing Request** first.

For this purpose, launch the Keychain Access app.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FbWRrvMORS6ZFlIQzUTlJ%2F1559292646-2019-05-291552.png?alt=media&#x26;token=47065ff7-f626-40e4-97e5-2760fa5927bc" alt=""><figcaption></figcaption></figure>

Click on Keychain Access > Certificate Assistant > **Request a Certificate From a Certificate Authority**.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FPsVqm9d9jbnjmCFqn4jA%2F1559292830-2019-05-291554.png?alt=media&#x26;token=557d01e3-b3e0-4cd4-9b7e-bd3c4debac3b" alt=""><figcaption></figcaption></figure>

The Assistant window will appear. Enter your e-mail address and name for your certificate. Then check Saved to disk option and click Continue.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FfgSRJEPUoEFK1wcavYRj%2F1559293082-2019-05-291556.png?alt=media&#x26;token=d289d943-a09b-447d-b07c-1b8089d38c21" alt=""><figcaption></figcaption></figure>

Save the Certificate Signing Request (CSR). **You will need it to generate a certificate**.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FalYOVv96AgpkUL3b5gUK%2F1559293626-2019-05-291558.png?alt=media&#x26;token=9b17445b-09c2-482c-8809-fde8999853e5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FFhnD36g15sb2rdG1boTg%2F1559293673-2019-05-291559-copy.png?alt=media&#x26;token=40eb1856-9c6a-4db6-a131-1cf3d6fec2bd" alt=""><figcaption></figcaption></figure>

### Register Website Push ID for APNS

Log into your [Apple Account](https://developer.apple.com). Here you will need to create **Website Push ID** for your project. In order to do that, go to Certificates, Identifiers & Profiles section.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FtuTIYTUr86bbIARel3Fx%2F1559293809-2019-05-291602.png?alt=media&#x26;token=db8f081b-7cc3-4b06-99e9-c90c811ad58c" alt=""><figcaption></figcaption></figure>

Select Identifiers tab and click "+" icon to add a new ID.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FBoXvm0KruxihsXxC0QGY%2F1599048034-1.png?alt=media&#x26;token=52b36dc4-9c72-46c0-8345-0bfdece643bb" alt=""><figcaption></figcaption></figure>

Check Website Push IDs option and confirm your choice by clicking Continue.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FcexNLbM6itboOxUi06Bl%2F1599048037-2.png?alt=media&#x26;token=dc9368fb-5616-40ba-8ad4-2a45e6cf743a" alt=""><figcaption></figcaption></figure>

Type description for your project in the Description input. In the Indentifier input enter the url of your domain (where you want to display the sign-up form). Remember to enter the url the opposite way, e.g. web.com.porannakawka.testppg. This is known as the **Reverse Domain Style**.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FVqjY78jU1yCDdaYq9UU0%2F1599048041-3.png?alt=media&#x26;token=08b170c4-68f3-4441-96c2-f1c89254b807" alt=""><figcaption></figcaption></figure>

Click Continue and check if everything is correct. If so, confirm with the Register button.

### Generate Web Push Certificate&#x20;

Go to Certificate tab in Certificates, Identifiers & Profiles section. You will see a list of certificates you have created here. Click "+" icon.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FjmCwBj7UitfOotwHjyaZ%2F1599048044-4.png?alt=media&#x26;token=000eb886-149e-42dc-9202-1e0475c3906d" alt=""><figcaption></figcaption></figure>

Scroll down to "Services" part, check Website Push ID Certificate option and click Continue.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FNcUiiQK56bHhqhFOFNyl%2F1599048046-5.png?alt=media&#x26;token=59bd4105-0f37-4bc9-a798-113f16356f47" alt=""><figcaption></figcaption></figure>

Select the Website Push ID you have created earlier from the list and click Continue.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FLXE65FbycqCMAeiplMYH%2F1599048049-6.png?alt=media&#x26;token=b6731c56-e9d6-433c-97ba-9d8fde2e84db" alt=""><figcaption></figcaption></figure>

Now you have to click on the Choose File button and select the CSR (Certificate Signing Request) you have generated. Proceed with Continue button.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FVknYTcQBuWGUbERkbCeD%2F1599048052-7.png?alt=media&#x26;token=5363dad4-9c5b-4224-bb56-5c6a448178c7" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FoFoGQlYFN3twzif8obTH%2F1599048054-8.png?alt=media&#x26;token=c996190e-9de4-4ef2-a08a-aa4cf842f444" alt=""><figcaption></figcaption></figure>

Download your certificate. **Now we need to install and export it**. :warning: Double-clicking on the downloaded certificate will install the certificate in the Keychain Access app.

The installed certificate will appear in Keychain Access (which you have used to create CSR). Right-click on the certificate and select Export "Website Push ID:...".

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FvrI4vTmnKCmckX04nkZz%2F1559295659-2019-05-291632.png?alt=media&#x26;token=c9dac9ee-0942-45c4-9cb7-87a581390649" alt=""><figcaption></figcaption></figure>

Save certificate using Personal Information Exchange (.p12) format.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2Fcra4zvRhOq65EkiR9wou%2F1559295828-2019-05-291633.png?alt=media&#x26;token=29de1df5-b1c9-4608-b814-4c6a85b5ec27" alt=""><figcaption></figcaption></figure>

Enter password and remember it - you will need to password to integrate your project with APNS.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FJkmARKuYGezSFO7Bvfc6%2F1559296350-2019-05-291634.png?alt=media&#x26;token=96d46fa0-b14a-48bd-954d-6bfb384ffeec" alt=""><figcaption></figcaption></figure>

Certificate has been saved on your device. It is ready to upload in our app.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2Fnf6Ts9xExl4hF9E3XOAA%2F1559296425-2019-05-291638.png?alt=media&#x26;token=374ed561-22bf-4f96-992a-422d28875a0d" alt=""><figcaption><p>Got it! <span data-gb-custom-inline data-tag="emoji" data-code="1f44f">👏</span></p></figcaption></figure>

Go to the Settings > Integration >Web push integration section.

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2F1G6bWzAhtv9QH4YfkwcW%2FScreenshot_106.png?alt=media&#x26;token=f9b2e172-b0cf-483b-992c-e0a0aee5de26" alt=""><figcaption></figcaption></figure>

The next step is to upload the certificate store in the p12 file format and enter its passphrase (if required).

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2FhvdVagwJ9d6TYcTNubkI%2FScreenshot_107.png?alt=media&#x26;token=51e9b5df-29ec-48a3-bee0-22a55adae29e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2886427578-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_L2jrbLGTIbcnHMUrm%2Fuploads%2F62ZPXRMd1siVrWzRM9Ms%2Fsafari%20integrated.jpg?alt=media&#x26;token=7341562b-3c05-4c21-92c9-a3cb4d6f5b1b" alt=""><figcaption></figcaption></figure>

:information\_source: [Here](https://app.pushpushgo.com/project/providers) you'll find an alert about the approaching certificate expiration. We will inform you 30 days before the date.
