Muhammad Fari Madyan
Hire me
React Native · bagian 7 dari 7

React Native Expo Event Management Part 7: Polish & Deploy

Finishing touches pada UI, error handling, build APK untuk testing, build AAB untuk Play Store, dan panduan publikasi aplikasi.

Muhammad Fari Madyan

· 7 menit baca

Read in English →

Overview

Di bagian final ini, kita akan:

  • ✅ Polish UI (loading states, empty states, transitions)
  • ✅ Improve error handling
  • ✅ Build APK untuk internal testing
  • ✅ Build AAB untuk Play Store
  • ✅ Publish ke Google Play Store

Step 1: Polish UI

A. Tambahkan Splash Screen Custom

File: app.json - update splash configuration:

JSON
{
  "expo": {
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#1a1a1a"
    }
  }
}

B. Buat Empty State Component

File: components/EmptyState.tsx

TSX
import React from 'react';
import { View, Text } from 'react-native';
import { LucideIcon } from 'lucide-react-native';

interface EmptyStateProps {
  icon: LucideIcon;
  title: string;
  description?: string;
}

export function EmptyState({ icon: Icon, title, description }: EmptyStateProps) {
  return (
    <View className="flex-1 items-center justify-center py-20 px-8">
      <Icon size={64} color="#4B5563" />
      <Text className="text-white text-lg font-semibold mt-4 text-center">
        {title}
      </Text>
      {description && (
        <Text className="text-gray-400 text-center mt-2">
          {description}
        </Text>
      )}
    </View>
  );
}

C. Buat Error Boundary Component

File: components/ErrorBoundary.tsx

TSX
import React, { Component, ReactNode } from 'react';
import { View, Text, TouchableOpacity } from 'react-native';
import { AlertTriangle } from 'lucide-react-native';

interface Props {
  children: ReactNode;
}

interface State {
  hasError: boolean;
  error?: Error;
}

export class ErrorBoundary extends Component<Props, State> {
  constructor(props: Props) {
    super(props);
    this.state = { hasError: false };
  }

  static getDerivedStateFromError(error: Error): State {
    return { hasError: true, error };
  }

  handleRetry = () => {
    this.setState({ hasError: false, error: undefined });
  };

  render() {
    if (this.state.hasError) {
      return (
        <View className="flex-1 items-center justify-center bg-secondary px-8">
          <AlertTriangle size={64} color="#ef4444" />
          <Text className="text-white text-xl font-bold mt-4 text-center">
            Oops! Terjadi Kesalahan
          </Text>
          <Text className="text-gray-400 text-center mt-2">
            {this.state.error?.message || 'Something went wrong'}
          </Text>
          <TouchableOpacity
            className="bg-primary px-8 py-4 rounded-xl mt-6"
            onPress={this.handleRetry}
          >
            <Text className="text-white font-bold">Coba Lagi</Text>
          </TouchableOpacity>
        </View>
      );
    }

    return this.props.children;
  }
}

D. Network Status Indicator

File: components/NetworkStatus.tsx

TSX
import React, { useEffect, useRef, useState } from 'react';
import { View, Text, Animated } from 'react-native';
import NetInfo from '@react-native-community/netinfo';
import { WifiOff } from 'lucide-react-native';

export function NetworkStatus() {
  const [isConnected, setIsConnected] = useState(true);
  const opacity = useRef(new Animated.Value(0)).current;

  useEffect(() => {
    const unsubscribe = NetInfo.addEventListener((state) => {
      setIsConnected(state.isConnected ?? true);
    });

    return () => unsubscribe();
  }, []);

  useEffect(() => {
    Animated.timing(opacity, {
      toValue: isConnected ? 0 : 1,
      duration: 300,
      useNativeDriver: true,
    }).start();
  }, [isConnected]);

  if (isConnected) return null;

  return (
    <Animated.View
      style={{ opacity }}
      className="absolute top-0 left-0 right-0 bg-red-600 py-2 px-4 flex-row items-center justify-center z-50"
    >
      <WifiOff size={16} color="#fff" />
      <Text className="text-white ml-2 font-medium">
        Tidak ada koneksi internet
      </Text>
    </Animated.View>
  );
}

