It keeps saying "Bad device registration token". However, when sending the exact same thing directly from Firebase it works well. here's what I do:
@router.get("/push-notification-test", status_code=status.HTTP_200_OK, response_model=None)
async def test():
client = ApnsClient(
use_sandbox=True,
team_id="XXXXXXX",
auth_key_id="XXXXXXX",
auth_key_filepath=f"{settings.base_dir}/AuthKey_XXXXXXX.p8",
)
registration_id = "XXXXXXXXXXXXX"
payload_alert = PayloadAlert(title="YOUR TITLE", body="YOUR BODY")
payload = Payload(alert=payload_alert, badge=1, sound="default")
config = ApnsConfig(topic="xxx.xxx.xxxx")
await client.send_message(
device_token=registration_id,
payload=payload,
apns_config=config,
)
Hope you can point me in the right direction. Thanks.