dreipol / django-scarface

Send push notifications to mobile devices using Amazon SNS
MIT License
43 stars 21 forks source link

BotoServerError: 400 Bad Request #6

Closed choiway closed 8 years ago

choiway commented 9 years ago

When using the code in your docs to register a device, I have no problem registering a new device. However, I'm running into a problem where if I log out and log back in as a different user, I get the following error.

{"Error":{"Code":"InvalidParameter","Message":"Invalid parameter: Token Reason: Endpoint arn:aws:sns:us-east-1:339077083280:endpoint/XXXXXXXX already exists with the same Token, but different attributes.","Type":"Sender"},"RequestId":"XXXXXXXX"}

I got rid of the custom user attributes and I'm just passing along the token to sns_device.register_or_update like so:

sns_device.register_or_update(new_token=token)

but I'm still getting the same error. Thanks for the help!

melbic commented 9 years ago

Did you delete the device from SNS? Otherwise it still exists with the custom attributes. This is a really nasty behaviour of SNS. What you could do is:

SNSDevice(platform,token,arn).delete()

And the recreate it.

Please let me know if it solved your problem or if you have anymore questions .

melbic commented 8 years ago

Closing the ticket cause of no reaction