customerio / customerio-reactnative

MIT License
23 stars 11 forks source link

Support provisional permissions for push notifications #232

Closed yoeun closed 6 months ago

yoeun commented 6 months ago

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like The docs say that provisional notifications are supported, but I don't actually see support for requesting provisional notifications. I only see code to handle a return value of provisional when checking current permission status

This should be a simple change.

  1. Add static let provisional = "provisional" to CustomerioConstants.swift
  2. Update requestPushAuthorization function in CustomerioReactnative.swift to add the following:
if let provisionalOption = ios[CustomerioConstants.provisional] as? Bool, provisionalOption {
   notificationOptions.insert(.provisional)
}
  1. Update relevant Typescript files
    • Add provisional: boolean to src/types/PushPermissionOptions.tsx
    • Add provisional: false to src/CustomerioTracking.tsx

Describe alternatives you've considered No

Additional context My team is migrating from Expo Notifications to Customer.io notifications in our React Native app.

We rely on provisional notifications to avoid showing users an annoying permission alert when new users sign up for the app. Instead users can grant permission when they receive their first notification. Losing support for provisional notifications means users are less likely to grant the push notification request at all.

I am working around this by using Expo to request permissions, but Customer.io downstream once permission has been granted. Ugly, but works.

ami-aman commented 6 months ago

Hi @yoeun

Thanks for reaching out.

I understanding the value of provisional push notifications for your React Native project. While we don't currently support them in our react native package, we hear your request loud and clear! We have an internal feature request for provisional push support, and I've added your use case and interest to it.

Our team is committed to continuously improving our SDKs, so I can't commit a specific timeline for this feature, but rest assured, your needs are on our radar. I'll keep you updated on any progress in the meantime.

I'll go ahead and close this ticket to streamline our support workflow, but please feel free to reopen it if you have any further questions or updates.