Skip to content

Commit

Permalink
Updated iOS part of pigeons
Browse files Browse the repository at this point in the history
  • Loading branch information
LTPhantom committed Jan 24, 2024
1 parent 0a5b2fb commit 3fb1787
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 92 deletions.
2 changes: 1 addition & 1 deletion packages/google_mobile_ads/example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
#use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3D7E269FA8038A55BBCBF250 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2AB4EE7241D0927BB957D65 /* Pods_Runner.framework */; };
588A95C9AF0A9F291BFBAA5B /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86606948223BE74D544C6A9E /* Pods_RunnerTests.framework */; };
5D9FFB1BD89D3EE8407F52C0 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05829B98ED6985241910C784 /* libPods-RunnerTests.a */; };
8FC897F52411A9F100415930 /* NativeAdView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8FC897F42411A9F100415930 /* NativeAdView.xib */; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
Expand Down Expand Up @@ -39,6 +38,7 @@
9E61AA6029BBE8FD00801A83 /* FLTNativeTemplateStyleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E61AA5B29BBE8FD00801A83 /* FLTNativeTemplateStyleTest.m */; };
9E61AA6129BBE8FD00801A83 /* FLTNativeTemplateFontStyleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E61AA5C29BBE8FD00801A83 /* FLTNativeTemplateFontStyleTest.m */; };
9E61AA6229BBE8FD00801A83 /* FLTNativeTemplateColorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E61AA5D29BBE8FD00801A83 /* FLTNativeTemplateColorTest.m */; };
A58D81BE269CB68315135A9E /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E76CDAEFB51EA61B27075E6A /* libPods-Runner.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -65,6 +65,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
05829B98ED6985241910C784 /* libPods-RunnerTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
11876BBEFD14DE336FDF468C /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
Expand All @@ -74,7 +75,6 @@
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
86606948223BE74D544C6A9E /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8FC897F42411A9F100415930 /* NativeAdView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NativeAdView.xib; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -155,10 +155,10 @@
9EF4E6FE26392B230007E4FE /* FLTGoogleMobileAdsCollection_Internal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FLTGoogleMobileAdsCollection_Internal.m; path = ../../ios/Classes/FLTGoogleMobileAdsCollection_Internal.m; sourceTree = "<group>"; };
9EF4E6FF26392B230007E4FE /* FLTMobileAds_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FLTMobileAds_Internal.h; path = ../../ios/Classes/FLTMobileAds_Internal.h; sourceTree = "<group>"; };
9EFEAB4E29B0019F000A063B /* GoogleMobileAds.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = GoogleMobileAds.xcframework; path = "Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework/GoogleMobileAds.xcframework"; sourceTree = "<group>"; };
A2AB4EE7241D0927BB957D65 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B4B811D89E676EBD37E2E206 /* libPods-google_mobile_ads_exampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-google_mobile_ads_exampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
C0B22AB9B287C9F711EAAF48 /* Pods-google_mobile_ads_exampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-google_mobile_ads_exampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-google_mobile_ads_exampleTests/Pods-google_mobile_ads_exampleTests.debug.xcconfig"; sourceTree = "<group>"; };
CE82265EF05E2A9632B25E60 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
E76CDAEFB51EA61B27075E6A /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
F74051031B69F8124E38352E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -167,15 +167,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3D7E269FA8038A55BBCBF250 /* Pods_Runner.framework in Frameworks */,
A58D81BE269CB68315135A9E /* libPods-Runner.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9E61AA1329BBE51900801A83 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
588A95C9AF0A9F291BFBAA5B /* Pods_RunnerTests.framework in Frameworks */,
5D9FFB1BD89D3EE8407F52C0 /* libPods-RunnerTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -202,8 +202,8 @@
9EB9FE57280F853D00DDBB4F /* UserMessagingPlatform.xcframework */,
9EA7213525BB6464008D57E3 /* GoogleMobileAds.xcframework */,
B4B811D89E676EBD37E2E206 /* libPods-google_mobile_ads_exampleTests.a */,
A2AB4EE7241D0927BB957D65 /* Pods_Runner.framework */,
86606948223BE74D544C6A9E /* Pods_RunnerTests.framework */,
E76CDAEFB51EA61B27075E6A /* libPods-Runner.a */,
05829B98ED6985241910C784 /* libPods-RunnerTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -396,7 +396,6 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
49DB53F11513926D17758C29 /* [CP] Copy Pods Resources */,
D336851A73EADA4508A711A0 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand All @@ -415,7 +414,6 @@
9E61AA1229BBE51900801A83 /* Sources */,
9E61AA1329BBE51900801A83 /* Frameworks */,
9E61AA1429BBE51900801A83 /* Resources */,
3C1065414114FFC1A695F30C /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -521,24 +519,6 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed\n/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin\n";
};
3C1065414114FFC1A695F30C /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-RunnerTests/Pods-RunnerTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/OCMock/OCMock.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OCMock.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RunnerTests/Pods-RunnerTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
49DB53F11513926D17758C29 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -572,30 +552,6 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
};
D336851A73EADA4508A711A0 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
"${BUILT_PRODUCTS_DIR}/webview_flutter_wkwebview/webview_flutter_wkwebview.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter_wkwebview.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
F0309092BBFE54C4077DB91D /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
2 changes: 1 addition & 1 deletion packages/google_mobile_ads/example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleVersion</key>
<string>1</string>
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-3940256099942544~1458002511</string>
<string>ca-app-pub-3212738706492790~4234003410</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>SKAdNetworkItems</key>
Expand Down
2 changes: 1 addition & 1 deletion packages/google_mobile_ads/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class _MyAppState extends State<MyApp> {
InterstitialAd.load(
adUnitId: Platform.isAndroid
? 'ca-app-pub-3212738706492790/2245868040'
: 'ca-app-pub-3940256099942544/4411468910',
: 'ca-app-pub-3212738706492790/2100107746',
request: request,
adLoadCallback: InterstitialAdLoadCallback(
onAdLoaded: (InterstitialAd ad) {
Expand Down
2 changes: 1 addition & 1 deletion packages/google_mobile_ads/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ flutter:
uses-material-design: true

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.15.0 <4.0.0"
2 changes: 1 addition & 1 deletion packages/google_mobile_ads/ios/google_mobile_ads.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Google Mobile Ads plugin for Flutter.
s.source_files = 'Classes/**/*.{h,m}'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'Google-Mobile-Ads-SDK','~> 10.11.0'
s.dependency 'Google-Mobile-Ads-SDK','~> 10.14.0'
s.dependency 'webview_flutter_wkwebview'
s.ios.deployment_target = '10.0'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS' => 'armv7 arm64 x86_64' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#import <Flutter/Flutter.h>

@interface FLTMediationAdapterUnityPlugin : NSObject<FlutterPlugin>
#import "privacyapi.g.h"

@interface FLTMediationAdapterUnityPlugin : NSObject<FlutterPlugin, FLTMediationAdapterUnityPrivacyApi>
@end
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,50 @@

@implementation FLTMediationAdapterUnityPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
FlutterMethodChannel* channel = [FlutterMethodChannel
methodChannelWithName:@"unity"
binaryMessenger:[registrar messenger]];
FLTMediationAdapterUnityPlugin* instance = [[FLTMediationAdapterUnityPlugin alloc] init];
[registrar addMethodCallDelegate:instance channel:channel];
// FlutterMethodChannel* channel = [FlutterMethodChannel
// methodChannelWithName:@"unity"
// binaryMessenger:[registrar messenger]];
// FLTMediationAdapterUnityPlugin* instance = [[FLTMediationAdapterUnityPlugin alloc] init];
// [registrar addMethodCallDelegate:instance channel:channel];
}

- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
if ([@"setGDPRConsent" isEqualToString:call.method]) {
id value = call.arguments[@"gdprConsent"];
if (![value isKindOfClass:[NSNumber class]]) {
NSLog(@"Invalid gdprConsent parameter, Boolean expected");
result(FlutterMethodNotImplemented);
return;
}
UADSMetaData *gdprMetaData = [[UADSMetaData alloc] init];
[gdprMetaData set:@"gdpr.consent" value:value];
[gdprMetaData commit];
result(nil);
} else if ([@"setCCPAConsent" isEqualToString:call.method]) {
id value = call.arguments[@"ccpaConsent"];
if (![value isKindOfClass:[NSNumber class]]) {
NSLog(@"Invalid ccpaConsent parameter, Boolean expected");
result(FlutterMethodNotImplemented);
return;
}
UADSMetaData *ccpaMetaData = [[UADSMetaData alloc] init];
[ccpaMetaData set:@"privacy.consent" value:value];
[ccpaMetaData commit];
result(nil);
} else {
result(FlutterMethodNotImplemented);
}
- (void)setGDPRConsentGdprConsent:(BOOL)gdprConsent error:(FlutterError *_Nullable *_Nonnull)error {
UADSMetaData *gdprMetaData = [[UADSMetaData alloc] init];
[gdprMetaData set:@"gdpr.consent" value:[NSNumber numberWithBool:gdprConsent]];
[gdprMetaData commit];
}

- (void)setCCPAConsentCcpaConsent:(BOOL)ccpaConsent error:(FlutterError *_Nullable *_Nonnull)error {
UADSMetaData *ccpaMetaData = [[UADSMetaData alloc] init];
[ccpaMetaData set:@"privacy.consent" value:[NSNumber numberWithBool:ccpaConsent]];
[ccpaMetaData commit];
}
// - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
// if ([@"setGDPRConsent" isEqualToString:call.method]) {
// id value = call.arguments[@"gdprConsent"];
// if (![value isKindOfClass:[NSNumber class]]) {
// NSLog(@"Invalid gdprConsent parameter, Boolean expected");
// result(FlutterMethodNotImplemented);
// return;
// }
// UADSMetaData *gdprMetaData = [[UADSMetaData alloc] init];
// [gdprMetaData set:@"gdpr.consent" value:value];
// [gdprMetaData commit];
// result(nil);
// } else if ([@"setCCPAConsent" isEqualToString:call.method]) {
// id value = call.arguments[@"ccpaConsent"];
// if (![value isKindOfClass:[NSNumber class]]) {
// NSLog(@"Invalid ccpaConsent parameter, Boolean expected");
// result(FlutterMethodNotImplemented);
// return;
// }
// UADSMetaData *ccpaMetaData = [[UADSMetaData alloc] init];
// [ccpaMetaData set:@"privacy.consent" value:value];
// [ccpaMetaData commit];
// result(nil);
// } else {
// result(FlutterMethodNotImplemented);
// }
// }

@end
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Run `pod lib lint unity.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'unity'
s.name = 'gma_mediation_unity'
s.version = '1.0.0'
s.summary = 'Unity Ads for Flutter Google Mobile Ads.'
s.description = <<-DESC
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:gma_mediation_unity/privacy_api.g.dart';

class UnityAdapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 1.0.0
repository: https://github.com/googleads/googleads-mobile-flutter/tree/main/packages/google_mobile_ads/mediation

environment:
sdk: '>=3.3.0-170.0.dev <4.0.0'
sdk: ">=2.15.0 <4.0.0"
flutter: '>=3.3.0'

dependencies:
Expand Down

0 comments on commit 3fb1787

Please sign in to comment.