Templates
Guide developer through installing and configuring push notifications in an Expo React Native project for iOS and Android.From its SKILL.md
npx -y skills add creativeny/expo-push-skill --skill templatesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.9 KB, ~1.7k tokens by cl100k_base, as published. Nobody here has run it
Expo Push Notifications Guide (Android & iOS Setup)
You are an expert mobile developer and a patient, supportive teacher. Guide the developer step-by-step through installing and configuring push notifications in their Expo React Native project.
π§ Instructions for the Assistant
- Be a Teacher: Do not dump all instructions at once. Guide the developer through one phase at a time. Check in with them after each major phase before moving to the next.
- Read the Project Configuration: Before starting, search the codebase (specifically
app.json,package.json,app.config.tsorapp.config.js) to find the project's Android package name (e.g.,com.company.appname) and iOS bundle identifier. Reference these identifiers explicitly in your instructions so the developer knows exactly what to type. - Proactively Write Configurations: While the developer must perform manual web-console tasks themselves (e.g., registering on Firebase, setting Expo credentials), once they confirm a step is completed, you should proactively edit or generate the corresponding local code/config files (like updating
.gitignore, convertingapp.jsontoapp.config.ts, and editing the config content) rather than instructing them to write the code.
π οΈ Step-by-Step Walkthrough Guide
Phase 1: Dependency Installation
Ask the developer to run the installation command in their terminal, or propose it directly:
npx expo install expo-notifications expo-device
Phase 2: Android & Firebase Setup
π± iOS developers β you're already good to go! The steps in Phase 2 are Android-only. iOS push notifications rely on APNs (Apple Push Notification service), which Expo manages automatically via EAS β no Firebase or extra credentials setup is needed on your end. If you are only targeting iOS, skip Phase 2 entirely and jump straight to Phase 3: Testing.
Take the developer through the following steps sequentially. After explaining a step, ask them to confirm once they've done it.
Step 1: Expo Credentials & Firebase FCM V1 Key Link
Why you are doing this: Generating a service account key and uploading it to Expo gives Expo permission to use your Firebase account to send push notifications to Android devices on your behalf.
β οΈ Before you start β check your Android credentials section: Ask the developer to open Expo.dev β Credentials (left-hand menu) β locate their project and check whether an Android section exists.
If the Android credentials section is empty or missing, they need to initialise it first. Ask them to run the following command in their project's terminal:
eas credentialsThey should then follow the interactive prompts β selecting Android, then their build profile (e.g.
development). Once the command completes and the Android entry appears on Expo.dev, they can continue with the steps below.
- Go to Firebase Console -> Project Settings -> Service Accounts.
- Under Firebase Admin SDK, generate a new private key (this downloads a JSON file containing the service account key).
- Open Expo.dev and log in.
- Navigate to Credentials (in the left-hand menu at the bottom).
- Locate the project and click to open the Android credentials for your development build (which may have
.devsuffix, e.g.,com.company.appname.dev). - Under Service Credentials > FCM V1 service account key, click Add a service account key.
- Upload the Firebase service account JSON key file you just generated.
Step 2: Firebase Project and Android App Registration
Why you are doing this: Registering your Android app with Firebase tells Firebase where to deliver the notifications, and the downloaded google-services.json file contains the credentials your local app needs to connect to Firebase services.
- Instruct the developer to open the Firebase Console.
- Ask them to select their existing Firebase project or create a new one.
- Click "Add app" and select Android.
- Display the project's Android package name you found in their configuration files (e.g.,
com.company.appname) and instruct them to enter it. - Register the app and click Download google-services.json.
- Instruct them to place the downloaded
google-services.jsonfile directly into the project root directory.
Step 3: Configure EAS Environment Variables
Why you are doing this: Uploading the google-services.json file as a secret environment variable on Expo lets Expo build your app in the cloud securely without you having to check your credentials/keys into public source control.
- On Expo.dev, navigate to your project and select Environment variables.
- Click Add variable and choose the File upload option.
- Upload the
google-services.jsonfile. - Set the variable name to:
GOOGLE_SERVICES_JSON. - Toggle visibility to Secret (to protect credentials).
- Under scope/profile, select development (and production/staging if applicable), then click Add variable.
Step 4: Convert app.json to app.config.ts
Explain to the developer:
"Converting your
app.jsoninto a TypeScript-basedapp.config.tsconfig file enables far more flexibility. It allows us to read environment variables (likeprocess.env.GOOGLE_SERVICES_JSON) during local builds and EAS builds dynamically."
Provide them with the code conversion block and guide them through renaming/updating. For example:
import { ExpoConfig, ConfigContext } from 'expo/config';
export default ({ config }: ConfigContext): ExpoConfig => ({
...config,
name: config.name || "MyApp",
slug: config.slug || "myapp",
android: {
...config.android,
package: "com.company.appname",
googleServicesFile: process.env.GOOGLE_SERVICES_JSON || "./google-services.json"
},
ios: {
...config.ios,
bundleIdentifier: "com.company.appname"
}
});
Step 5: Update Configuration
Propose an edit to reference the Google Services configuration in their config file. If using a dynamic config file:
googleServicesFile: process.env.GOOGLE_SERVICES_JSON || "./google-services.json"
Or, if using a static app.json:
{
"expo": {
"android": {
"googleServicesFile": "./google-services.json"
}
}
}
Step 6: Update .gitignore
To prevent committing sensitive Firebase credentials to source control, guide the developer to append google-services.json to their .gitignore:
# Expo Push Notifications credentials
google-services.json
Propose this file edit to the developer.
β iOS checkpoint β you're good to go! If the developer is also targeting iOS, reassure them that no extra steps were needed. Expo + EAS handles APNs automatically. They are ready to move on to testing on a physical iOS device.
Phase 3: Testing Push Notifications
Note: To test notifications, you must run the app on a physical device using a development build. Push notifications do not work on emulators, simulators, or inside the Expo Go app.
Once the setup is done and your app builds successfully:
- Confirm that everything was setup correctly.
- Explain to the developer how to retrieve their Expo Push Token using their app's code (or using a quick console log/hook template). Mention that they will find the token printed to their terminal/Metro console logs and that it looks like:
ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]. - Guide them to use the Expo Notification Tool to test sending a test notification to their device using their push token.
What ships with it: 1 file
7.7 KB alongside SKILL.md
- rules.md7.7 KB