Unable to get a Expo Push Notifications Token - react-native

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.

In your terminal type: "Expo login"
Sign in with your username//password.
Run the project again make sure you use a real device.

Register on Expo's official Site. or if you already have an account then...
then from your terminal type expo login
now login using your expo's username, password
after successful login, you are now able to use the expo push notification service.
in the terminal type expo start to start your app dev again!

If expo login is not recognized use npx expo login

Related

Configure expo notifications for push notifications

I have 2 apps and I implemented expo push notification and everything was fine, but in the other one it asked me for the experienceid as a prop to Notifications.getExpoPushTokenAsync({
experienceId: "#name/slug,
});
and when trying to send a notification it gives me this error: InvalidCredentials: Unable to retrieve the FCM server key for the recipient's app. Make sure you have provided a server key as directed by the Expo FCM documentation.
I dont want to use FCM, i want to use expo push api.
Can you help me?
The Expo Push API uses FCM for Android, and while it's not necessary to configure it for Expo Go (this is done already for the Expo Go app), when you deploy your standalone app you will need to have it configured for FCM. More information here: https://docs.expo.dev/push-notifications/using-fcm/

How to use FCM (Firebase Cloud Messaging) while making build of expo react native app through eas cli

I had expo sdk less than sdk 45 in my expo react native app which previously used expo cli. For using FCM, I used to write expo push:android:upload --api-key , in which your token means server key. But now, my app has been converted to eas cli and I can't find the command or procedure to use FCM for notifications in my app anywhere not even in expo documentation. I previously used to follow this guide
enter link description here
Run eas credentials, select Android, then Push Notifications: Manage your FCM Api Key, and then choose the appropriate option to set up the key.
docs...
OR
Go to https://expo.dev/
Select a project
Go to credentials
Click on the application ID
In the Service Credentials section, add FCM Server Key

Error Logging into this app with facebook is not available at this time

today i get into this error using react native with expo managed workflow, i try with facebook sdk, expo-auth-session, webview url, so them i give up because every method give me the same error, i end when i eject from expo to react native bare with react-native-fbsdk-next, after config all the environment with Android studio, i fall at the same error point D:
Please if someone know, if i missing some configurations, i follow all the steps in expo, react-native-fbsdk-next, expo-auth-session and expo-facebook D:
Error Logging into this app with facebook is not available at this time
UPDATE: i created a new React Native project again from scratch, follow react-native-fbsdk-next and Facebook Android start guide for login, still getting the same error. I reach that the error occour when i need to type my account and password in the facebook app, if i was already loggued in and did not ask for new permissions, i can login sucessfully, but if i log out from facebook app or ask for 1 new permission, it force me to log in and the bug occurs again, also i reach this report at facebook page, if someone is getting the same error, please help comment:
error logging facebook is not available at this time

FCM: Mismatched Sender Id when trying to send notification to Expo app

I have a backend that send fcm to web app and expo apps. Double checked all the credentials. But still unable to get it work. Both of the credentials are under same project. Backend is using firebase admin, with service account. Front end is using google-services.json. Anyone encountered this?
Found out that the device token from expo-notification can only be used on standalone build. But not in expo-client during development.
https://forums.expo.io/t/using-fcm-as-push-notification-with-expo-client/42402/2?u=cyee
This is the copy paste comment by expo team.
Hi! If you want to send notifications directly through FCM, and not
through the Expo notifications service, you’ll have to test in a
standalone app (as in, an app you built with expo build:android). This
is because you don’t have the push credentials for the Expo client
app, only we do :slight_smile:
If you want to test in the Expo client app, then you can do that with
Expo’s notifications, which you can read more about here-
https://docs.expo.io/push-notifications/overview/

Expo Android App Build Stuck on Axios Request

I have built this pizza app in which the home screen loads data that it received using axios get request. When I use the app on the development mode i.e. running expo client on my phone and scanning the QR code, the app loads pizza cards with no issues. (PS there is a loading screen before the pizza cards render). But when I ran expo build:android and got the standalone app (apk file). I installed it on my phone and the home screen is stuck on the loading sign. It is not fetching any data from the backend API, can anyone help me with this issue.
In my case the error is that I was registering for expo notification and calling the api only after the promise resolved (I forgot to provide FCM api key)
for eg:-
registerForPushNotificationsAsync().then(token => {
//--- calling the login api ---
}
since expo notification will not work in production build if we dont provide FCM key thats why login api was not getting called in production so my request was working in development but not in production