We're updating the issue view to help you get more done. 

wazo-auth: mobile: add APNS device token for both kinds of push notifications

Description

An iOS application needs two device tokens for receiving push notifications:

  • one device token for VoIP push notifications (PushKit)

  • one device token for text alert push notifications (UserNotification)

Currently, wazo-auth POST ​/users​/{user_uuid}​/external​/mobile only provides one apns_token.

Thus POST ​/users​/{user_uuid}​/external​/mobile must provide another field for both push notifications to work.

Specification

Upgrade procedure

Fields used in POST ​/users​/{user_uuid}​/external​/mobile :

  • Old application on old Stack: token + apns_token

  • Old application on new Stack: token + apns_token

  • New application on old Stack: token + apns_token + apns_voip_token(ignored) +apns_notification_token(ignored)

  • New application on new Stack: token + apns_token + apns_voip_token +apns_notification_token

As a consequence, the backend API must accept all 4 fields until the older versions of the iOS app are not supported anymore.

When an old application is upgraded:

  • GET ​/users​/{user_uuid}​/external​/mobile

  • If apns_voip_token and apns_notification_token do not exist

    • Remove old tokens DELETE ​/users​/{user_uuid}​/external​/mobile (necessary to avoid 409 Conflict)

    • Create the new tokens with POST ​/users​/{user_uuid}​/external​/mobile

Environment

None

Assignee

Sébastien Duthil

Reporter

Sébastien Duthil

Labels

Approvers

François Blackburn

Pair

None

Sprint

None

Fix versions

Priority

Medium
Configure