CommunityEscrita e Ediçãogithub.com

creativeny/expo-push-skill

A CLI tool to install Skills that guides AI agents and developers to configure Expo Push Notifications (iOS/Android) with best practices.

Funciona com~Claude Code~Codex CLI~Cursor
npx skills add creativeny/expo-push-skill

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentação

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

  1. 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.
  2. Read the Project Configuration: Before starting, search the codebase (specifically app.json, package.json, app.config.ts or app.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.
  3. 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, converting app.json to app.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

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.

  1. Go to Firebase Console -> Project Settings -> Service Accounts.
  2. Under Firebase Admin SDK, generate a new private key (this downloads a JSON file containing the service account key).
  3. Open Expo.dev and log in.
  4. Navigate to Credentials (in the left-hand menu at the bottom).
  5. Locate the project and click to open the Android credentials for your development build (which may have .dev suffix, e.g., com.company.appname.dev).
  6. Under Service Credentials > FCM V1 service account key, click Add a service account key.
  7. 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.

  1. Instruct the developer to open the Firebase Console.
  2. Ask them to select their existing Firebase project or create a new one.
  3. Click "Add app" and select Android.
  4. Display the project's Android package name you found in their configuration files (e.g., com.company.appname) and instruct them to enter it.
  5. Register the app and click Download google-services.json.
  6. Instruct them to place the downloaded google-services.json file 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.

  1. On Expo.dev, navigate to your project and select Environment variables.
  2. Click Add variable and choose the File upload option.
  3. Upload the google-services.json file.
  4. Set the variable name to: GOOGLE_SERVICES_JSON.
  5. Toggle visibility to Secret (to protect credentials).
  6. 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.json into a TypeScript-based app.config.ts config file enables far more flexibility. It allows us to read environment variables (like process.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.


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:

  1. Confirm that everything was setup correctly.
  2. 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].
  3. Guide them to use the Expo Notification Tool to test sending a test notification to their device using their push token.

Habilidades Relacionadas

steipete/notion

Notion CLI/API for pages, Markdown content, data sources, files, comments, search, Workers, and raw API calls.

community

affaan-m/seo

Audit, plan, and implement SEO improvements across technical SEO, on-page optimization, structured data, Core Web Vitals, and content strategy. Use when the user wants better search visibility, SEO remediation, schema markup, sitemap/robots work, or keyword mapping.

community

affaan-m/brand-voice

Build a source-derived writing style profile from real posts, essays, launch notes, docs, or site copy, then reuse that profile across content, outreach, and social workflows. Use when the user wants voice consistency without generic AI writing tropes.

community

affaan-m/crosspost

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

community

affaan-m/x-api

X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.

community

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

community