drybnikov / klaviyo_flutter

BSD 3-Clause "New" or "Revised" License
4 stars 9 forks source link

Provide a better API to disable push notifications #10

Open joshuadeguzman opened 7 months ago

joshuadeguzman commented 7 months ago

Overview

Currently, the API to disable a push is by forcing to pass an invalid FCM token so the push notification will bounce:

Klaviyo.instance.sendTokenToKlaviyo('<space>');

Proposal

I think a clearer API like disablePush is far more straightforward. Optionally, the native SDKs should provide a similar API to better handle server-side disabling of push notification when FCM or APN tokens were forced expired because of user logout / switch use cases.

Klaviyo.instance.disablePush();

What do you think about this? @drybnikov

joshuadeguzman commented 7 months ago

For context, in the official SDK, it has a method called subscribed user from the SDK: