> ## Documentation Index
> Fetch the complete documentation index at: https://laudspeaker.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending your first mobile push messages

> A complete tutorial on setting up laudspeaker for sending your first mobile push notifications

This tutorial shows an end to end example on how to trigger a mobile push campaign. It includes a very simple ios or android application, and shows how to use the laudspeaker mobile sdks, how to trigger events, connect a journey, and finally sends a push notification.

### Setting up firebase in Laudspeaker

The first step in being able to send push notificaitons is setting up firebase in Laudspeaker.

You need to navigate to the settings page, select push

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/push_options.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=3531c00d87a61a7fd5247622ac781f2f" alt="2" width="2668" height="1670" data-path="images/guides/getting-started/push_options.png" />

Then you can select the platforms you will use (iOS and/or Android)

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/push_platforms.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=a5c843125e7ea44ce74e9c7ac8a535dc" alt="2" width="1820" height="882" data-path="images/guides/getting-started/push_platforms.png" />

After which you will be prompted to add the firebase service account JSON key file.

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/firebase_upload.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=8781bc53511aae234379900a663e61d0" alt="2" width="2672" height="1624" data-path="images/guides/getting-started/firebase_upload.png" />

This can be found in your firebase console: `https://console.firebase.google.com/u/0/project/[YOUR_PROJECT_NAME]/settings/serviceaccounts/adminsdk`. The page looks like the screenshot below and you generate the file by pressing the `Generate new private key` button

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/firebasekey.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=b51d39d8a365f451a94a92fbe535312e" alt="2" width="2640" height="1590" data-path="images/guides/getting-started/firebasekey.png" />

Once uploaded the page should look something like this and you are good to go! You can skip uploading users at this point.

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/server_key.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=374f6bab1baa9744ec6efc375cf47b71" alt="2" width="2686" height="1648" data-path="images/guides/getting-started/server_key.png" />

### Setting up your user schema and user primary key

To be able to add users you will need to tell Laudspeaker how you want to uniquely identify your users. For example you may have a special `user_id` field to uniquely define your users. To do this you need to navigate to the People page under Audience.

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/people_page.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=742d72cf206e935283f216a4654acc8c" alt="2" width="2882" height="1180" data-path="images/guides/getting-started/people_page.png" />

Then click on the Settings button.

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/attributes.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=ec22ea5968c0e6b1ccbc0d726d9a53b1" alt="2" width="2906" height="1598" data-path="images/guides/getting-started/attributes.png" />

Here you can define your user's attributes and their types. Whats important for this tutorial is to add your unique identifier, and  then make sure it is selected as primary key

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/primary_key.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=7464f4185773c57889c76bc5b31d34ad" alt="2" width="610" height="458" data-path="images/guides/getting-started/primary_key.png" />

### Starting up the tutorial app

We have two sample projects you can use, an ios: [https://github.com/laudspeaker/ios-sample-app](https://github.com/laudspeaker/ios-sample-app) or android one: [https://github.com/laudspeaker/android-sample-app](https://github.com/laudspeaker/android-sample-app) . This tutorial will use the ios sample as the example but you can easily substitute with the android.

You need to add the `GoogleService-Info.plist`, you can find this in the `General` tab of the `Project settings` in firebase

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/general_tab.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=9a9a88fdadb145c33f1de11a045ddbf5" alt="2" width="976" height="386" data-path="images/guides/getting-started/general_tab.png" />

Then you can download the file here:

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/plist_firebase.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=5b3845e225f27c01903bd88e472c54de" alt="2" width="1400" height="560" data-path="images/guides/getting-started/plist_firebase.png" />

For ios, once you have the application set up in xcode it should look something like:

<img src="https://mintcdn.com/laudspeaker/2MKEidK8fhbcBiVu/images/guides/getting-started/xcode.png?fit=max&auto=format&n=2MKEidK8fhbcBiVu&q=85&s=5c543a79bec30f6ebfa9ba1419fa2cc1" alt="2" width="2374" height="1126" data-path="images/guides/getting-started/xcode.png" />

Finally don't forget to make sure push capabilities are turned on for the app, as well as background fetch and

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/capa.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=1b31ab1f21f4f3d454797a760561d478" alt="2" width="1618" height="1090" data-path="images/guides/getting-started/capa.png" />

Next you will want to add the api key in the LaudspeakerManager file:

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/laudspeaker_manager.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=d3d9d5186447ee403d1fb2481d5fe998" alt="2" width="2328" height="880" data-path="images/guides/getting-started/laudspeaker_manager.png" />

The relevant code is:

```
 laudspeaker = LaudspeakerCore(url: "https://app.laudspeaker.com/api/", apiKey: "oT5cNNyPPffC0kea9l7SYwXtT0TlgLXSx9TZEDsc")

```

Now we are ready to start up the app!

Once you start it up it should look something like:

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/example_app.PNG?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=e34617f7ff15ed6861f5aba50231790d" alt="2" width="1179" height="2556" data-path="images/guides/getting-started/example_app.PNG" />

Each button, triggers a specific sdk function. Go ahead and press on the button which says `identify`

Now that user should appear in laudspeakeer under the people tab:

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/mobile_person.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=ddd84bdabd16fd137ba497e97a992c5f" alt="2" width="2410" height="1034" data-path="images/guides/getting-started/mobile_person.png" />

If you click the person you can see the details:

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/person_details.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=7ea25923dffdf4029199927c57f3e891" alt="2" width="2438" height="1300" data-path="images/guides/getting-started/person_details.png" />

### Creating and starting our journey

Now we are ready to create a journey and send a push. We will keep it simple.

Go to the journey builder page and create a journey

The empty journey should look like this:

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/empty_journey.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=d03c0d042c2fa787bf621d4334efb940" alt="2" width="2882" height="1476" data-path="images/guides/getting-started/empty_journey.png" />

Then simply drag a push step to the canvas:

You will then be prompted to add a push template:

<img src="https://mintcdn.com/laudspeaker/In84ceyly56-IgdR/images/guides/getting-started/add_template.png?fit=max&auto=format&n=In84ceyly56-IgdR&q=85&s=cb7af98dcc1b8c71d62d84687d37c0e8" alt="2" width="2012" height="1642" data-path="images/guides/getting-started/add_template.png" />

Go ahead and name the template:

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/create_push.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=94e05f513a93e9c905b37062e1fecee5" alt="2" width="2764" height="1320" data-path="images/guides/getting-started/create_push.png" />

Add a message that you want:

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/push_template.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=d831dcc16401a498a4d4b39c50a33ba6" alt="2" width="2820" height="1572" data-path="images/guides/getting-started/push_template.png" />

Don't forget to save after finalizing the message:

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/save_push_template.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=1eb62866aa2b01102a34354447047591" alt="2" width="2830" height="702" data-path="images/guides/getting-started/save_push_template.png" />

The journey should now look like:

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/journey_saved_push.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=66939c1ddff8e48699f32f31d9882738" alt="2" width="2024" height="1486" data-path="images/guides/getting-started/journey_saved_push.png" />

Don't forget to add an exit step

<img src="https://mintcdn.com/laudspeaker/pBEukwSJZWJTykwf/images/guides/getting-started/complete_push.png?fit=max&auto=format&n=pBEukwSJZWJTykwf&q=85&s=ba973df662462899c2f9fe5370d5df97" alt="2" width="2778" height="1452" data-path="images/guides/getting-started/complete_push.png" />

We will explain its structure.

When a user is enrolled in the journey, they start in the start step and then move to push step and receive the notification.

Now go ahead and start the journey, and you will receive your first push!
