Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 17237

Can I customize both the notification sound and vibration for push notifications in an Expo React Native app on iOS and Android?

$
0
0

Question

I'm developing a mobile application using Expo (React Native) and I want to customize both the notification sound and vibration pattern when the app receives push notifications.

What I'm trying to achieve

  • Play a custom sound when a push notification is received.
  • Trigger a custom vibration pattern along with the notification.
  • Support this functionality on both iOS and Android.

Current setup

  • I'm using Expo managed workflow.
  • Notifications are being sent via Expo Push Notification service.
  • I have configured a custom Android notification channel using setNotificationChannelAsync.

What I've found so far

  • On Android, it seems possible to customize the vibration pattern using vibrationPattern in setNotificationChannelAsync.
  • On iOS, notification sound customization may require bundling a .caf or .wav file with the app.
  • iOS seems to not allow direct control over the vibration pattern, but may vibrate automatically if a sound is played.

Questions

  1. Is it possible to fully customize both sound and vibration for push notifications on both platforms using Expo (without ejecting)?
  2. If not, what are the limitations and is there a way to achieve this using EAS Build or another method while staying in the managed workflow?

Environment

  • Expo SDK version: 52

  • Workflow: Managed

  • Platforms: iOS and Android


Any insights or examples would be greatly appreciated!


Viewing all articles
Browse latest Browse all 17237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>