Skip to content

gourav-1711/image-optimizer

Repository files navigation

Image Optimizer

An efficient image resizing and optimization application built with Expo and React Native.

Setup

  1. Install Dependencies

    npm install
    # or
    yarn install
  2. Environment Variables Create a .env file in the root directory (copy from .env.example if available, or use the provided keys):

    EXPO_PUBLIC_APP_NAME="Image Optimizer"
    EXPO_PUBLIC_ADMOB_APP_ID="YOUR_ADMOB_APP_ID"
    EXPO_PUBLIC_BANNER_AD_ID="YOUR_ADMOB_BANNER_AD_ID"
    EXPO_PUBLIC_INTERSTITIAL_AD_ID="YOUR_ADMOB_INTERSTITIAL_AD_ID"
    

AdMob Configuration

To enable ads, you need to configure your AdMob IDs in two places: app.json and .env.

1. app.json

Locate the react-native-google-mobile-ads plugin configuration in app.json and replace YOUR_ADMOB_APP_ID_HERE with your actual AdMob App ID.

[
  "react-native-google-mobile-ads",
  {
    "androidAppId": "ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy",
    "iosAppId": "ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"
  }
]

2. .env

Update the .env file with your specific Ad Unit IDs for banners and interstitials.

Important: For development, use the official Google Test IDs to avoid policy violations.

Ad Type Test ID (Android) Test ID (iOS)
App ID ca-app-pub-3940256099942544~3347511713 ca-app-pub-3940256099942544~1458002511
Banner ca-app-pub-3940256099942544/6300978111 ca-app-pub-3940256099942544/2934735716
Interstitial ca-app-pub-3940256099942544/1033173712 ca-app-pub-3940256099942544/4411468910

Start with these Test IDs for development checking, and switch to your real IDs for production builds.

Building the App

This project uses EAS (Expo Application Services) for building.

Prerequisites

  • Install EAS CLI: npm install -g eas-cli
  • Login to Expo: eas login

Build Commands

We have configured two build profiles in eas.json:

Development Build

Use this for testing on a simulator or device during development. It includes the development client.

eas build --profile development --platform android
# or
eas build --profile development --platform ios

Production Build

Use this for generating a release build for the app store.

eas build --profile production --platform android
# or
eas build --profile production --platform ios

About

react native expo application with complete admob setup written in typescript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors