Closed minuk3508 closed 1 week ago
I didn't call the initiilze ads and still ads are showing
import React from 'react';
import Geolocation from 'react-native-geolocation-service';
import SplashScreen from 'react-native-splash-screen';
import Toast from 'react-native-toast-message';
import {Provider} from 'react-redux';
import {PersistGate} from 'redux-persist/integration/react';
import MainApp from './src/navigation';
import {persistor, store} from './src/store/index';
import {useAppOpenAd} from './src/hooks/appopenAdhook';
import {useEffect} from 'react';
import mobileAds, {MaxAdContentRating} from 'react-native-google-mobile-ads';
import callGdprConsent from './src/logic/callGdprConsent';
import { GestureHandlerRootView } from 'react-native-gesture-handler'
Geolocation.setRNConfiguration({
config: {
skipPermissionRequests: true,
authorizationLevel: 'auto',
locationProvider: 'auto',
},
});
const App2 = () => {
const {ad_closed, loading} = useAppOpenAd();
useEffect(() => {
if (ad_closed) {
SplashScreen.hide();
}
if (!loading) {
SplashScreen.hide();
}
}, [ad_closed, loading]);
return <MainApp />;
};
const App = () => {
const initGdpConsent = async () => {
try {
let dd = await callGdprConsent()
console.log(dd ,"Ads Consent");
} catch (error) {
console.log(error ,"ERROR");
}
}
const initilizeAdsModules = () => {
mobileAds()
.setRequestConfiguration({
maxAdContentRating: MaxAdContentRating.PG,
tagForChildDirectedTreatment: true,
tagForUnderAgeOfConsent: true,
testDeviceIdentifiers: ['EMULATOR'],
})
.then(() => {
mobileAds()
.initialize()
.then(adapterStatuses => {});
});
};
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<Provider store={store}>
<PersistGate loading={null} persistor={persistor} onBeforeLift={() => {}}>
<App2 />
</PersistGate>
<Toast />
</Provider>
</GestureHandlerRootView>
);
};
export default App;
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
same issue m.any solution for this
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
not yet resolved
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
What happened?
The error appears in xcode. Why is this? Google App Advertising ID I wrote it in the app.json file. I also added it to info.plist.
Platforms
Only on iOS
React Native Info
Are your using Typescript?
package.json
app.json
ios/Podfile
android/build.gradle
No response
android/app/build.gradle
No response
android/settings.gradle
No response
AndroidManifest.xml
No response