A cross-platform React Native SDK to fetch weather data using native Android and iOS integrations. Supports fetching by city name or latitude/longitude.
β
Cross-platform support (Android & iOS)
β
Native integration for better performance
β
Easy-to-use API for fetching weather data
β
Works with both city names and coordinates
# Using npm
npm install react-native-weather-sdk
# Using yarn
yarn add react-native-weather-sdk
# Using pnpm
pnpm add react-native-weather-sdkOpen android/app/build.gradle and ensure the minimum SDK version is set:
android {
defaultConfig {
minSdkVersion 21
}
}Navigate to the ios folder and install pods:
cd ios
pod installimport WeatherSDK from 'react-native-weather-sdk';
async function getWeatherByCity() {
try {
const weather = await WeatherSDK.fetchWeatherByCity('London');
console.log(weather);
} catch (error) {
console.error(error);
}
}import WeatherSDK from 'react-native-weather-sdk';
async function getWeatherByCoordinates() {
try {
const weather = await WeatherSDK.fetchWeatherByCoordinates(51.5074, -0.1278);
console.log(weather);
} catch (error) {
console.error(error);
}
}An example React Native app using this SDK is available in the examples/ folder. It demonstrates:
β
State management
β
API integration
β
UI display of weather data
Run this code:
cd examples
npm install
npm run android # for Android
npm run ios # for iOSWeatherSDK.fetchWeatherByCity(cityName: string): Promise<object>WeatherSDK.fetchWeatherByCoordinates(lat: number, lon: number): Promise<object>This module is developed and maintained by Ronak Bothra
If you need any help with this module, or anything else, feel free to email me at rj.rjain567@gmail.com ππ»
MIT License Β© 2025