Skip to content

Commit

Permalink
Merge pull request #18 from Appyhigh/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
ukbaranwal31 authored Jun 17, 2024
2 parents c9d8330 + 4305b20 commit bf3e072
Show file tree
Hide file tree
Showing 18 changed files with 683 additions and 177 deletions.
1 change: 1 addition & 0 deletions .fvm/flutter_sdk
4 changes: 4 additions & 0 deletions .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"flutterSdkVersion": "3.13.0",
"flavors": {}
}
158 changes: 123 additions & 35 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.1"
version: "1.1.0"
applovin_max:
dependency: "direct main"
description:
name: applovin_max
sha256: "45702e29082e8a96bf18f05a2912b36e5c2d017b305dea901c673baa788acfbe"
sha256: "6ab5f0beb29bb8938c66b60c7ebc5bfbcb3284a215b5e245fcca6f64af0c468c"
url: "https://pub.dev"
source: hosted
version: "2.5.0"
version: "3.6.0"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -60,10 +60,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.17.2"
version: "1.18.0"
convert:
dependency: transitive
description:
Expand All @@ -84,10 +84,10 @@ packages:
dependency: transitive
description:
name: dart_jsonwebtoken
sha256: "2a42e97c0b8b4e9a42b24a71453635f445c7b66c7d7c81e3a429f37ead9fe778"
sha256: "063c20d3cee2b626d8a789ba9df0ad21f35012c4e9bd846ce50e921d77123df7"
url: "https://pub.dev"
source: hosted
version: "2.7.1"
version: "2.12.2"
ed25519_edwards:
dependency: transitive
description:
Expand Down Expand Up @@ -155,10 +155,10 @@ packages:
dependency: "direct main"
description:
name: google_mobile_ads
sha256: "010b7a7a81b5c8f760eb2e5add8eaa7e429b4982dc8c8e465b709611f52887be"
sha256: f07d4e2ebf56181e8dd18ee810607e84aeac8add5251bb44c1c886af47ff021a
url: "https://pub.dev"
source: hosted
version: "2.4.0"
version: "5.0.0"
http:
dependency: transitive
description:
Expand Down Expand Up @@ -211,10 +211,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -259,10 +259,10 @@ packages:
dependency: transitive
description:
name: plugin_platform_interface
sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc"
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.1.8"
pointycastle:
dependency: transitive
description:
Expand Down Expand Up @@ -307,18 +307,18 @@ packages:
dependency: transitive
description:
name: shared_preferences_linux
sha256: "9d387433ca65717bbf1be88f4d5bb18f10508917a8fa2fb02e0fd0d7479a9afa"
sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.3.2"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
sha256: fb5cf25c0235df2d0640ac1b1174f6466bd311f621574997ac59018a6664548d
sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.3.2"
shared_preferences_web:
dependency: transitive
description:
Expand All @@ -339,10 +339,10 @@ packages:
dependency: transitive
description:
name: shimmer
sha256: "1f1009b5845a1f88f1c5630212279540486f97409e9fc3f63883e71070d107bf"
sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
version: "3.0.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -360,18 +360,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
string_scanner:
dependency: transitive
description:
Expand All @@ -392,10 +392,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
version: "0.6.1"
typed_data:
dependency: transitive
description:
Expand All @@ -404,6 +404,70 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.2"
url_launcher:
dependency: transitive
description:
name: url_launcher
sha256: d25bb0ca00432a5e1ee40e69c36c85863addf7cc45e433769d61bed3fe81fd96
url: "https://pub.dev"
source: hosted
version: "6.2.3"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f"
url: "https://pub.dev"
source: hosted
version: "6.2.2"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03"
url: "https://pub.dev"
source: hosted
version: "6.2.4"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811
url: "https://pub.dev"
source: hosted
version: "3.1.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
url: "https://pub.dev"
source: hosted
version: "3.1.0"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: a932c3a8082e118f80a475ce692fde89dc20fddb24c57360b96bc56f7035de1f
url: "https://pub.dev"
source: hosted
version: "2.3.1"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7
url: "https://pub.dev"
source: hosted
version: "3.1.1"
vector_math:
dependency: transitive
description:
Expand All @@ -412,22 +476,46 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
visibility_detector:
web:
dependency: transitive
description:
name: visibility_detector
sha256: "15c54a459ec2c17b4705450483f3d5a2858e733aee893dcee9d75fd04814940d"
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev"
source: hosted
version: "0.3.3"
web:
version: "0.3.0"
webview_flutter:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
name: webview_flutter
sha256: "25e1b6e839e8cbfbd708abc6f85ed09d1727e24e08e08c6b8590d7c65c9a8932"
url: "https://pub.dev"
source: hosted
version: "4.7.0"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
sha256: f038ee2fae73b509dde1bc9d2c5a50ca92054282de17631a9a3d515883740934
url: "https://pub.dev"
source: hosted
version: "3.16.0"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
sha256: d937581d6e558908d7ae3dc1989c4f87b786891ab47bb9df7de548a151779d8d
url: "https://pub.dev"
source: hosted
version: "2.10.0"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
sha256: f12f8d8a99784b863e8b85e4a9a5e3cf1839d6803d2c0c3e0533a8f3c5a992a7
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
version: "3.13.0"
win32:
dependency: transitive
description:
Expand All @@ -445,5 +533,5 @@ packages:
source: hosted
version: "1.0.0"
sdks:
dart: ">=3.1.0-185.0.dev <3.3.0"
flutter: ">=3.3.0"
dart: ">=3.2.3 <3.3.0"
flutter: ">=3.16.6"
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ dependencies:
# The example app is bundled with the plugin so we use a path dependency on
# the parent directory to use the current plugin's version.
path: ../
google_mobile_ads: ^2.0.1
applovin_max: ^2.5.0
google_mobile_ads: ^5.0.0
applovin_max: ^3.2.0

