Skip to content

M012 — Build EAS production & QA push #224

Description

@nejos97

Résumé

Documenter et valider les exigences de build EAS pour les notifications push en production : appareil physique obligatoire, credentials iOS (APNs) et Android (FCM) via EAS, configuration NOTIFICATION_API_URL dans .env.production, capacité push iOS dans le projet Xcode, et checklist QA manuelle iOS/Android.

Contexte

Les notifications push Expo ne fonctionnent pas de manière fiable sur simulateur iOS ni émulateur Android. En développement, Expo Go offre des tests limités. Pour la production, un build EAS avec credentials push configurés est obligatoire.

Le projet Grimm Mobile Wallet dispose déjà de :

  • eas.json avec profils production, staging, development
  • expo-notifications ~0.31.5 dans package.json et plugin dans app.config.ts
  • EAS Project ID : 64373569-be43-4db2-ace8-1f2b9f81448c
  • Profil production iOS : macos-sequoia-15.6-xcode-26.2, distribution store
  • Profil production Android : app-bundle, autoIncrement versionCode

Les tickets M001–M010 implémentent la logique runtime. M012 garantit que l'infrastructure build/deploy permet la livraison push réelle en production.

Pourquoi

Sans credentials push corrects :

  • getExpoPushTokenAsync échoue ou retourne un token non livrable
  • Le Notification Service reçoit des enregistrements mais Expo Push renvoie DeviceNotRegistered
  • La QA ne peut pas valider M005, M008–M009 en conditions réelles

M012 est la porte de sortie de l'épic mobile avant release store.

Périmètre

  • Vérifier / documenter configuration plugin expo-notifications dans app.config.ts
  • Capacité Push Notifications activée pour le target iOS (Xcode / EAS credentials)
  • Credentials APNs gérés par EAS (clé .p8 ou certificat)
  • Credentials FCM (Android) via EAS — google-services.json / Firebase project
  • Variable NOTIFICATION_API_URL dans .env.production (HTTPS, URL prod Notification Service)
  • Validation projectId EAS dans extra.eas.projectId pour getExpoPushTokenAsync
  • Checklist QA manuelle iOS + Android (appareils physiques)
  • Documentation procédure build : eas build --profile production
  • Vérification UIBackgroundModes: remote-notification (iOS Info.plist via config plugin)

Hors périmètre

  • Soumission App Store / Play Store (ticket release séparé)
  • Configuration serveur Notification Service production (ticket backend 034)
  • Monitoring Sentry/Datadog push delivery
  • Custom notification sounds/assets
  • Tests automatisés sur device farm

Conception technique

Variables d'environnement production

Fichier .env.production (non commité ; template dans .env.example) :

# Notification Service — URL HTTPS production
NOTIFICATION_API_URL=https://notifications.grimm.app

APP_ENV=production
# ... autres variables existantes

Intégration dans env.js :

const client = z.object({
  // ... champs existants
  NOTIFICATION_API_URL: z.string().url().optional(),
});

Important : eas.json production définit EXPO_NO_DOTENV: "1". Les variables doivent être injectées via EAS Secrets ou le mécanisme env du projet :

# Définir secret EAS pour builds production
eas secret:create --scope project --name NOTIFICATION_API_URL --value https://notifications.grimm.app --type string

Ou via dashboard Expo → Project → Secrets.

app.config.ts — plugin notifications

Configuration actuelle :

[
  'expo-notifications',
  {
    icon: './assets/icon.png',
  },
],

Recommandations production :

[
  'expo-notifications',
  {
    icon: './assets/icon.png',
    color: '#F7931A',
    mode: 'production',
  },
],

Ajouter si absent via ios.infoPlist :

ios: {
  infoPlist: {
    UIBackgroundModes: ['remote-notification'],
  },
},

EAS credentials push

iOS (APNs)

# Vérifier credentials existants
eas credentials --platform ios

# Configurer push key (recommandé — ne expire pas)
eas credentials --platform ios
# → Push Notifications: Manage your Apple Push Notifications Key

Prérequis Apple Developer :

  • App ID avec capability Push Notifications activée
  • Clé APNs (.p8) uploadée dans EAS

Vérifier dans Xcode (ios/GrimmApp.xcodeproj) :

  • Target → Signing & Capabilities → Push Notifications
  • Background Modes → Remote notifications

Android (FCM)

eas credentials --platform android
# → Google Service Account / FCM Server Key via Firebase

Prérequis Firebase :

  • Projet Firebase lié au package com.grimm.labs.app
  • google-services.json présent (géré par EAS ou commité selon convention projet)
  • FCM API activée

Expo/EAS configure automatiquement FCM v1 pour les builds récents.

eas.json — profil production

Extrait existant :

{
  "build": {
    "production": {
      "channel": "production",
      "distribution": "store",
      "env": {
        "EXPO_NO_DOTENV": "1",
        "APP_ENV": "production",
        "FLIPPER_DISABLE": "1"
      }
    }
  }
}

S'assurer que NOTIFICATION_API_URL est disponible au build via EAS Secrets (voir ci-dessus).

Commandes build

# Build production iOS
APP_ENV=production eas build --platform ios --profile production

# Build production Android
APP_ENV=production eas build --platform android --profile production

# Build both
APP_ENV=production eas build --platform all --profile production

Validation token push post-build

Sur appareil physique avec build production installé :

  1. Ouvrir l'app → accorder permissions notifications
  2. Vérifier logs dev (ou Reactotron) : token ExponentPushToken[...]
  3. Vérifier POST /devices reçu par Notification Service (logs serveur ou PostgreSQL)
  4. Envoyer push test via Expo Push Tool ou backoffice staging
# Envoi test via curl (Expo Push API)
curl -X POST https://exp.host/--/api/v2/push/send \
  -H "Content-Type: application/json" \
  -d '{
    "to": "ExponentPushToken[REMPLACER]",
    "title": "Test Grimm Production",
    "body": "Push production OK",
    "data": { "screen": "(app)" }
  }'

Checklist QA manuelle

Prérequis communs

  • Build EAS production installé sur appareil physique (pas Expo Go)
  • NOTIFICATION_API_URL pointe vers environnement cible (staging ou prod)
  • Notification Service déployé et accessible HTTPS
  • Permissions notifications accordées dans l'app

iOS (iPhone physique)

  • Permission prompt affiché au premier lancement (ou via paramètres)
  • Token Expo obtenu sans erreur (getExpoPushTokenAsync)
  • Device enregistré en base (POST /devices → 201)
  • Push reçu en foreground : bannière + son
  • Push reçu en background : notification centre système
  • Tap notification → navigation correcte (M009)
  • Cold start depuis tap → écran cible après ouverture app
  • Badge icône incrémenté puis reset au foreground
  • Reset wallet → ré-enregistrement nouveau device (M010)

Android (appareil physique)

  • Canaux notification créés (default, transactions)
  • Token Expo obtenu
  • Device enregistré en base
  • Push foreground : heads-up notification
  • Push background : shade notification
  • Tap → navigation deep link
  • Channel transactions pour notifications paiement (si channelId serveur)
  • Reset wallet → cleanup local (M010)

Cas d'erreur

  • Mode avion au lancement → pas de crash, retry au prochain launch
  • Permission refusée → pas d'appel API, pas de crash
  • Payload deep link invalide → fallback accueil
  • NOTIFICATION_API_URL incorrect → log warning, app utilisable

Règles de validation

Règle Description
HTTPS obligatoire NOTIFICATION_API_URL doit utiliser HTTPS en production
Appareil physique QA push invalidée sur simulateur seul
projectId EAS Doit correspondre au projet Expo du build
Bundle ID cohérent iOS com.grimm.labs.app aligné avec App ID push
Pas de token dans logs prod Désactiver logs verbeux en release

Gestion des erreurs (build/runtime)

Scénario Diagnostic Action
getExpoPushTokenAsync fail projectId manquant Vérifier extra.eas.projectId
iOS pas de push APNs key absente eas credentials --platform ios
Android pas de push FCM mal configuré Vérifier Firebase + google-services
DeviceNotRegistered Token stale / mauvais build Réinstaller, re-register
404 PATCH device Device supprimé côté serveur Clear SecureStore, re-POST

Considérations sécurité

  • .env.production ne doit pas être commité (secrets URL prod)
  • Utiliser EAS Secrets pour variables sensibles en CI/CD
  • Credentials APNs/FCM gérés par EAS, pas dans le repo
  • Notification Service prod derrière HTTPS avec rate limiting (ticket 006)

Journalisation

Build :

eas build --profile production → Build ID, artifact URL

Runtime (staging QA uniquement) :

[notifications] Device registered: { deviceId: '550e...', platform: 'ios' }

Critères d'acceptation

  • .env.production documenté avec NOTIFICATION_API_URL (template .env.example)
  • EAS Secrets configuré pour builds production
  • Capacité Push Notifications iOS activée (Xcode / EAS)
  • FCM Android configuré via EAS credentials
  • Plugin expo-notifications configuré avec mode: 'production'
  • UIBackgroundModes: remote-notification présent (iOS)
  • Build production iOS reçoit push sur iPhone physique
  • Build production Android reçoit push sur appareil physique
  • Checklist QA iOS complétée et signée
  • Checklist QA Android complétée et signée
  • Enregistrement device visible en base Notification Service prod/staging

Dépendances

  • M001–M011 — Implémentation runtime complète
  • Backend 034 — Deployment guide Notification Service
  • Backend 037 — Release checklist (coordination release conjointe)
  • Compte Expo grimm-labs, Apple Developer, Firebase project
  • Accès EAS project 64373569-be43-4db2-ace8-1f2b9f81448c

Notes

  • Staging (eas build --profile staging) recommandé pour QA push avant production store
  • Expo Push Tool : https://expo.dev/notifications — utile pour envoi rapide sans backoffice
  • Les builds simulator et development ne valident pas les push production
  • Après rotation credentials APNs, rebuild iOS obligatoire
  • Coordonner release mobile avec déploiement Notification Service prod (ticket backend 037)
  • Documenter l'URL prod finale dans le runbook ops (hors repo si sensible)

Références

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions