I will show you my working example.
I will use Python.
1 Install exponent-server-sdk-python
2 Get your Expo Access token
Go to Expo’s dev account page. Then go to the https://expo.dev/accounts/{your_company}/settings/access-tokens/ and create a new token. Copy it.
It should look like this:
next, we need to use that token in our code.
3 Write function to send notification
Each device has a token, which looks like this: ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx].
this token is first parameter of the function.
4 GET device ExponentPushToken
this function is from expo’s documentation. it allows you to register device and the ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx].
5 Send the notification
this is the result in my case.
6 Important Tip
While you are using Expo go to look at your notifications. The app Icon and App Name will be Expo Go. when you publish your app, you will see your app name and icon.
Also, mobile devices should have permissions enabled for push notifications.
7 Conclusion
As you can see, it is not so hard to send push notifications to mobile using Expo.