Skip to content

Commit

Permalink
feat: finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
dylancom committed Dec 4, 2024
1 parent d449d7d commit 3734fc2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ When using The New Architecture, some legacy code will still be used though. See
| iOS | Full Screen Ads (Turbo Native Module) | ✅ Complete |
| iOS | User Messaging Platform (Turbo Native Module) | ⏳ To-Do |
| iOS | EventEmitter (Turbo Native Module) | ⏳ To-Do |
| iOS | Revenue Precision Constants (Turbo Native Module) | ⏳ To-Do |
| iOS | Revenue Precision Constants (Turbo Native Module) | ✅ Complete |
| Android | Mobile Ads SDK Methods (Turbo Native Module) | ⏳ To-Do |
| Android | Banners (Fabric Native Component) | ⏳ To-Do |
| Android | Full Screen Ads (Turbo Native Module) | ⏳ To-Do |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableMap;
import com.google.android.gms.ads.AdValue;
import io.invertase.googlemobileads.common.RCTConvert;
import io.invertase.googlemobileads.common.ReactNativeEvent;
import io.invertase.googlemobileads.common.ReactNativeEventEmitter;
Expand Down Expand Up @@ -150,29 +149,4 @@ public void preferencesClearAll(Promise promise) {
ReactNativePreferences.getSharedInstance().clearAll();
promise.resolve(null);
}

@Override
public Map<String, Object> getConstants() {
Map<String, Object> constants = new HashMap<>();
// List<Map<String, Object>> appsList = new ArrayList<>();
// List<ReactNativeApp> reactNativeApps = ReactNativeApp.getApps(getReactApplicationContext());

// for (ReactNativeApp app : reactNativeApps) {
// appsList.add(RCTConvertFirebase.reactNativeAppToMap(app));
// }

// constants.put("NATIVE_FIREBASE_APPS", appsList);

// constants.put("FIREBASE_RAW_JSON", ReactNativeJSON.getSharedInstance().getRawJSON());

// Precision types in ad revenue events.
// See:
// https://developers.google.com/android/reference/com/google/android/gms/ads/AdValue.PrecisionType
constants.put("REVENUE_PRECISION_UNKNOWN", AdValue.PrecisionType.UNKNOWN);
constants.put("REVENUE_PRECISION_ESTIMATED", AdValue.PrecisionType.ESTIMATED);
constants.put("REVENUE_PRECISION_PUBLISHER_PROVIDED", AdValue.PrecisionType.PUBLISHER_PROVIDED);
constants.put("REVENUE_PRECISION_PRECISE", AdValue.PrecisionType.PRECISE);

return constants;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.google.android.gms.ads.initialization.OnInitializationCompleteListene
import com.google.android.gms.ads.RequestConfiguration
import com.google.android.gms.ads.AdInspectorError
import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.AdValue;
import com.google.android.gms.ads.OnAdInspectorClosedListener

private const val SERVICE = "RNGoogleMobileAdsModule";
Expand All @@ -33,6 +34,18 @@ class ReactNativeGoogleMobileAdsModule(

override fun getName() = SERVICE

override fun getConstants(): Map<String, Any> {
return mapOf(
// Precision types in ad revenue events.
// See:
// https://developers.google.com/android/reference/com/google/android/gms/ads/AdValue.PrecisionType
"REVENUE_PRECISION_UNKNOWN" to AdValue.PrecisionType.UNKNOWN,
"REVENUE_PRECISION_ESTIMATED" to AdValue.PrecisionType.ESTIMATED,
"REVENUE_PRECISION_PUBLISHER_PROVIDED" to AdValue.PrecisionType.PUBLISHER_PROVIDED,
"REVENUE_PRECISION_PRECISE" to AdValue.PrecisionType.PRECISE
)
}

private fun buildRequestConfiguration(
requestConfiguration: ReadableMap
): RequestConfiguration {
Expand Down
6 changes: 0 additions & 6 deletions src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ const {
REVENUE_PRECISION_UNKNOWN,
} = RNGoogleMobileAdsModule.getConstants?.() ?? {};

console.log('hiiii');
console.log('REVENUE_PRECISION_ESTIMATED', REVENUE_PRECISION_ESTIMATED);
console.log('REVENUE_PRECISION_PRECISE', REVENUE_PRECISION_PRECISE);
console.log('REVENUE_PRECISION_PUBLISHER_PROVIDED', REVENUE_PRECISION_PUBLISHER_PROVIDED);
console.log('REVENUE_PRECISION_UNKNOWN', REVENUE_PRECISION_UNKNOWN);

export enum RevenuePrecisions {
ESTIMATED = REVENUE_PRECISION_ESTIMATED,
PRECISE = REVENUE_PRECISION_PRECISE,
Expand Down

0 comments on commit 3734fc2

Please sign in to comment.