Skip to content

Commit f7d2f3a

Browse files
committed
Remove banner ads - keep only interstitial and exit ads
1 parent c6e2ecf commit f7d2f3a

4 files changed

Lines changed: 1 addition & 142 deletions

File tree

hooks/useBannerAd.ts

Lines changed: 0 additions & 75 deletions
This file was deleted.

screens/HomeScreen.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { db } from '../firebase.config';
2020
import { collection, query, where, orderBy, getDocs } from 'firebase/firestore';
2121
import Header from '../components/Header';
2222
import { callAIWithFallback } from '../utils/aiProviders';
23-
import { useBannerAd, BannerAd, BannerAdSize } from '../hooks/useBannerAd';
2423

2524
const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get('window');
2625

@@ -132,9 +131,6 @@ export default function HomeScreen() {
132131
const [youtubeMetadata, setYoutubeMetadata] = useState<{ [key: string]: { title: string; titleKn: string; thumbnail: string } }>({});
133132
const [translations, setTranslations] = useState<{ [key: string]: { titleTranslated: string; descriptionTranslated: string; isTranslating: boolean; fromLang: string; toLang: string } }>({});
134133

135-
// Banner Ad
136-
const { adUnitId, onAdLoaded, onAdFailedToLoad } = useBannerAd();
137-
138134
const isKannada = i18n.language === 'kn';
139135

140136
// Detect if text is in Kannada (uses Kannada Unicode range)
@@ -986,19 +982,6 @@ export default function HomeScreen() {
986982
ItemSeparatorComponent={() => <View style={styles.separator} />}
987983
/>
988984

989-
{/* Banner Ad at bottom */}
990-
<View style={styles.bannerAdContainer}>
991-
<BannerAd
992-
unitId={adUnitId}
993-
size={BannerAdSize.ANCHORED_ADAPTIVE_BANNER}
994-
requestOptions={{
995-
requestNonPersonalizedAdsOnly: true,
996-
}}
997-
onAdLoaded={onAdLoaded}
998-
onAdFailedToLoad={onAdFailedToLoad}
999-
/>
1000-
</View>
1001-
1002985
{renderDetailModal()}
1003986
</SafeAreaView>
1004987
);
@@ -1009,11 +992,6 @@ const styles = StyleSheet.create({
1009992
flex: 1,
1010993
backgroundColor: '#F3F4F6',
1011994
},
1012-
bannerAdContainer: {
1013-
alignItems: 'center',
1014-
backgroundColor: '#F3F4F6',
1015-
paddingVertical: 4,
1016-
},
1017995
loadingContainer: {
1018996
flex: 1,
1019997
justifyContent: 'center',

screens/InfoScreen.tsx

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
areWeatherNotificationsEnabled,
3131
} from '../services/weatherNotificationService';
3232
import LocationPermissionDisclosure from '../components/LocationPermissionDisclosure';
33-
import { useBannerAd, BannerAd, BannerAdSize } from '../hooks/useBannerAd';
3433

3534
const { width } = Dimensions.get('window');
3635

@@ -116,9 +115,6 @@ export default function InfoScreen() {
116115
const [showLocationDisclosure, setShowLocationDisclosure] = useState(false);
117116
const [hasShownDisclosure, setHasShownDisclosure] = useState(false);
118117

119-
// Banner Ad
120-
const { adUnitId, onAdLoaded, onAdFailedToLoad } = useBannerAd();
121-
122118
// Memoized filtered content items for different media types
123119
const imageItems = useMemo(() => contentItems.filter(item => item.type === 'image'), [contentItems]);
124120
const videoItems = useMemo(() => contentItems.filter(item => item.type === 'video'), [contentItems]);
@@ -1372,19 +1368,6 @@ Keep the response concise, practical, and actionable for farmers. Remember to re
13721368
{selectedTab === 'media' && renderMediaContent()}
13731369
</ScrollView>
13741370

1375-
{/* Banner Ad at bottom */}
1376-
<View style={styles.bannerAdContainer}>
1377-
<BannerAd
1378-
unitId={adUnitId}
1379-
size={BannerAdSize.ANCHORED_ADAPTIVE_BANNER}
1380-
requestOptions={{
1381-
requestNonPersonalizedAdsOnly: true,
1382-
}}
1383-
onAdLoaded={onAdLoaded}
1384-
onAdFailedToLoad={onAdFailedToLoad}
1385-
/>
1386-
</View>
1387-
13881371
{/* Location Permission Disclosure Dialog */}
13891372
<LocationPermissionDisclosure
13901373
visible={showLocationDisclosure}
@@ -1451,12 +1434,7 @@ const styles = StyleSheet.create({
14511434
flex: 1,
14521435
},
14531436
scrollContent: {
1454-
paddingBottom: 20,
1455-
},
1456-
bannerAdContainer: {
1457-
alignItems: 'center',
1458-
backgroundColor: '#F3F4F6',
1459-
paddingVertical: 4,
1437+
paddingBottom: 80,
14601438
},
14611439

14621440
// Hero Weather Section

screens/MarketScreen.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import { Ionicons } from '@expo/vector-icons';
2424
import { useTranslation } from 'react-i18next';
2525
import Header from '../components/Header';
2626
import { saveToCache, loadFromCache, getCacheAge, CACHE_KEYS, CachedData } from '../utils/cacheUtils';
27-
import { useBannerAd, BannerAd, BannerAdSize } from '../hooks/useBannerAd';
2827

2928
export default function MarketScreen() {
3029
const { t, i18n } = useTranslation();
@@ -42,9 +41,6 @@ export default function MarketScreen() {
4241
const [cacheTimestamp, setCacheTimestamp] = useState<string>('');
4342
const [playingId, setPlayingId] = useState<string | null>(null);
4443

45-
// Banner Ad
46-
const { adUnitId, onAdLoaded, onAdFailedToLoad } = useBannerAd();
47-
4844
const animatedValues = useRef<Animated.Value[]>([]).current;
4945
const slideAnimation = useRef(new Animated.Value(0)).current;
5046

@@ -606,19 +602,6 @@ export default function MarketScreen() {
606602
showsVerticalScrollIndicator={false}
607603
/>
608604

609-
{/* Banner Ad at bottom */}
610-
<View style={styles.bannerAdContainer}>
611-
<BannerAd
612-
unitId={adUnitId}
613-
size={BannerAdSize.ANCHORED_ADAPTIVE_BANNER}
614-
requestOptions={{
615-
requestNonPersonalizedAdsOnly: true,
616-
}}
617-
onAdLoaded={onAdLoaded}
618-
onAdFailedToLoad={onAdFailedToLoad}
619-
/>
620-
</View>
621-
622605
{/* Date Picker Modal */}
623606
{showDatePicker && (
624607
<DateTimePicker
@@ -639,11 +622,6 @@ const styles = StyleSheet.create({
639622
flex: 1,
640623
backgroundColor: '#FFFFFF',
641624
},
642-
bannerAdContainer: {
643-
alignItems: 'center',
644-
backgroundColor: '#FFFFFF',
645-
paddingVertical: 4,
646-
},
647625

648626
// Loading Screen
649627
ultraModernLoadingContainer: {

0 commit comments

Comments
 (0)