How to set up iOS push notifications in SashiDo
Tags: ios, pushnotifications, tutorial, beginners
Published: 2019-10-25 11:12:30

Push notifications allow you to stay in touch with your users and make it possible for your users to communicate with each other. Before you begin, remember that push notifications are not available in the iOS Simulator. You will need an iOS device, as well as an Apple certificate to complete this tutorial. 

### Create your APNS (iOS) credentials
Creating your Apple Push Notification Service credentials is actually the longest part of this tutorial. <br />

1. Log in to the [Apple Developer Member Center](https://developer.apple.com/account/overview.action) and click on `Identifiers` under `iOS Apps` and locate your application in the list.

2. Click the `+` symbol and fill out the form. Make sure you tick off the Push Notifications checkbox.

3. Select your App under the section `Identifiers` and click on it. Then click `edit`.

4. Go to the section `Push Notifications`. Choose either the Development or Production certificate option and click `Create Certificate`.

5. Follow the instructions in the Add iOS Certificate Assistant and click `continue`.

6. Using the Certificate Signing request that was just created, generate the APNS Push SSL certificate.

7. When the `Download` button appears, you can download your certificate(s). You may need to reload the page for this to update.

8. Open the downloaded certificate with the Keychain Access app.

9. You will see your certificate under `My Certificates` or `Certificates`.

10. The final step is to export your certificate as a .p12 file. Select the certificate that was just added to the Keychain Access and select `File -> Export Items...` from the menu. When saving the file, use the Personal Information Exchange (.p12) format.

Ok, you’ve got your .p12 file :)


### Configuring the SashiDo App
To send Push Notifications with SashiDo you will need to upload the certificate you created above.

Navigate to your SashiDo Dashboard, and click on `App Settings`, then `Push`. Click on `Upload a file` under `Apple Push Certificates` and locate the .p12 certificate.
![](https://media-blog.sashido.io/content/images/2016/12/SashiDo-push-notifications-settings.png)

### Get the example app from SashiDo
Download or clone the example app from [SashiDo repository](https://github.com/SashiDo/sashido-ios-push-notification-sample) on GitHub and change the `your_application_id, your_client_key and api_end_point` in AppDelegate.m file on line [22](https://github.com/SashiDo/sashido-ios-push-notification-sample/blob/25d472f1b2f3f3390a445cd38bee5eec33797b0a/PushNotificationTutorial/AppDelegate.m#L22). It looks like this:
```
[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id<ParseMutableClientConfiguration> configuration) {
        configuration.applicationId = @"your_application_id";
        configuration.clientKey = @"your_client_key";
        configuration.server = @"api_end_point";
}]];
```

### Build the example app on your iOS Device
This should be a trivial step but you can find more information in the official [Apple guides](https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/LaunchingYourApponDevices/LaunchingYourApponDevices.html). 

### Sending Push Notifications
Now it's time for you to send some test push notifications. 
Navigate to your SashiDo Dashboard, and click on `Push`, then `Send a push`. For testing purposes, you can use the default `Everyone` audience to send a message to all of your registered devices regardless of the platform. Simply enter a message and click `Send`! You should see the notification appearing within a few seconds on your device.
![](https://media-blog.sashido.io/content/images/2016/12/SashiDo-push-notifications.png)

For more information on advanced push targeting techniques, you can see the [Parse Push Notifications for iOS and OS X Guide](http://parseplatform.github.io/docs/ios/guide/#push-notifications) 

That's it! Now you can use the power of push notification in your App :)