6

I want send a notification by OneSignal, I follow all steps in the document but always I show this message 'Apple returned a BadDeviceToken error. Some users are tied to a different environment from your sending environment.' Any idea!!

(Production Certificate) Bundle ID: ***** , Expires: September 15, 2018

(Sandbox Certificate) Bundle ID: ***** , Expires: September 15, 2018

Mismatched User Environment (Sandbox) Apple returned a BadDeviceToken error. Some users are tied to a different environment from your sending environment.

This warning occurred 1 time, last occurring less than 10 seconds ago.

Affected users: 6414cbae-876a-4360-9783-eb51c0cc0e29

Help me to fix this.

2 Answers2

16

If you are running iOS 12, with xCode 10, then you need to go to File -> Workspace Settings...

Change the build System: to Legacy Build System.

Save and build

Mohamed Mo Kawsara
  • 4,400
  • 2
  • 27
  • 43
  • 1
    Actually it's a solution that is working just fine with me and I kept surfing the internet for hours and this is the only option that worked for me – Mohamed Mo Kawsara Oct 09 '18 at 19:42
  • I already found best solution, you must create and download distribution certificate with push notification also with current bundle of your application. – Genevios Oct 10 '18 at 20:04
  • Thanks, this worked like a charm. Had this problem with a Cordova app. – Espen Birk Jun 19 '19 at 18:17
0

I guess that you re-sent your p12 file to the OneSignal server. I also meet this issue and solve it by opening another project on the OneSignal server. The p12 file might be in catch for some reason I guess.

truck liu
  • 1
  • 1