Pushkit push messages not working with Urban Airship

I have a passage installed. When it is installed on the device, it is registered on my server, the device identifier is also registered in Urban Airship services.

So far so good.

When I try to send a push message from the control panel on a city airship, or curling, or let the server send a push, it is never accepted by the device. Is there anything special I have to think about when you click passkit updates?

+4
source share
2 answers

Found this out when I got more control over the backend.

Server response was malformed (Wrong type object for key lastUpdated in response dictionary. Expected NSString but found __NSCFNumber.) 

So now he is working with a city airship

0
source

After many attempts, I got it to work. The solution is not intuitive:

  • Make sure that the β€œapplication” you create on Urban Airship is invoked on Apple-made servers. Passbook does not recognize that a saving throw is issued to the development server (this can only be done when creating the application - you cannot change it later).

  • Make sure that you upload the certificate that you use to sign Pass IDs, and not the one you use for standard push notifications. This is important because the certificate has a built-in PassID.

  • Despite what Apple says, you need to include something in the payload. As far as I can tell, this is necessary because the city airship will not be empty payload. The content of the payload does not matter. The device only cares that it receives something, so it knows that an update is required. For example, this works (python):

    Airship = Urban ship. airship.push ({'aps': {'alert': 'Go.'}}, device_tokens = tokens)

The city airship will hopefully change this in the future.

+3
source

Source: https://habr.com/ru/post/1436629/


All Articles