Logo

dev-resources.site

for different kinds of informations.

How to Change iOS Push Notifications Permission Dialog with Expo

Published at
9/13/2024
Categories
expo
reactnative
mobile
ios
Author
vladimirvovk
Categories
4 categories in total
expo
open
reactnative
open
mobile
open
ios
open
Author
12 person written this
vladimirvovk
open
How to Change iOS Push Notifications Permission Dialog with Expo

To receive push notifications we need to ask the user permission first. The requestPermissionsAsync function will show the user standard dialog asking to allow displaying alerts, setting badge count, and playing sounds.

Standard iOS permission dialog

Unfortunately, the docs have no information on how to change the dialog's text and make it more personal for our app. I found this Apple Developer Forums thread which recommends setting the NSUserNotificationsUsageDescription key in the Info.plist file.

For React Native app we can easily do that with XCode. And for the Expo app, we can set it with app.json or app.config.js configuration files.

All we need to do is to go to the ios -> infoPlist section of the configuration file and add NSUserNotificationsUsageDescription key like so:



{
  "name": "My awesome app",
  "ios": {
    "infoPlist": {
      "NSUserNotificationsUsageDescription": "Allow notifications to stay up to date. These can be configured from the System Settings."
    }
  }
}


Enter fullscreen mode Exit fullscreen mode

That's it! πŸŽ‰
Rebuild your app binary and enjoy your new permission text.


If this post was helpful to you please, give it a star 🌟, and happy hacking! πŸ’»

Credits

Photo by Adem AY on Unsplash

expo Article's
30 articles in total
Favicon
Read Text Asset File in Expo
Favicon
Run Storybook with NX Expo and React Native Paper
Favicon
Explorando Notificaçáes Push no React Native com Expo e OneSignal!
Favicon
Starting React Native Project in 2025
Favicon
Guia Completo: Como Integrar WatermelonDB no React Native 0.76 com Expo 52 e TypeScript
Favicon
How to create authenticated routes with the new Expo SDK 51 using Expo Router
Favicon
React Native Expo with NativeWind v4 and Typescript
Favicon
Translate & Guess: Build a Flag Quiz with Expo and Tolgee
Favicon
How i implemented my server login screen for Mastodon
Favicon
How to Change iOS Push Notifications Permission Dialog with Expo
Favicon
Exploring React Native Navigation with Expo: A Complete Guide
Favicon
How to Render OpenStreetMap in an Expo React Native Web App Using React Leaflet
Favicon
EAS build reads your .gitignore file
Favicon
#2 - Expo apk keeps on crashing after build
Favicon
Dear expo, who are you?
Favicon
npm i openai-react-native
Favicon
Expo51 Jotai Template + flashlist + tamagui
Favicon
Scroll-Responsive Animated Header Bar with Expo Router
Favicon
Expo vs. React Native: Pros, Cons, and Key Differences
Favicon
To Obfuscate or Not Obfuscate (React Native)
Favicon
How to disable keyboard suggestions for Android in React Native
Favicon
Expo51 Jotai Template, ready to use
Favicon
Let's get started with React Native + Expo
Favicon
Generar APK con EAS βš›οΈ React Native
Favicon
How to publish your React Native app to Expo Store 2024
Favicon
Creating a WebView app in React Native using Expo
Favicon
Embracing Expo: The New Standard for Creating React Native Apps
Favicon
Automate Your Expo Builds with EAS Using GitHub Actions: A Step-by-Step Guide (Android)
Favicon
How to Generate APK Using React Native Expo
Favicon
Creating Chat Bubbles with curls in React Native (svg)

Featured ones: