@aguacerowx/react-native
v0.0.35
Published
Native weather rendering for React Native
Maintainers
Readme
@aguacerowx/react-native
Welcome to the official React Native SDK for AguaceroWX.
Installation
npm install @aguacerowx/react-nativeImportant Prerequisite: Mapbox SDK v11
This library is built on top of @rnmapbox/maps and requires the Mapbox Maps SDK v11 for both iOS and Android. You must perform the following manual setup steps to configure your project correctly.
iOS Setup
You must explicitly enable Mapbox SDK v11 in your iOS project.
Modify your Podfile
Open your project's ios/Podfile and add the following lines near the top of the file. This tells the @rnmapbox/maps library to use a v11 version of the native SDK.
# Add these lines near the top of your ios/Podfile
require_relative '../node_modules/@rnmapbox/maps/scripts/mapbox-rb'
$RNMapboxMapsVersion = '~> 11.0' # This enforces Mapbox SDK v11
use_mapbox_maps!Enable Modular Headers (Required for New Architecture)
If you're using React Native's new architecture (newArchEnabled: true), you must enable modular headers.
For Expo Projects (Recommended)
If you're using Expo, add the expo-build-properties plugin to your app.config.js or app.config.ts:
npm install expo-build-propertiesThen add it to your Expo config:
// app.config.ts
export default {
// ... other config
plugins: [
// ... other plugins
[
'expo-build-properties',
{
ios: {
useFrameworks: 'static',
useModularHeaders: true, // Add this line
},
},
],
],
};Then run:
npx expo prebuild --cleanFor Non-Expo React Native Projects
Option 1: Enable modular headers globally (Recommended)
Add this line after the platform :ios line in your ios/Podfile:
platform :ios, '13.4'
use_modular_headers! # Add this line
prepare_react_native_project!Option 2: Enable modular headers in post_install hook
Add this code inside your post_install do |installer| block:
post_install do |installer|
# Enable modular headers for libzstd
installer.pods_project.targets.each do |target|
if target.name == 'libzstd'
target.build_configurations.each do |config|
config.build_settings['DEFINES_MODULE'] = 'YES'
end
end
end
# ... rest of your existing post_install code
endInstall Pods
After saving the Podfile, navigate to your ios directory in the terminal and run a fresh pod installation.
cd ios
pod installAndroid Setup
Android requires configuration for Mapbox credentials and an additional native dependency.
Configure Mapbox Credentials
You will need a secret token with DOWNLOADS:READ scope and a public token.
In your android/gradle.properties file, add your secret token:
# android/gradle.properties
MAPBOX_DOWNLOADS_TOKEN=sk.xxxxxxxxxxIn your android/app/build.gradle file, add your public token inside the defaultConfig block:
// android/app/build.gradle
android {
defaultConfig {
// ... other configs
buildConfigField "String", "MAPBOX_ACCESS_TOKEN", "\"pk.xxxxxxxxxx\""
}
}After completing these steps, your application should be correctly configured to use the library. For more detailed information or troubleshooting, please refer to the official @rnmapbox/maps documentation.