dev_dependencies:
flutter_test:
Expand Down
13 changes: 4 additions & 9 deletions lib/adsdk_main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ import 'package:adsdk/src/internal/widgets/hardstop_dialog.dart';
import 'package:applovin_max/applovin_max.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:gdpr_dialog/gdpr_dialog.dart';
import 'package:google_mobile_ads/google_mobile_ads.dart';

import 'src/admob/gdpr_constent_form.dart';
class AdSdk {
static bool _isInitialized = false;
static bool get isInitialized => _isInitialized;
static AppLifecycleReactor? appLifecycleReactor;
static final admobConsent = AdmobConsentForm();

static Future<void> initialize({
required String bundleId,
Expand Down Expand Up @@ -66,6 +67,7 @@ class AdSdk {
await MobileAds.instance.initialize();
await const MethodChannel("adsdk").invokeMethod("registerNativeAds");
AdSdkLogger.info("Google ads initialized.");
admobConsent.fetchConsentInfo();

if (applovinSdkKey != null) {
if (adSdkConfig.applovinTestDevices.isNotEmpty) {
Expand Down Expand Up @@ -158,14 +160,7 @@ class AdSdk {
appLifecycleReactor?.removeAppStateListener();
}

static Future<bool> getConsentForEU({
bool isTestMode = false,
String testIdentifier = '',
}) =>
GdprDialog.instance.showDialog(
isForTest: isTestMode,
testDeviceId: testIdentifier,
);
static Future<bool> getConsentForEU() => admobConsent.show();

static void showHardStopDialog(BuildContext context) => showDialog(
context: context,
Expand Down
1 change: 0 additions & 1 deletion lib/src/admob/admob_appopen_ad.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ abstract class AdmobAppOpenAd {
AppOpenAd.load(
adUnitId: adUnitId,
request: AdSdkState.adSdkConfig.adRequest,
orientation: AppOpenAd.orientationPortrait,
adLoadCallback: AppOpenAdLoadCallback(
onAdLoaded: (ad) => c.complete(AdSdkRawAd(ad: ad)),
onAdFailedToLoad: (error) => c.complete(
Expand Down
Loading

0 comments on commit bf3e072

Please sign in to comment.