Skip to content

feature/cp-11597-ios-implement-regenerating-the-push-token-by-system#377

Open
cpandya25 wants to merge 2 commits into
masterfrom
feature/cp-11597-ios-implement-regenerating-the-push-token-by-system
Open

feature/cp-11597-ios-implement-regenerating-the-push-token-by-system#377
cpandya25 wants to merge 2 commits into
masterfrom
feature/cp-11597-ios-implement-regenerating-the-push-token-by-system

Conversation

@cpandya25
Copy link
Copy Markdown
Contributor

@cpandya25 cpandya25 commented May 20, 2026

implemented feature of regenerate APNS token on server-requested push token refresh via regeneratePushTokenRequestedAt timestamp comparison


Note

Medium Risk
Changes device-token handling and subscription sync flow based on a backend-provided timestamp, which could impact push delivery if the refresh/resync loops or fails. Scope is localized to subscription sync and user-defaults persistence.

Overview
Adds server-driven APNS token regeneration during subscription sync: when regeneratePushTokenRequestedAt returned by the backend changes, the SDK clears local token state, requests a fresh device token, persists the new timestamp, and triggers a follow-up syncSubscription.

Introduces a new persisted user-defaults key CLEVERPUSH_REGENERATE_PUSH_TOKEN_REQUESTED_AT_KEY to track the last processed refresh request.

Reviewed by Cursor Bugbot for commit b2fbd7c. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Implements server-driven APNS token regeneration on iOS (CP-11597) by detecting changes to a regeneratePushTokenRequestedAt timestamp and re-requesting the device token. After a fresh token is received, the new timestamp is saved and the subscription is re-synced.

  • New Features
    • Persist CLEVERPUSH_REGENERATE_PUSH_TOKEN_REQUESTED_AT_KEY in user defaults.
    • On timestamp change, clear local token, set hasRequestedDeviceToken = NO, and call requestDeviceToken followed by getDeviceToken.
    • On successful token retrieval, store the new timestamp and trigger syncSubscription.

Written for commit b2fbd7c. Summary will update on new commits. Review in cubic

implemented feature of regenerate APNS token on server-requested push token refresh via regeneratePushTokenRequestedAt timestamp comparison
Comment thread CleverPush/Source/CleverPushInstance.m
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread CleverPush/Source/CleverPushInstance.m Outdated
implemented feature of regenerate APNS token on server-requested push token refresh via regeneratePushTokenRequestedAt timestamp comparison
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default mode and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b2fbd7c. Configure here.

Comment thread CleverPush/Source/CleverPushInstance.m
@cpandya25 cpandya25 requested a review from snuricp May 20, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant