Skip to content

iOS: requestPushAuthorization permission to read#45

Open
sashkaizen wants to merge 1 commit into
exponea:mainfrom
sashkaizen:feat/ios-permission-read
Open

iOS: requestPushAuthorization permission to read#45
sashkaizen wants to merge 1 commit into
exponea:mainfrom
sashkaizen:feat/ios-permission-read

Conversation

@sashkaizen

@sashkaizen sashkaizen commented Jun 30, 2026

Copy link
Copy Markdown

Overview

If the application had previously granted push-notification permissions prior to utilziing exponea then exponea wont read from those permissions.

  • Updated iOS push authorization flow to read existing notification permission state first using UNUserNotificationCenter.getNotificationSettings.
  • Kept original method semantics (Future<bool> / FlutterResult boolean):
  • Returns true and registers for remote notifications when status is already .authorized or .provisional.
  • Requests permission only when status is .notDetermined.
  • Returns false when status is .denied.
  • Ensured UIApplication.shared.registerForRemoteNotifications() is called only in “granted” paths (same practical contract as before).
  • Added handling for .ephemeral and @unknown default to make behavior explicit and forward-safe.
  • Result: fixes upgrade scenario where previously granted permissions were not reliably reflected by the SDK flow, without changing the public API contract.

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