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

Zendesk Ticket IDs

None

Activity

Show:
Done

Details

Priority

Assignee

Reporter

Approvers

François Blackburn

Fix versions

Sprint

Labels

Zendesk Support

Created March 18, 2020 at 3:09 PM
Updated April 1, 2020 at 7:43 PM
Resolved April 1, 2020 at 4:02 PM