Did you get an earthquake alert on your phone Sunday?

There are several ways to make sure they’re delivered to your smartphone. Here’s how.

First off, there are two types of earthquake alerts: early warning alerts and notifications that an earthquake just happened.

Follow Rich DeMuro on Instagram for more tech news, tips and reviews.

Lots of apps can notify you after the fact, but early warning alerts are key and they’re supposed to be delivered seconds before you’re expected to feel the shaking start. A critical warning to find cover and get to a safe place nearby, away from falling objects.

There’s a special system of sensors setup by the USGS in California, Oregon and Washington that powers the early warnings.

The first way to get them is through your cellular carrier and Wireless Emergency Alerts. These are similar to the alerts you get for flash flooding and Amber Alerts. You can turn these on or off in your phone’s settings.

On iOS, go to Settings > Notifications and scroll all the way down to the bottom of the screen to the section labeled Government Alerts. You can toggle them on or off here.

On Android, go to Settings > Safety & emergency > Wireless emergency alerts. There are toggles for various alerts here.

Google has also built in earthquake alerts into the Android operating system. You can find the settings for these alerts under Settings > Safety & emergency > Earthquake alerts. Google says Android will use your approximate location to send alerts about magnitude 4.5 quake and above. You can also see a demo of what an alert would look and sound like.

As for apps, there are two main apps to choose from for early warning alerts.

The first is MyShake. This app will send you alerts, but it also uses your phone to help collect data from its motion sensors to help make the data about earthquake events richer.

The other app is called QuakeAlertUSA, but this app hasn’t seen many updates in a few years so it might be best to use MyShake.

If you live in San Diego, there is an app called San Diego Emergency which has quake alerts built in.

These alerts can be jarring, but they’re well worth it if they can prevent even one injury or something even worse from happening.