Skip to content

Commit

Permalink
fix crash in ios due to ads library
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalkishor1991 committed Nov 3, 2024
1 parent e709e84 commit c8718a2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "croma",
"react-native-google-mobile-ads": {
"android_app_id": "ca-app-pub-6847037498271557~7057578612",
"ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx",
"ios_app_id": "ca-app-pub-3940256099942544~1458002511",
"delay_app_measurement_init": true,
"user_tracking_usage_description": "This identifier will be used to deliver personalized ads to you."

Expand Down
3 changes: 2 additions & 1 deletion screens/ChatSessionScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ActivityIndicator,
Text,
ImageBackground,
Platform,
} from 'react-native';
import Colors from '../constants/Styles';
import React, { useState, useEffect, useRef } from 'react';
Expand Down Expand Up @@ -162,7 +163,7 @@ const ChatSessionScreen = (props) => {
</>
)}

{ messages.length < 2 && <AdBanner plan={pro.plan} />}
{ messages.length < 2 && Platform.OS == 'android' && <AdBanner plan={pro.plan} />}

</View>
</ImageBackground>
Expand Down
5 changes: 3 additions & 2 deletions screens/MyPalettesScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
ScrollView,
StyleSheet,
View,
Text
Text,
Platform
} from 'react-native';
import { PaletteCard } from '../components/PaletteCard';

Expand Down Expand Up @@ -60,7 +61,7 @@ const MyPalettesScreen = function ({ navigation, route }) {
})}
<Spacer />
</ScrollView>
<AdBanner plan={pro.plan} />
{Platform.OS=='android' && <AdBanner plan={pro.plan} />}
</View>
);
}
Expand Down
4 changes: 2 additions & 2 deletions screens/SavePaletteScreen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/prop-types */
import React, { useState, useEffect, useRef } from 'react';
import { Text, View, StyleSheet, TextInput, ScrollView } from 'react-native';
import { Text, View, StyleSheet, TextInput, ScrollView, Platform } from 'react-native';
import { PalettePreviewCard } from '../components/PalettePreviewCard';
import Colors from '../constants/Styles';
import CromaButton from '../components/CromaButton';
Expand Down Expand Up @@ -103,7 +103,7 @@ export default function SavePaletteScreen({ navigation, route }) {
<TextDialog text={t('A palette with the same name already exists.')} />
)}
</ScrollView>
<AdBanner plan={pro.plan} />
{Platform.OS =='android' && <AdBanner plan={pro.plan} />}
</View>
);
}
Expand Down

0 comments on commit c8718a2

Please sign in to comment.