Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to get a Expo Push Notifications Token

I am working on react native Expo's Push Notifications. I just started and unable to get the Expo Push notification token. I added the following code:

token = await Notifications.getExpoPushTokenAsync();
console.log(token);

and getting the error "[Unhandled promise rejection: Error: The Expo push notification service is supported only for Expo projects. Ensure you are logged in to your Expo developer account on the computer from which you are loading your project.]".

I am running the project in the Expo App and I have created an account on Expo but still not getting the token. Expo experts, please guide.

like image 440
Code Lover Avatar asked Jun 11 '20 10:06

Code Lover


1 Answers

In your terminal type: "Expo login"

Sign in with your username//password.

Run the project again make sure you use a real device.

like image 125
Erik Dreifaldt Avatar answered Oct 20 '22 16:10

Erik Dreifaldt