Push notification expo server error: PUSH_TOO_MANY_EXPERIENCE_IDS

Expo SDK: 36
OS: Android, iOS

Our server send push notifications to devices (Android / iOS). All was fine until we create new iOS dev account and upload to the TestFlight new version of an app that connects with this new iOS dev account. After that, we encountered the following error (as a response to our server from expo server https://exp.host/--/api/v2/push/send):
array(2) { ["body"]=> string(190) "{"errors":[{"code":"PUSH_TOO_MANY_EXPERIENCE_IDS","message":"All push notification messages in the same request must be for the same project; separate your push notifications by project."}]}" ["status_code"]=> int(400) }

We tested that if we used older version of app (on iOS device) that connected with previous iOS dev account all is fine.

What does ‘same project’ mean?

1 Like

I experienced the same thing. Is it possible to know from Expo what project does every token belong to? from there the system can clean all different project token so this error won’t show up again

I have found the problem. When I updated app from google play (first - for internal testing) my app was updated BUT token doesn’t update. Token updates (as far as I know) only if app is reinstalled or remove app data (for Android). Same for iOS TestFlight. So the solution is just remove all tokens from our server (because it could have token from apps that was built from different expo accounts) and use only tokens that are built from new expo account.

I have run into the same problem. We have a bunch of remote developers doing occasional work on our project.
If someone runs the app in the Expo app on a real device for testing and they make a new account, it will generate a push token and register it to a different project.

I thought a solution would be a paid Expo Team account. That is not the case. It still creates a token as that user even if they have access to the project as a team developer.

It looks like the only solutions are:

  1. Give everybody involved the login to your Expo account. (A really bad idea if you care about security at all)
  2. Tell your devs not to create accounts on real devices in the Expo app they are running locally.
  3. Rework you push notifications to send one at a time so it’s never a mixed array of push tokens. This will only work if all the Expo Push Notification Key are registered with Apple for your app.

I think this will continue to be a problem as long as the Expo developers continue to have the small dev team mindset and figure everybody can just share the admin login. They need some kind of account security structure when you can add and revoke account access and specify what project you are testing under.

Probably best to explain this in a feature request.

@wodin Yup, I think you are correct. However, I’m also trying to crowd-source another solution here. I would love to be corrected with a work-around or feature I haven’t found yet that is built into Expo that would solve this problem. I’ll write up a feature request, but for now I’m going to have to share my Expo Admin login with a contractor and hope nothing goes wrong.

I’m afraid I have only experimented briefly with push notifications and it was ages ago, so I’m not sure of all the details.

When you say:

that seems strange to me. How is the project defined/identified exactly? Why is it a different project just because a different developer is working on it?

A refinement of your third option might be to partition your push notifications by project so that you don’t have to send them one at a time but you still only send notifications for one project in each batch.