Skip to content

Commit

Permalink
Remove references to unused Facebook classes (#332)
Browse files Browse the repository at this point in the history
* Merge branch 'master' of https://github.com/cbridges1/react-native-admob-native-ads

* Updated example project.

* Updated example project.

* Updated package.json.

* Updated docs for example project.
  • Loading branch information
cbridges1 authored Jun 27, 2023
1 parent 3948fcc commit 4254a2e
Show file tree
Hide file tree
Showing 48 changed files with 38,846 additions and 18,595 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ public void setConfiguration(ReadableMap config) {

Utils.setVideoOptions(config.getMap("videoOptions"), videoOptions, adOptions);
Utils.setTargetingOptions(config.getMap("targetingOptions"), adRequest);
Utils.setMediationOptions(config.getMap("mediationOptions"), adRequest);

unifiedNativeAdLoadedListener = new UnifiedNativeAdLoadedListener(name, nativeAds,
totalAds, mContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,6 @@ public void setTargetingOptions(ReadableMap options) {
Utils.setTargetingOptions(options, adRequest);
}

public void setMediationOptions(ReadableMap options) {
Utils.setMediationOptions(options, adRequest);
}

@Override
public void requestLayout() {
super.requestLayout();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public class RNAdmobNativeViewManager extends ViewGroupManager<RNAdmobNativeView
public static final String PROP_PAUSE_AD_RELOAD = "pauseAdReload";
public static final String PROP_MEDIA_ASPECT_RATIO = "mediaAspectRatio";
public static final String PROP_VIDEO_OPTIONS = "videoOptions";
public static final String PROP_MEDIATION_OPTIONS = "mediationOptions";
public static final String PROP_TARGETING_OPTIONS = "targetingOptions";
public static final String PROP_AD_REPOSITORY = "repository";

Expand Down Expand Up @@ -105,11 +104,6 @@ public void setVideoOptions(final RNAdmobNativeView nativeAdWrapper, final Reada
nativeAdWrapper.setVideoOptions(options);
}

@ReactProp(name = PROP_MEDIATION_OPTIONS)
public void setMediationOptions(final RNAdmobNativeView nativeAdWrapper, final ReadableMap options) {
nativeAdWrapper.setMediationOptions(options);
}

@ReactProp(name = PROP_NON_PERSONALIZED_ADS, defaultBoolean = false)
public void setPropNonPersonalizedAds(final RNAdmobNativeView nativeAdWrapper, final boolean npa) {

Expand Down
11 changes: 0 additions & 11 deletions android/src/main/java/com/ammarahmed/rnadmob/nativeads/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableType;
import com.google.ads.mediation.admob.AdMobAdapter;
import com.google.ads.mediation.facebook.FacebookAdapter;
import com.google.ads.mediation.facebook.FacebookExtras;
import com.google.android.gms.ads.VideoOptions;
import com.google.android.gms.ads.admanager.AdManagerAdRequest;
import com.google.android.gms.ads.nativead.NativeAdOptions;
Expand Down Expand Up @@ -81,19 +79,10 @@ public static void setVideoOptions(ReadableMap options, VideoOptions.Builder vid
}

public static void setMediaAspectRatio(int type, NativeAdOptions.Builder adOptions) {
Log.d("LOG_NATIVE_ADS" , FacebookAdapter.class.getName());

adOptions.setMediaAspectRatio(type);
}

public static void setMediationOptions(ReadableMap options, AdManagerAdRequest.Builder adRequest) {
if (options == null) return;
if (options.hasKey("nativeBanner")) {
Bundle facebookExtras = new FacebookExtras().setNativeBanner(options.getBoolean("nativeBanner")).build();
adRequest.addNetworkExtrasBundle(FacebookAdapter.class, facebookExtras);
}
}

public static void setRequestNonPersonalizedAdsOnly(boolean npa, AdManagerAdRequest.Builder adRequest) {
Bundle extras = new Bundle();
if (npa) {
Expand Down
2 changes: 2 additions & 0 deletions docs/docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ then run `yarn or npm install` in the example folder and finally to run the exam
```bash
yarn react-native run-android
```

Remember to remove any reference to react-native-admob-native-ads in the package.json and package-lock.json files before committing.
6 changes: 0 additions & 6 deletions example/.buckconfig

This file was deleted.

2 changes: 2 additions & 0 deletions example/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
3 changes: 0 additions & 3 deletions example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
rules: {
'react-native/no-inline-styles': 0,
},
};
66 changes: 0 additions & 66 deletions example/.flowconfig

This file was deleted.

3 changes: 0 additions & 3 deletions example/.gitattributes

This file was deleted.

24 changes: 14 additions & 10 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local

# Android/IntelliJ
#
Expand All @@ -28,32 +29,35 @@ build/
.gradle
local.properties
*.iml
*.hprof
.cxx/
*.keystore
!debug.keystore

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle

# CocoaPods
# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
1 change: 1 addition & 0 deletions example/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
4 changes: 2 additions & 2 deletions example/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
};
1 change: 1 addition & 0 deletions example/.ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.6
1 change: 1 addition & 0 deletions example/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
6 changes: 6 additions & 0 deletions example/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby File.read(File.join(__dir__, '.ruby-version')).strip

gem 'cocoapods', '~> 1.11', '>= 1.11.3'
Loading

0 comments on commit 4254a2e

Please sign in to comment.