Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a .unregisterPushPayload() API method #106

Open
joshuadeguzman opened this issue Jan 8, 2024 · 3 comments
Open

Add a .unregisterPushPayload() API method #106

joshuadeguzman opened this issue Jan 8, 2024 · 3 comments
Labels
enhancement New feature or request evergreen

Comments

@joshuadeguzman
Copy link

joshuadeguzman commented Jan 8, 2024

Description

I'm looking for a way to unsubscribe (opting out) our users from a push subscription. Looking at the available SDKs, iOS has a way to unsubscribe the users:

https://github.com/klaviyo/klaviyo-swift-sdk/blob/bb2506d192a8cdb9396c81061a90469c1f2c1486/Sources/KlaviyoSwift/KlaviyoAPI.swift#L121

        case .unregisterPushToken:
            return "client/push-token-unregister"
        }

Proposed Solution

Klaviyo Android SDK should have an equivalent API or method caller for the API **Unregister Push Payload**:
https://developers.klaviyo.com/en/reference/unregister_client_push_token

Alternatives Considered

- Calling HTTP directly, but seems like a hacky solution, considering we're using an SDK for other APIs

Additional Context

- We're building on top of Flutter, so we're building a communication interface using [platform channels](https://docs.flutter.dev/platform-integration/platform-channels)
@joshuadeguzman joshuadeguzman added the enhancement New feature or request label Jan 8, 2024
@evan-masseau
Copy link
Contributor

evan-masseau commented Jan 8, 2024

Thanks for your feedback, we are still in the planning phase for adding a public unregister token method to either SDK's API. I'd be happy to keep you updated in this thread though. I'll put an evergreen label on here so you don't get auto-closed.

True, the swift SDK is a little ahead on this workstream in that we've implemented the code to make the network API call. But it does not yet expose a method for unregister token either. The code you linked to is still internal, and only used to cover an edge case if the company ID changes on re-initializing the SDK. We'll roll out similar internal code on Android soon.

If you have any additional context to share about your expected use case for unregister we could take that feedback on board as we work on this, Thanks!

@joshuadeguzman
Copy link
Author

If you have any additional context to share about your expected use case for unregistering we could take that feedback on board as we work on this, Thanks!

@evan-masseau, thanks for reaching out. So far, we want to manually opt-out users from push notifications within our app, and not go out in settings to turn it on/off. Further down the line, we want to have topics or channels.

Is there a way we can easily to opt-out from push only? We previously used OneSignal's opt-out method.

True, the swift SDK is a little ahead on this workstream in that we've implemented the code to make the network API call. But it does not yet expose a method for unregister token either.

Does this mean we have to call the REST API ourselves in the app to unregister the user from receiving push or do we just encourage them to just turn off the settings from the App Settings Page? (too much friction for the user)

@evan-masseau
Copy link
Contributor

Implementing an opt out API call is on our roadmap, but not the immediate term. We’d recommend in the mean time, as you suggested, directing users to the app’s settings page to remove/customize notification settings. On both platforms it is possible to link the user directly to the system settings page for your app, which would help reduce the friction a little.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request evergreen
Projects
None yet
Development

No branches or pull requests

2 participants