Install NetInfo:

BASH
npx expo install @react-native-community/netinfo

Step 2: Improve Error Handling

A. Global Error Handler

File: utils/errorHandler.ts

TYPESCRIPT
import { Alert } from 'react-native';

export function handleApiError(error: any, fallbackMessage = 'Terjadi kesalahan') {
  console.error('API Error:', error);

  let message = fallbackMessage;

  if (error.response) {
    // Server responded with error
    message = error.response.data?.error || error.response.data?.message || fallbackMessage;
    
    if (error.response.status === 401) {
      // Token expired - handled by interceptor
      return;
    }
    if (error.response.status === 403) {
      message = 'Anda tidak memiliki akses';
    }
    if (error.response.status === 404) {
      message = 'Data tidak ditemukan';
    }
    if (error.response.status >= 500) {
      message = 'Server sedang bermasalah. Coba lagi nanti.';
    }
  } else if (error.request) {
    // No response received
    message = 'Tidak dapat terhubung ke server. Periksa koneksi internet.';
  }

  Alert.alert('Error', message);
}

B. Retry Logic untuk API Calls

File: utils/retry.ts

TYPESCRIPT
export async function withRetry<T>(
  fn: () => Promise<T>,
  retries = 3,
  delay = 1000
): Promise<T> {
  try {
    return await fn();
  } catch (error) {
    if (retries > 0) {
      await new Promise((resolve) => setTimeout(resolve, delay));
      return withRetry(fn, retries - 1, delay * 2);
    }
    throw error;
  }
}

Step 3: Build APK untuk Testing

A. Setup EAS Build

BASH
# Install EAS CLI
npm install -g eas-cli

# Login ke Expo account
eas login

# Initialize EAS di project
eas build:configure

B. Konfigurasi eas.json

File: eas.json

JSON
{
  "cli": {
    "version": ">= 5.0.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      }
    },
    "preview": {
      "distribution": "internal",
      "android": {
        "buildType": "apk"
      }
    },
    "production": {
      "android": {
        "buildType": "app-bundle"
      }
    }
  },
  "submit": {
    "production": {
      "android": {
        "serviceAccountKeyPath": "./play-store-key.json"
      }
    }
  }
}

C. Build APK Preview

BASH
# Build APK untuk internal testing
eas build --platform android --profile preview

Setelah selesai, download APK dari link yang diberikan.

Step 4: Build AAB untuk Play Store

A. Persiapan Production

  1. Update app.json untuk production:
JSON
{
  "expo": {
    "name": "Lampung Dev",
    "slug": "lampung-dev",
    "version": "1.0.0",
    "android": {
      "package": "org.lampungdev.mobile",
      "versionCode": 1,
      "permissions": ["CAMERA"],
      "adaptiveIcon": {
        "foregroundImage": "./assets/images/adaptive-icon.png",
        "backgroundColor": "#1a1a1a"
      }
    }
  }
}
  1. Update API URL untuk production di services/api.ts:
TYPESCRIPT
export const BASE_URL = __DEV__ 
  ? 'http://192.168.1.100:3000'
  : 'https://lampungdev.org';  // Production URL

B. Build Production AAB

BASH
# Build AAB untuk Play Store
eas build --platform android --profile production

Proses ini memakan waktu 10-20 menit. Setelah selesai, download AAB dari link yang diberikan.

Step 5: Publish ke Play Store

A. Persiapan Play Console

  1. Buka Google Play Console
  2. Buat aplikasi baru
  3. Isi detail aplikasi:
    • App name: Lampung Dev
    • Default language: Indonesian
    • App or game: App
    • Free or paid: Free

B. Store Listing

Siapkan aset berikut:

AssetUkuranFormat
App icon512x512PNG
Feature graphic1024x500PNG
Phone screenshotsMin 2, max 8PNG
Short descriptionMax 80 charsText
Full descriptionMax 4000 charsText

