Open Mikiah opened 11 months ago
Hey @Mikiah, thanks for raising this! Could you file your feature request here, and our product team will take a look into how we can support this? Thank you!
Done. Thank you for the quick response!
Sure thing. By the way, since push permissions are at the app level, you should also be able to do this at the native layer without having to set a timeout in your JavaScript code.
For example, in Android, you can request for the current permission settings at runtime, and likewise for iOS as well.
What problem are you facing?
Working on a React Native Expo Go app for Walmart. Using my personal account here since Walmart uses on-prem github. We have onboarding flow where the user is push primed then given the OS-level prompt from
Braze.requestPushPermission()
, and once that's completed, sent along the onboarding flow.Without
Braze.requestPushPermission()
returning a promise, we can't wait for it. so the user is shown the next onboaring screen prematurely.Workarounds
The only way around this that I've found is a a setTimeout of about 5000 ms. Super hacky and obv bad UX. I thought you might have listeners I could subscribe to. Something like
Braze.addListener('pushPermissionChange', onPermissionChange);
but that doesn't seem to be the case either.Ideal Solution
Either return a promise and success message (or the token) or some kind of listener we can use.
Other Information
No response