Search code examples
c#apple-push-notificationspushsharp

iOS code keeps giving 'Invalid Token' error


I am using Pushsharp v4.0.10 and coding in C# on VS2013.

I am trying to create a C# console application, that will run server side, and am using the ANPS sample code on the Pushsharp github page but when I run it, it fails and I get the 'Invalid token' error. I have checked and even recreated the sandbox certificates and provisioning profiles needed to create the device token that i use in the code but no matter what i do it still gives the error. The token is created in a separate mobile app.

Any advice or a way to check to see if the certificates are correct from anybody who has had this error before would be very helpful.


Solution

  • Ok so it looks like i was just not creating and certificates for iOS properly. I found this website that has a good explanation and their method worked.

    This is for creating the certificates on Windows: Link