OneSignal / OneSignal-iOS-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native iOS app with OneSignal. https://onesignal.com
Other
496 stars 263 forks source link

[JWT] Handle logout when Identity verification is on #1488

Closed nan-li closed 1 month ago

nan-li commented 1 month ago

Description

One Line Summary

Handle logout when JWT is on by disabling the push subscription and still create an anonymous local user to prevent data updates.

Details

Motivation

When JWT is on, logout needs to be handled differently. This is a small PR, so logout is handled simply.

Scope

Testing

Unit testing

❗️TODO

Manual testing

To fill out Tested on iPhone 13 on iOS 17

  1. Be logged in and push permission granted
  2. Call logout and see the push subscription is disabled on server
  3. Kill and re-open app to drive a new session
  4. No IAM is fetched due to no viable alias
  5. Log back into the same user and IAM is now fetched (driven by user change)
  6. The login generates a user create request that sends the correct push subscription state from before disabling

Affected code checklist

Checklist

Overview

Testing

Final pass


This change is Reviewable