Contoh Short Description:

Aplikasi admin untuk scan kehadiran peserta event LampungDev

Contoh Full Description:

Lampung Dev Mobile adalah aplikasi resmi untuk admin dan panitia komunitas Lampung Dev.

Fitur:
✅ Lihat daftar event yang akan datang
✅ Lihat detail event dan peserta terdaftar
✅ Scan QR code untuk verifikasi kehadiran peserta
✅ Catat waktu check-in secara real-time

Aplikasi ini hanya untuk admin/panitia event. Untuk mendaftar event, kunjungi lampungdev.org.

C. Upload AAB

  1. Buka Production → Releases
  2. Buat release baru
  3. Upload file AAB
  4. Tambahkan release notes
  5. Review, lalu lakukan rollout

D. Content Rating & Privacy

  1. Lengkapi kuesioner content rating
  2. Tambahkan URL privacy policy
  3. Lengkapi formulir data safety

Step 6: Post-Launch

A. Monitor Crashes

Gunakan EAS Insights atau Firebase Crashlytics:

BASH
# Install expo-insights
npx expo install expo-insights

B. App Updates

Untuk merilis versi baru aplikasi:

BASH
# Increment version di app.json
"version": "1.0.1",
"android": {
  "versionCode": 2
}

# Build ulang
eas build --platform android --profile production

# Upload ke Play Console

C. OTA Updates (Over-the-Air)

Untuk update tanpa Play Store review:

BASH
# Publish OTA update
eas update --branch production --message "Bug fixes"

Final Checklist

Pre-Launch

  • UI polish (empty states, loading, errors) ✅
  • Error handling improved ✅
  • APK sudah dites di perangkat fisik
  • Tidak ada crash atau bug besar
  • API production sudah siap

Play Store

  • App icon 512x512
  • Feature graphic 1024x500
  • Screenshots (min 2)
  • Short & full description
  • Privacy policy URL
  • Content rating complete
  • AAB uploaded

Post-Launch

  • Monitor crash reports
  • Respond to user reviews
  • Plan next features

Selamat!

Kamu telah berhasil membangun aplikasi event management lengkap dengan React Native Expo!

Apa yang Sudah Kamu Pelajari:

  1. Arsitektur - Desain sistem untuk aplikasi mobile
  2. Setup - Development environment di berbagai OS
  3. Project Setup - Expo, NativeWind, folder structure
  4. Authentication - Login, Zustand, SecureStore
  5. Event Management - Lists, cards, detail screens
  6. QR Scanner - Camera, barcode scanning, feedback
  7. Deployment - Build, publish ke Play Store

Source Code

Repository lengkap tersedia di: 🔗 github.com/Lampung-Dev/lampung-dev-mobile

Kontribusi

Tertarik berkontribusi ke project open source LampungDev? Bergabunglah dengan komunitas kami:


Semua Parts dalam Series Ini

PartTopik
1Pengenalan & Arsitektur
2Instalasi di Mac, Windows, Ubuntu
3Project Setup
4Autentikasi Admin
5Manajemen Event
6QR Scanner Kehadiran
7Polish & Deploy

Happy Coding! 🚀

Series ini dibuat untuk mendukung materi Casual Meetup #15 di LampungDev oleh Muhammad Fari Madyan.

BagikanLinkedInXWhatsApp

Ditulis oleh Muhammad Fari Madyan

Senior Backend Engineer dan co-founder LampungDev. Saya menuliskan apa yang saya bangun supaya orang lain bisa ikut belajar.

Ajak kerja sama
← bagian 6QR Scanner Kehadiranseri selesaiKembali ke semua artikel →

Muhammad Fari Madyan

Senior Backend Engineer building real-time, high-concurrency systems that hold up in production. Co-founder of LampungDev. Based in Bandar Lampung, Indonesia (UTC+7), working remote.

Work

Case studiesCahTixExam platform, 4 stacksOpen source

© 2026 Muhammad Fari Madyan

Designed and built by Muhammad Fari Madyan