SDK মাইগ্রেশন

এই পৃষ্ঠাটি iOS-এর জন্য Google মোবাইল বিজ্ঞাপন SDK-এর বর্তমান এবং পূর্ববর্তী সংস্করণগুলির স্থানান্তর কভার করে৷ 12.0.0 সংস্করণ ফেব্রুয়ারি 2025 এ প্রকাশিত হবে বলে আশা করা হচ্ছে।

SDK সংস্করণ v11 থেকে v12 তে স্থানান্তর করুন৷

Xcode 16.0 এ আপগ্রেড করুন

ন্যূনতম সমর্থিত Xcode সংস্করণ 16.0-এ বেড়েছে।

সুইফ্ট নামকরণ সমর্থন

12.0.0 সংস্করণে সুইফ্ট API ডিজাইন নির্দেশিকাগুলিতে নামকরণের নিয়মগুলি অনুসরণ করার জন্য পরিবর্তনগুলি অন্তর্ভুক্ত রয়েছে৷ এই পরিবর্তনগুলি শুধুমাত্র সুইফটকে প্রভাবিত করে। অবজেক্টিভ-সি এপিআই-এ কোনো নামকরণ পরিবর্তন করা হয়নি।

শ্রেণি উপসর্গ পরিবর্তন

ক্লাসের উপসর্গগুলিতে নিম্নলিখিত পরিবর্তনগুলি করা হয়েছে:

  • সব ধরনের নাম জুড়ে GAD উপসর্গ সরানো হয়েছে।
  • GAM উপসর্গের নাম পরিবর্তন করে AdManager
  • GADM উপসর্গের নাম পরিবর্তন করে Mediation

ত্রুটিগুলি সমাধান করুন

এই পরিবর্তনগুলির ফলে ত্রুটিগুলি সমাধান করার সর্বোত্তম উপায় হল একটি ফিক্স-ইট সংশোধন করা

নামকরণের দ্বন্দ্ব সমাধান করুন

নামকরণের দ্বন্দ্ব সমাধান করতে, মডিউল দ্বারা প্রদত্ত নামস্থান ব্যবহার করুন। উদাহরণস্বরূপ, GADRequest এখন Request নামে পরিচিত। নিচের উদাহরণটি Google মোবাইল বিজ্ঞাপন SDK Request শ্রেণীর নামস্থান:

import GoogleMobileAds
...
var request: GoogleMobileAds.Request?

সুইফট পরিবর্তনের বিস্তারিত তালিকা

নিম্নলিখিত সারণীগুলি সুইফ্ট API-এ করা পরিবর্তনগুলি তালিকাভুক্ত করে:

সংস্করণ 11 সংস্করণ 12
GADAdapterInitializationState AdapterInitializationState
GADAdChoicesPosition AdChoicesPosition
GADAdChoicesView AdChoicesView
GADAdFormat AdFormat
GADAdLoader AdLoader
GADAdLoaderAdType AdLoaderAdType
GADAdLoaderDelegate AdLoaderDelegate
GADAdMetadataDelegate AdMetadataDelegate
GADAdMetadataProvider AdMetadataProvider
GADAdNetworkExtras AdNetworkExtras
GADAdNetworkResponseInfo AdNetworkResponseInfo
GADAdReward AdReward
GADAdSize AdSize
GADAdSizeDelegate AdSizeDelegate
GADAdValue AdValue
GADAdValuePrecision AdValuePrecision
GADAppEventDelegate AppEventDelegate
GADAppOpenAd AppOpenAd
GADAppOpenSignalRequest AppOpenSignalRequest
GADAudioVideoManager AudioVideoManager
GADAudioVideoManagerDelegate AudioVideoManagerDelegate
GADBannerSignalRequest BannerSignalRequest
GADBannerView BannerView
GADBannerViewDelegate BannerViewDelegate
GADCustomEventExtras CustomEventExtras
GADCustomEventRequest CustomEventRequest
GADCustomNativeAd CustomNativeAd
GADCustomNativeAdLoaderDelegate CustomNativeAdLoaderDelegate
GADCustomNativeAdDelegate CustomNativeAdDelegate
GADDebugOptionsViewControllerDelegate DebugOptionsViewControllerDelegate
GADDebugOptionsViewController DebugOptionsViewController
GADDisplayAdMeasurement DisplayAdMeasurement
GADExtras Extras
GADFullScreenPresentingAd FullScreenPresentingAd
GADFullScreenContentDelegate FullScreenContentDelegate
GADAdapterStatus AdapterStatus
GADInitializationStatus InitializationStatus
GADInterstitialAd InterstitialAd
GADInterstitialSignalRequest InterstitialSignalRequest
GADMediaAspectRatio MediaAspectRatio
GADMediaContent MediaContent
GADMediaView MediaView
GADMobileAds MobileAds
GADMultipleAdsAdLoaderOptions MultipleAdsAdLoaderOptions
GADMuteThisAdReason MuteThisAdReason
GADNativeAd NativeAd
GADNativeAdLoaderDelegate NativeAdLoaderDelegate
GADNativeAdView NativeAdView
GADNativeAdCustomClickGestureOptions NativeAdCustomClickGestureOptions
GADNativeAdDelegate NativeAdDelegate
GADNativeAdImage NativeAdImage
GADNativeAdImageAdLoaderOptions NativeAdImageAdLoaderOptions
GADNativeAdInlineBehavior NativeAdInlineBehavior
GADNativeAdInlineBehaviorOptions NativeAdInlineBehaviorOptions
GADNativeAdMediaAdLoaderOptions NativeAdMediaAdLoaderOptions
GADNativeAdUnconfirmedClickDelegate NativeAdUnconfirmedClickDelegate
GADNativeAdViewAdOptions NativeAdViewAdOptions
GADNativeMuteThisAdLoaderOptions NativeMuteThisAdLoaderOptions
GADNativeSignalRequest NativeSignalRequest
GADPresentationError PresentationError
GADPublisherPrivacyPersonalizationState PublisherPrivacyPersonalizationState
GADQueryInfo QueryInfo
GADRequest Request
GADRequestError RequestError
GADRequestConfiguration RequestConfiguration
GADResponseInfo ResponseInfo
GADRewardedAd RewardedAd
GADRewardedSignalRequest RewardedSignalRequest
GADRewardedInterstitialAd RewardedInterstitialAd
GADRewardedInterstitialSignalRequest RewardedInterstitialSignalRequest
GADSearchBannerView SearchBannerView
GADServerSideVerificationOptions ServerSideVerificationOptions
GADSignal Signal
GADSignalRequest SignalRequest
GADVersionNumber VersionNumber
GADVideoController VideoController
GADVideoControllerDelegate VideoControllerDelegate
অ্যাড ম্যানেজার
GAMBannerAdLoaderDelegate AdManagerBannerAdLoaderDelegate
GAMBannerView AdManagerBannerView
GAMBannerViewOptions AdManagerBannerViewOptions
GAMInterstitialAd AdManagerInterstitialAd
GAMRequest AdManagerRequest
মধ্যস্থতা
GADMAdNetworkAdapter MediationAdNetworkAdapter
GADMAdNetworkConnector MediationAdNetworkConnector
GADMBannerAnimationType MediationBannerAnimationType
GADMediatedUnifiedNativeAd MediationUnifiedNativeAd
GADMediatedUnifiedNativeAdNotificationSource MediationUnifiedNativeAdNotificationSource
GADMediationAd MediationAd
GADMediationAdConfiguration MediationAdConfiguration
GADMediationAdEventDelegate MediationAdEventDelegate
GADMediationAdRequest MediationAdRequest
GADMediationAdapter MediationAdapter
GADMediationAppOpenAd MediationAppOpenAd
GADMediationAppOpenAdEventDelegate MediationAppOpenAdEventDelegate
GADMediationBannerAd MediationBannerAd
GADMediationBannerAdConfiguration MediationBannerAdConfiguration
GADMediationBannerAdEventDelegate MediationBannerAdEventDelegate
GADMediationCredentials MediationCredentials
GADMediationInterstitialAd MediationInterstitialAd
GADMediationInterstitialAdConfiguration MediationInterstitialAdConfiguration
GADMediationInterstitialAdEventDelegate MediationInterstitialAdEventDelegate
GADMediationNativeAd MediationNativeAd
GADMediationNativeAdConfiguration MediationNativeAdConfiguration
GADMediationNativeAdEventDelegate MediationNativeAdEventDelegate
GADMediationRewardedAd MediationRewardedAd
GADMediationRewardedAdConfiguration MediationRewardedAdConfiguration
GADMediationRewardedAdEventDelegate MediationRewardedAdEventDelegate
GADMediationServerConfiguration MediationServerConfiguration
রিয়েল-টাইম বিডিং
GADRTBAdapter RTBAdapter
GADRTBMediationSignalsConfiguration RTBMediationSignalsConfiguration
GADRTBRequestParameters RTBRequestParameters

ধ্রুবক

সংস্করণ 11 সংস্করণ 12
GADAdLoaderAdType.gamBanner AdLoaderAdType.adManagerBanner
GADAdSizeBanner AdSizeBanner
GADAdSizeFluid AdSizeFluid
GADAdSizeFullBanner AdSizeFullBanner
GADAdSizeInvalid AdSizeInvalid
GADAdSizeLargeBanner AdSizeLargeBanner
GADAdSizeLeaderboard AdSizeLeaderboard
GADAdSizeMediumRectangle AdSizeMediumRectangle
GADAdSizeSkyscraper AdSizeSkyscraper
GoogleMobileAdsVersionString GoogleMobileAdsVersion

বৈশিষ্ট্য

টাইপ সংস্করণ 11 সংস্করণ 12
GADAdLoader loading isLoading
GADA AudioVideoManager audioSessionApplicationManaged isAudioSessionApplicationManaged
GADBannerView autoloadEnabled isAutoloadEnabled
GADMmobileAds sharedInstance shared
applicationMuted isApplicationMuted
GADMuteThisAdReason reasonDescription reason
GADNative Ad customMuteThisAdAvailable isCustomMuteThisAdAvailable
GADNativeAdCustomClickGestureOptions tapsAllowed areTapsAllowed
GADNativeAdImageAdLoaderOptions imageLoadingDisabled isImageLoadingDisabled
GADNativeMuteThisAdLoaderOptions customMuteThisAdRequested isCustomMuteThisAdRequested
GADNativeSignal Request imageLoadingDisabled isImageLoadingDisabled
customMuteThisAdRequested isCustomMuteThisAdRequested
GADRequest neighboringContentURLStrings neighboringContentURLs
GADRresponseInfo extrasDictionary extras
GADServerSideVerification Options customRewardString customRewardText
GADS সংকেত signalString signal
GADSignal অনুরোধ neighboringContentURLStrings neighboringContentURLs
GADVideoController customControlsRequested areCustomControlsRequested
clickToExpandEnabled isClickToExpandEnabled
GADVideoOptions startMuted shouldStartMuted
customControlsRequested areCustomControlsRequested
clickToExpandRequested isClickToExpandRequested

ফাংশন

টাইপ সংস্করণ 11 সংস্করণ 12
GADAdSize GADPortraitInlineAdaptiveBannerAdSizeWithWidth(_:) portraitInlineAdaptiveBanner(width:)
GADLandscapeInlineAdaptiveBannerAdSizeWithWidth(_:) landscapeInlineAdaptiveBanner(width:)
GADCurrentOrientationInlineAdaptiveBannerAdSizeWithWidth(_:) currentOrientationInlineAdaptiveBanner(width:)
GADInlineAdaptiveBannerAdSizeWithWidthAndMaxHeight(_:, _:) inlineAdaptiveBanner(width:maxHeight:)
GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(_:) portraitAnchoredAdaptiveBanner(width:)
GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(_:) landscapeAnchoredAdaptiveBanner(width:)
GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(_:) currentOrientationAnchoredAdaptiveBanner(width:)
GADAdSizeFromCGSize(_:) adSizeFor(cgSize:)
GADAdSizeFullWidthPortraitWithHeight(_:) fullWidthPortrait(height:)
GADAdSizeFullWidthLandscapeWithHeight(_:) fullWidthLandscape(height:)
GADAdSizeEqualToSize(_:, _:) isAdSizeEqualToSize(size1:size2:)
IsGADAdSizeValid(_:) isAdSizeValid(size:)
GADAdSizeIsFluid(_:) isAdSizeFluid(size:)
CGSizeFromGADAdSize(_:) cgSize(for:)
NSStringFromGADAdSize(_:) string(for:)
NSValueFromGADAdSize(_:) nsValue(for:)
GADAdSizeFromNSValue(_:) adSizeFor(nsValue:)
GADClosestValidSizeForAdSizes(_:_:) closestValidSizeForAdSizes(original:possibleAdSizes:)
GADAppEventDelegate adView(_:didReceiveAppEvent:withInfo:) adView(_:didReceiveAppEvent:with:)
interstitialAd(_:didReceiveAppEvent:withInfo:) adView(_:didReceiveAppEvent:with:)
GADAppOpenAd load(withAdResponseString:) load(with:)
load(withAdUnitID:request:completionHandler:) load(with:request:completionHandler:)
canPresent(fromRootViewController:) canPresent(from:)
present(fromRootViewController:) present(from:)
GADBannerView load(withAdResponseString:) load(with:)
GADInterstitial load(withAdResponseString:) load(with:)
load(withAdUnitID:request:completionHandler:) load(with:request:completionHandler:)
canPresent(fromRootViewController:) canPresent(from:)
present(fromRootViewController:) present(from:)
GADRewarded Ad load(withAdResponseString:) load(with:)
load(withAdUnitID:request:completionHandler:) load(with:request:completionHandler:)
canPresent(fromRootViewController:) canPresent(from:)
present(fromRootViewController:userDidEarnRewardHandler:) present(from:userDidEarnRewardHandler:)
GADRewarded ইন্টারস্টিশিয়াল অ্যাড load(withAdResponseString:) load(with:)
load(withAdUnitID:request:completionHandler:) load(with:request:completionHandler:)
canPresent(fromRootViewController:) canPresent(from:)
present(fromRootViewController:userDidEarnRewardHandler:) present(from:userDidEarnRewardHandler:)
GADVersionNumber GADGetStringFromVersionNumber(_ version: GADVersionNumber) string(for:)
মধ্যস্থতা
GADMAdNetworkAdapter getBannerWith(_:) getBanner(with:)
presentInterstitial(fromRootViewController:) presentInterstitial(from:)
getNativeAd(withAdTypes:options:) getNativeAd(with:options:)
GADMediatedUnifiedNativeAd didRecordClickOnAsset(withName:view:viewController:) didRecordClickOnAsset(with:view:viewController:)
GADMediationAdapter setUpWith(_:completionHandler:) setUp(with:completionHandler:)
GADMediationAdSize present(fromRootViewController:) present(from:)
GADMediationAppOpenAd present(fromRootViewController:) present(from:)
GADM মিডিয়ায়েশন ইন্টারস্টিশিয়াল অ্যাড present(fromRootViewController:) present(from:)
GADMediationRewardedAd present(fromRootViewController:) present(from:)
GAInterstitialAd load(withAdManagerAdUnitID:request:completionHandler:) load(with:request:completionHandler:)

ভিডিও নিঃশব্দ অবস্থা নিয়ন্ত্রণে API পরিবর্তন

GADVideoControllerisMuted প্রপার্টি এবং setMute: পদ্ধতি একটি muted প্রপার্টি দিয়ে প্রতিস্থাপিত হয়।

ইনলাইন অভিযোজিত বিজ্ঞাপন পরিবর্তন

স্থান ব্যবহার অপ্টিমাইজ করতে, ইনলাইন অভিযোজিত বিজ্ঞাপনগুলি প্রাথমিকভাবে ফ্রেমে কোন স্থান দখল করে না। CGSizeFromGADAdSize(_:) একটি ইনলাইন অভিযোজিত বিজ্ঞাপন আকারের সাথে কল করা এখন 0 উচ্চতা প্রদান করে যতক্ষণ না Google মোবাইল বিজ্ঞাপন SDK একটি বিজ্ঞাপন ফেরত দেয়।

কাস্টম অনুসন্ধান বিজ্ঞাপন সরানো হয়েছে

নিম্নলিখিত ক্লাসগুলি কোনও প্রতিস্থাপন ছাড়াই সরানো হয়েছে:

  • GADDynamicHeightSearchBannerView
  • GADDynamicHeightSearchRequest
  • GADSearchBannerView

ত্রুটি কোড পরিবর্তন

নিম্নলিখিত ত্রুটি কোড পরিবর্তন করা হয়েছে:

ক্লাস নোট
GADErrorMediationNoFill ত্রুটিগুলি এখন GADErrorNoFill হিসাবে ফিরে আসে।
GADErrorReceivedInvalidResponse GADErrorReceivedInvalidAdString দিয়ে প্রতিস্থাপিত হয়েছে।

GADSimulatorID সরানো হয়েছে

GADSimulatorID সরানো হয়েছে। সিমুলেটরগুলি ইতিমধ্যেই ডিফল্টরূপে পরীক্ষা মোডে রয়েছে৷

কাস্টম টার্গেটিং পরিবর্তন

GADRequestcustomTargeting অভিধান এখন মান প্রকার হিসাবে String এর পরিবর্তে Any ব্যবহার করে। এটি আপনাকে API-তে সংখ্যাসূচক মান পাস করতে দেয়।

অতিরিক্ত পরামিতি পরিবর্তন

v10 থেকে v11 এ স্থানান্তর করুন

ন্যূনতম স্থাপনার লক্ষ্য

ন্যূনতম স্থাপনার লক্ষ্য iOS 12 এ বাড়ানো হয়েছে।

ন্যূনতম এক্সকোড সংস্করণ

ন্যূনতম সমর্থিত Xcode সংস্করণটি 15.1-এ বৃদ্ধি করা হয়েছে।

iOS 12-এ বিজ্ঞাপন দেখানো বন্ধ হয়ে গেছে

Google মোবাইল বিজ্ঞাপন SDK সংস্করণ 11.0.0 শুধুমাত্র iOS 13 এবং উচ্চতর সংস্করণে চলমান ডিভাইসগুলিতে বিজ্ঞাপন পরিবেশন করে৷

GoogleAppMeasurement নির্ভরতা সরানো হয়েছে

11.0.0 সংস্করণে, GoogleAppMeasurement উপর নির্ভরতা সরানো হয়েছে। AdMob-এ ব্যবহারকারীর মেট্রিক্স টগল করার এই নির্ভরতা 2024 সালের শুরুর দিকে বন্ধ হয়ে যাবে। AdMob-এ ব্যবহারকারীর মেট্রিক্স সংগ্রহ করা চালিয়ে যেতে, আপনার AdMob অ্যাপটিকে Firebase-এর সাথে লিঙ্ক করুন এবং আপনার অ্যাপে Firebase SDK-এর জন্য Google Analytics সংহত করুন।

পূর্ণ-স্ক্রীন বিজ্ঞাপন উপস্থাপনা পরিবর্তন

নিম্নলিখিত পরিবর্তনগুলি বিভিন্ন বিজ্ঞাপন বিন্যাসকে প্রভাবিত করে:

  • অ্যাপ খোলা
  • ইন্টারস্টিশিয়াল
  • পুরস্কৃত
  • পুরস্কৃত ইন্টারস্টিশিয়াল

-canPresentFromRootViewController:error: এবং -presentFromRootViewController: এ ভিউ কন্ট্রোলার প্যারামিটারটি বাতিলযোগ্য। যদি শূন্য পাস করা হয়, বিজ্ঞাপনটি ভিউ কন্ট্রোলার শ্রেণিবিন্যাসে শীর্ষস্থানীয় ভিউ কন্ট্রোলার থেকে উপস্থাপন করা হয়।

পদ্ধতি সরানো হয়েছে

নিম্নলিখিত পদ্ধতিগুলি সরানো হয়।

v11.0.0 প্রকার পদ্ধতি নোট
GADAppOpenAd load(withAdUnitID adUnitID: String, request: GADRequest?, orientation: UIInterfaceOrientation) পরিবর্তে load(withAdUnitID adUnitID: String, request: GADRequest?) ব্যবহার করুন।
GADMediationBannerAdEventDelegate willBackgroundApplication() প্রতিস্থাপন নেই।
GADMediationInterstitialAdEventDelegate willBackgroundApplication() প্রতিস্থাপন নেই।
GADMediationNativeAdEventDelegate willBackgroundApplication() প্রতিস্থাপন নেই।
GADMediationRewardedAdEventDelegate didRewardUser(with reward: GADAdReward) পরিবর্তে didRewardUser() ব্যবহার করুন।
GADMediatedUnifiedNativeAdNotificationSource mediatedNativeAdWillLeaveApplication(_ mediatedNativeAd: GADMediatedUnifiedNativeAd) প্রতিস্থাপন নেই।
GADRequest কনফিগারেশন setSameAppKeyEnabled(_ enabled: Bool) পরিবর্তে setPublisherFirstPartyIDEnabled(_ enabled: Bool) ব্যবহার করুন।
tagForUnderAge(ofConsent underAgeOfConsent: Bool) পরিবর্তে tagForUnderAgeOfConsent প্রপার্টি ব্যবহার করুন।
tag(forChildDirectedTreatment childDirectedTreatment: Bool) পরিবর্তে tagForChildDirectedTreatment প্রপার্টি ব্যবহার করুন।

বৈশিষ্ট্যগুলি সরানো হয়েছে

নিম্নলিখিত বৈশিষ্ট্য মুছে ফেলা হয়.

v11.0.0 ক্লাস সম্পত্তি নোট
GADMediationAdConfiguration ব্যবহারকারীর অবস্থান প্রতিস্থাপন নেই।
ব্যবহারকারীর অক্ষাংশ
ব্যবহারকারীর দ্রাঘিমাংশ
userLocationAccuracyInMeters
শিশু নির্দেশিত চিকিত্সা পরিবর্তে GADMobileAds.sharedInstance.requestConfiguration.tagForChildDirectedTreatment ব্যবহার করুন।
GADRresponseInfo adNetworkClassName পরিবর্তে loadedAdNetworkResponseInfo থেকে adNetworkClassName ব্যবহার করুন।

সরানো হয়েছে GADAdFormatUnknown

কোনো প্রতিস্থাপন ছাড়াই GADAdFormatUnknown সরানো হয়েছে।

লগিং SDK সংস্করণে পরিবর্তন

সংস্করণ 11.0.0 sdkVersion সরিয়ে দেয়। Google মোবাইল বিজ্ঞাপন SDK সংস্করণ লগ করতে, পরিবর্তে versionNumber ব্যবহার করুন৷

সংস্করণ 10.0.0

GADMobileAds.sharedInstance().sdkVersion

সংস্করণ 11.0.0

GADGetStringFromVersionNumber(GADMobileAds.sharedInstance().versionNumber)

GADAdLoader ত্রুটি পরিচালনার পরিবর্তন

সংস্করণ 11.0.0 থেকে শুরু করে, GADAdLoader কোনো বিজ্ঞাপনের অনুরোধ করে না যদি এর delegate অনুরোধ করা বিজ্ঞাপনের প্রকারের প্রতিনিধি প্রোটোকলের সাথে সামঞ্জস্য না করে। পূর্বে, বিজ্ঞাপনের অনুরোধ করার পরে এটি ব্যর্থ হয়েছিল।

পরীক্ষার আচরণে পরিবর্তন

সারণীটি দেখুন যা নিম্নলিখিত বৈশিষ্ট্যগুলি true হলে ফিরে আসার জন্য আপডেট করা শর্তগুলি দেখায়।

ক্লাস সম্পত্তি
GADMediationAdConfiguration isTestRequest
GADCustomEventRequest isTesting
v10.0.0 v11.0.0
  • ডিভাইসটিকে testDeviceIdentifiers এ একটি পরীক্ষা ডিভাইস হিসাবে স্পষ্টভাবে ঘোষণা করা হয়েছে।
  • ডিভাইসটিকে testDeviceIdentifiers এ একটি পরীক্ষা ডিভাইস হিসাবে স্পষ্টভাবে ঘোষণা করা হয়েছে।
  • ডিভাইসটি একটি সিমুলেটর।
  • AdMob UI-তে ডিভাইসটিকে একটি পরীক্ষামূলক ডিভাইস হিসেবে স্পষ্টভাবে ঘোষণা করা হয়েছে।

v9 থেকে v10 এ স্থানান্তর করুন

iOS 11-এ বিজ্ঞাপন দেখানো বন্ধ হয়ে গেছে

Google মোবাইল বিজ্ঞাপন SDK সংস্করণ 10.0.0 শুধুমাত্র iOS 12 এবং উচ্চতর সংস্করণে চলমান ডিভাইসগুলিতে বিজ্ঞাপন পরিবেশন করে৷

Google Mobile Ads SDK সংস্করণ 10.0.0-এ আপগ্রেড করলে iOS 11 এবং iOS 10 ডিভাইসে আপনার অ্যাপ ভাঙবে না, তবে সেই ডিভাইসগুলিতে কোনো বিজ্ঞাপন দেওয়া হবে না।

বিটকোড দিয়ে বিল্ডিং আর সমর্থিত নয়

আপনার মোবাইল অ্যাপে বিটকোড নিষ্ক্রিয় করা এখন Google মোবাইল বিজ্ঞাপন SDK সংহত করার জন্য প্রয়োজন৷

প্রকারগুলি সরানো হয়েছে

টাইপ নোট
জিএডিজেন্ডার প্রতিস্থাপন নেই।
GDMReward-ভিত্তিক ভিডিও অ্যাডনেটওয়ার্ক অ্যাডাপ্টার প্রোটোকল Choose Networks- এ তালিকাভুক্ত সমস্ত পুরস্কৃত মধ্যস্থতা অ্যাডাপ্টার এক বছরেরও বেশি সময় ধরে এই প্রোটোকলগুলি ব্যবহার করা বন্ধ করে দিয়েছে। মধ্যস্থতা এবং কাস্টম ইভেন্টের জন্য GADMediationAdapter ব্যবহার করুন।
GDMReward-ভিত্তিক ভিডিও অ্যাডনেটওয়ার্ক সংযোগকারী প্রোটোকল

বৈশিষ্ট্যগুলি সরানো হয়েছে

নিম্নলিখিত বৈশিষ্ট্য কোন প্রতিস্থাপন ছাড়া মুছে ফেলা হয়.

v10.0.0 ক্লাস সম্পত্তি
GADMediationAdRequest ব্যবহারকারীর জন্মদিন
ব্যবহারকারী লিঙ্গ
userHasLocation
ব্যবহারকারীর অক্ষাংশ
ব্যবহারকারীর দ্রাঘিমাংশ
userLocationAccuracyInMeters
ব্যবহারকারীর অবস্থান বর্ণনা
GADCustomEventRequest userHasLocation
ব্যবহারকারীর অক্ষাংশ
ব্যবহারকারীর দ্রাঘিমাংশ
userLocationAccuracyInMeters
ব্যবহারকারীর অবস্থান বর্ণনা

v8 থেকে v9 এ স্থানান্তর করুন

iOS 10-এ বিজ্ঞাপন দেখানো বন্ধ হয়ে যায়

Google Mobile Ads SDK সংস্করণ 9.0.0 সমর্থন করে সর্বনিম্ন iOS সংস্করণ হল iOS 11।

Google Mobile Ads SDK সংস্করণ 9.0.0-এ আপগ্রেড করলে iOS 10 ডিভাইসে আপনার অ্যাপ ভাঙবে না, তবে সেই ডিভাইসগুলিতে কোনো বিজ্ঞাপন দেওয়া হবে না।

স্ট্যাটাস বার নিয়ন্ত্রণের কঠোর প্রয়োগ

সংস্করণ 9.0.0 থেকে শুরু করে, আপনি যখন পূর্ণ-স্ক্রীন ফর্ম্যাট বিজ্ঞাপনগুলি উপস্থাপন করেন, তখন আপনার অ্যাপটি নিশ্চিত করা উচিত যে বিজ্ঞাপনগুলি স্ট্যাটাস বারের উপস্থাপনা নিয়ন্ত্রণ করতে সক্ষম। আপনি যদি তা করতে ব্যর্থ হন তবে আপনি লগগুলিতে একটি ত্রুটি বার্তা দেখতে পাবেন।

আপনার অ্যাপে ভিউ কন্ট্রোলারের নির্দিষ্ট লেআউটের উপর নির্ভর করে, এটি নিশ্চিত করার জন্য আপনাকে কোনো পরিবর্তন করতে হবে না। আপনার বিজ্ঞাপনের rootViewControllerchildViewControllerForStatusBarHidden প্রপার্টি সেট করতে হবে কিনা তা বিবেচনা করুন।

adDidPresentFullScreenContent: adWillPresentFullScreenContent এ পুনঃনামকরণ করুন:

আচরণের কোন পরিবর্তন নেই। বিজ্ঞাপনটি উপস্থাপিত হওয়ার ঠিক আগে ডেলিগেট পদ্ধতিটি চালু করা হয়, তাই নতুন পদ্ধতির নামটি এর কার্যকারিতা আরও ভালভাবে প্রতিফলিত করে।

GADRequest এ অবস্থান সেটিং API সরান

- (void)setLocationWithLatitude:longitude:accuracy: GADRequest থেকে মুছে ফেলা হয়েছে যেহেতু বিজ্ঞাপন টার্গেট করতে Google দ্বারা অবস্থানের ডেটা ব্যবহার করা হয় না। প্রয়োজনে তৃতীয় পক্ষের বিজ্ঞাপন নেটওয়ার্কগুলিতে তথ্য সরবরাহ করতে তৃতীয় পক্ষের API ব্যবহার করুন৷

কাস্টম ইভেন্ট ইন্টারফেস অবচয়

কাস্টম ইভেন্টগুলি AdMob মধ্যস্থতা ব্যবহার করে প্রকাশকদের একটি বিজ্ঞাপন নেটওয়ার্কের জন্য জলপ্রপাতের মধ্যস্থতা যোগ করতে সক্ষম করে যা সমর্থিত বিজ্ঞাপন নেটওয়ার্কগুলির মধ্যে একটি নয়৷

সমস্ত কাস্টম ইভেন্ট প্রোটোকল বাতিল করা হয়েছে৷ পরিবর্তে, একই কার্যকারিতা অর্জন করতে বিদ্যমান GADMediationAdapter এবং GADMediationAdEventDelegate প্রোটোকল ব্যবহার করুন। এই পরিবর্তনটি স্পষ্টতা উন্নত করে এবং আপনাকে পুরস্কৃত বিজ্ঞাপন এবং ইন্টারস্ক্রোলার বিজ্ঞাপনগুলির জন্য কাস্টম ইভেন্ট তৈরি করতে সক্ষম করে যা আগে উপলব্ধ ছিল না।

এপিআই

নীচের সারণীটি 9.0.0 সংস্করণ থেকে শুরু করে ব্যবহার করা উচিত এমন কাস্টম ইভেন্ট APIগুলির সাথে সংশ্লিষ্ট মধ্যস্থতা অ্যাডাপ্টার APIগুলিকে তালিকাভুক্ত করে৷

v8 v9
GADCustomEventBanner
GADCustomEventInterstitial
GADCustomEventNativeAd
GADMediationAdapter GADMediationBannerAd
GADM মিডিয়ায়েশন ইন্টারস্টিশিয়াল অ্যাড
GADMediationInterscrollerAd
GADMediationRewardedAd
GADMediationNativeAd
delegate GADMediationAdapter ক্লাসের প্রতিটি লোড ফাংশনের লোড কমপ্লিশন হ্যান্ডলার দ্বারা প্রতিনিধি ফেরত দেওয়া হয়
-init -init
-requestBannerAd:parameter: label:request: -loadBannerForAdConfiguration: completionHandler:
-requestInterstitialAdWith Parameter:label:request: -loadInterstitialFor AdConfiguration: completionHandler:
-requestNativeAdWithParameter: request:adTypes:options: rootViewController: -loadNativeAdFor AdConfiguration: completionHandler:
N/A -loadInterscrollerAdFor AdConfiguration: completionHandler:
N/A -loadRewardedAdFor AdConfiguration: completionHandler:
-presentFromRootViewController: -presentFromViewController:
-handlesUserClicks -handlesUserClicks
-handlesUserImpressions -handlesUserImpressions

প্রতিনিধি পদ্ধতি

নীচের সারণীটি 9.0.0 সংস্করণ থেকে শুরু করে ব্যবহার করা উচিত এমন কাস্টম ইভেন্ট প্রতিনিধি পদ্ধতিতে সংশ্লিষ্ট মধ্যস্থতা বিজ্ঞাপন ইভেন্ট প্রতিনিধি পদ্ধতিগুলিকে তালিকাভুক্ত করে৷

v8 v9
GADCustomEventBannerDelegate
GADCustomEventInterstitialDelegate
GADCustomEventNativeAdDelegate
GADMediationAdEventDelegate GADMediationAd
-customEventBanner:didReceiveAd:
-customEventInterstitialDidReceiveAd:
GADMediationAdapter ক্লাসে প্রতিটি লোড ফাংশনের লোড সমাপ্তি হ্যান্ডলারে বিজ্ঞাপন লোডের স্থিতি অন্তর্ভুক্ত করা হয়
-customEventBanner:didFailAd:
-customEventInterstitial:didFailAd:
-customEventBannerWasClicked:
-customEventInterstitialWasClicked:
-reportClick
-customEventBannerWill PresentModal:
-customEventInterstitialWill PresentModal:
-willPresentFullScreenView
-customEventBannerWill DismissModal:
-customEventInterstitialWill DismissModal:
-willDismissFullScreenView
-customEventBannerDid DismissModal:
-customEventInterstitialDid DismissModal:
-didDismissFullScreenView
-customEventBannerWill LeaveApplication:
-customEventInterstitialWill LeaveApplication:
-willBackgroundApplication
viewControllerFor PresentingModalView -[GADMediationBannerAd view]

অন্যান্য সরানো/প্রতিস্থাপিত পদ্ধতি এবং ধ্রুবক

পদ্ধতি, ধ্রুবক, বা সম্পত্তি পরিবর্তন
kGAD- উপসর্গযুক্ত ধ্রুবক সরানো হয়েছে। GAD- উপসর্গযুক্ত ধ্রুবক ব্যবহার করুন।
GADAdNetworkResponseInfo credentials মুছে ফেলা হয়েছে। পরিবর্তে adUnitMapping ব্যবহার করুন।
GADCustomNativeAd GADCustomNativeAdmediaView বাতিল করা হয়েছে। পরিবর্তে mediaContent ব্যবহার করুন.
GoogleMobileAds এ অ্যাপ-মধ্যস্থ ক্রয় APIs GoogleMobileAdsinAppPurchase APIগুলি সরানো হয়েছে৷

v7 থেকে v8 তে স্থানান্তর করুন

Google মোবাইল বিজ্ঞাপন SDK সংস্করণ 8.0.0 কিছু বড় পরিবর্তনের সাথে সাথে API-এর কিছু নাম পরিবর্তন এবং অপসারণ করে।

পূর্ণ-স্ক্রীন বিন্যাস API আপডেট

সংস্করণ 8.0.0 দিয়ে শুরু করে, ইন্টারস্টিশিয়াল এবং পুরস্কৃত বিজ্ঞাপনগুলি আরও ধারাবাহিকতার জন্য একটি সাধারণ পূর্ণ স্ক্রীন বিজ্ঞাপন শৈলী ভাগ করে। এই নতুন পূর্ণ-স্ক্রীন বিজ্ঞাপন APIগুলির সংস্করণ 7 পূর্ণ-স্ক্রীন বিজ্ঞাপন API থেকে দুটি প্রধান পার্থক্য রয়েছে:

  1. স্ট্যাটিক ক্লাস পদ্ধতি load .

    একটি পূর্ণ-স্ক্রীন বিজ্ঞাপন লোড/দেখানোর পূর্ববর্তী পদ্ধতি নিম্নরূপ:

    1. একটি বিজ্ঞাপন বস্তুর উদাহরণ তৈরি করুন এবং এটির একটি রেফারেন্স ধরে রাখুন।
    2. একজন প্রতিনিধিকে বরাদ্দ করুন যা লোড পরিচালনা করে এবং কলব্যাক দেখায়।
    3. একটি বিজ্ঞাপন লোড করুন.
    4. isReady ব্যবহার করে বিজ্ঞাপন লোড হয়েছে কিনা তা পরীক্ষা করুন।
    5. বিজ্ঞাপন দেখান।

    সংস্করণ 8 এ, পদ্ধতির সামান্য পরিবর্তন হয়। লোড কলব্যাকগুলি আর প্রতিনিধিদের অংশ নয়৷ পরিবর্তে, তারা একটি সমাপ্তি হ্যান্ডলার হিসাবে load পদ্ধতিতে পাস করা হয়েছে:

    1. বিজ্ঞাপন ক্লাসে একটি স্ট্যাটিক লোড পদ্ধতি কল করুন এবং একটি লোড সমাপ্তি হ্যান্ডলার প্রদান করুন।
    2. লোড সমাপ্তির কলব্যাকে, লোড করা বিজ্ঞাপনের একটি রেফারেন্স রাখুন যা ফেরত এসেছে।
    3. একটি প্রতিনিধি নিয়োগ করুন যেটি কলব্যাক শো পরিচালনা করে।
    4. বিজ্ঞাপন দেখান।

    নতুন পদ্ধতি এই সুবিধা প্রদান করে:

    • লোড করা হয়নি এমন একটি বিজ্ঞাপনের রেফারেন্স আপনার কাছে থাকবে না।
    • একটি বিজ্ঞাপন বস্তু লোড করার সময় আপনাকে ধরে রাখতে হবে না।
  2. ধারাবাহিক বিজ্ঞাপন ইভেন্ট।

    ইভেন্টের ধরন বিদ্যমান API v8 API
    লোড ঘটনা GADInterstitialDelegate বা GADRewardedAdDelegate GADInterstitialAdLoadCompletionHandler বা GADRewardedAdLoadCompletionHandler
    উপস্থাপনা ঘটনা GADFullScreenContentDelegate

    পূর্বে, কোনো বিজ্ঞাপনের ইভেন্ট শোনার জন্য, আপনি এমন একটি ক্লাস নিবন্ধন করতেন যা GADInterstitialDelegate প্রোটোকলকে একটি ইন্টারস্টিশিয়ালের প্রতিনিধি সম্পত্তিতে প্রয়োগ করে, অথবা এমন একটি শ্রেণী নিবন্ধন করে যা GADRewardedAdDelegate প্রোটোকলকে একটি পুরস্কৃত বিজ্ঞাপনের প্রতিনিধি সম্পত্তিতে প্রয়োগ করে আপনি কোন ফর্ম্যাটটি ব্যবহার করছেন তার উপর নির্ভর করে। এই একই প্রতিনিধির একটি বিজ্ঞাপনের লোডিং এবং উপস্থাপনা জীবনচক্র উভয়ের সাথে সম্পর্কিত পদ্ধতি ছিল।

    সংস্করণ 8 এর সাথে, লোড এবং উপস্থাপনা ইভেন্টগুলি আলাদা। আপনি এখন বিজ্ঞাপন লোড করার আগে একটি একক প্রতিনিধি সেট করার পরিবর্তে একটি বিজ্ঞাপন দেখানোর আগে যে কোনো সময় একটি GADFullScreenContentDelegate নিবন্ধন করতে পারেন৷ বিজ্ঞাপন লোড ইভেন্টগুলি, যা প্রতিটি ফর্ম্যাটের জন্য নির্দিষ্ট, লোড পদ্ধতিতে পাস করা একক লোড কমপ্লিশন হ্যান্ডলারে চলে যায়।

ইন্টারস্টিশিয়াল

বিজ্ঞাপন লোড করুন

নীচের কোড স্নিপেটগুলি আপনাকে দেখায় কিভাবে একটি ইন্টারস্টিশিয়াল বিজ্ঞাপন লোড করতে হয় এবং বিজ্ঞাপনটি সফল হলে বা লোড হতে ব্যর্থ হলে ইভেন্টগুলি শুনতে হয়৷

v7

সুইফট

import GoogleMobileAds
import UIKit

class ViewController: UIViewController, GADInterstitialDelegate {

  var interstitial: GADInterstitial!

  override func viewDidLoad() {
    super.viewDidLoad()
    interstitial = GADInterstitial(adUnitID: "ca-app-pub-3940256099942544/4411468910")
    interstitial.delegate = self
    let request = GADRequest()
    interstitial.load(request)
  }

  /// Tells the delegate an ad request succeeded.
  func interstitialDidReceiveAd(_ ad: GADInterstitial) {
    print("Interstitial ad loaded.")
  }

  /// Tells the delegate an ad request failed.
  func interstitial(_ ad: GADInterstitial, didFailToReceiveAdWithError error: GADRequestError) {
    print("Interstitial ad failed to load with error: \(error.localizedDescription)")
  }
}

উদ্দেশ্য-C

@import GoogleMobileAds;
@import UIKit;

@interface ViewController () 

@property(nonatomic, strong) GADInterstitial *interstitial;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];
  self.interstitial = [[GADInterstitial alloc]
      initWithAdUnitID:@"ca-app-pub-3940256099942544/4411468910"];
  self.interstitial.delegate = self;
  GADRequest *request = [GADRequest request];
  [self.interstitial loadRequest:request];
}

/// Tells the delegate an ad request succeeded.
- (void)interstitialDidReceiveAd:(GADInterstitial *)ad {
  NSLog(@"Insterstitial ad loaded.");
}

/// Tells the delegate an ad request failed.
- (void)interstitial:(GADInterstitial *)ad
    didFailToReceiveAdWithError:(GADRequestError *)error {
  NSLog(@"Interstitial ad failed to load with error: %@", [error localizedDescription]);
}

v8

সুইফট

import GoogleMobileAds
import UIKit

class ViewController: UIViewController, GADFullScreenContentDelegate {

  var interstitial: GADInterstitialAd?

  override func viewDidLoad() {
    super.viewDidLoad()
    let request = GADRequest()
    GADInterstitialAd.load(withAdUnitID:"ca-app-pub-8123415297019784/4985798738",
                                request: request,
                      completionHandler: { (ad, error) in
                        if let error = error {
                          print("Failed to load interstitial ad with error: \(error.localizedDescription)")
                          return
                        }
                        self.interstitial = ad
                        self.interstitial.fullScreenContentDelegate = self
                      }
    )
  }
}

উদ্দেশ্য-C

@import GoogleMobileAds;
@import UIKit;

@interface ViewController () 

@property(nonatomic, strong) GADInterstitialAd *interstitial;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];
  GADRequest *request = [GADRequest request];
  [GADInterstitialAd loadWithAdUnitID:@"ca-app-pub-3940256099942544/4411468910"
                              request:request
                    completionHandler:^(GADInterstitialAd *ad, NSError *error) {
    if (error) {
      NSLog(@"Failed to load interstitial ad with error: %@", [error localizedDescription]);
      return;
    }
    self.interstitial = ad;
    self.interstitial.fullScreenContentDelegate = self;
  }];
}

বিজ্ঞাপন প্রদর্শন করুন

v7

সুইফট

func showInterstitial() {
  ...
  if interstitial.isReady {
    interstitial.present(fromRootViewController: self)
  } else {
    print("Ad wasn't ready")
  }
}

উদ্দেশ্য-C

- (void)showInterstitial: {
  ...
  if (self.interstitial.isReady) {
    [self.interstitial presentFromRootViewController:self];
  } else {
    NSLog(@"Ad wasn't ready");
  }
}

v8

সুইফট

func showInterstitial() {
  ...
  if let ad = interstitial {
    ad.present(fromRootViewController: self)
  } else {
    print("Ad wasn't ready")
  }
}

উদ্দেশ্য-C

- (void)showInterstitial: {
  ...
  if (self.interstitial) {
    [self.interstitial presentFromRootViewController:self];
  } else {
    NSLog(@"Ad wasn't ready");
  }
}

উপস্থাপনা বিজ্ঞাপন ঘটনা

নীচের কোড স্নিপেটগুলি আপনাকে দেখায় যে কীভাবে বিজ্ঞাপনটি উপস্থাপন করা হয় (সফলভাবে বা অসফলভাবে) এবং কখন এটি খারিজ করা হয় তার জন্য কীভাবে কলব্যাকগুলি পরিচালনা করবেন৷

v7

সুইফট

override func viewDidLoad() {
  super.viewDidLoad()
  interstitial = GADInterstitial(adUnitID: "ca-app-pub-3940256099942544/4411468910")
  interstitial.delegate = self
  ...
}

/// Tells the delegate that an interstitial will be presented.
func interstitialWillPresentScreen(_ ad: GADInterstitial) {
  print("Interstitial ad will be presented.")
}

/// Tells the delegate the interstitial is to be animated off the screen.
func interstitialWillDismissScreen(_ ad: GADInterstitial) {
  print("Interstitial ad will be dismissed.")
}

/// Tells the delegate the interstitial had been animated off the screen.
func interstitialDidDismissScreen(_ ad: GADInterstitial) {
  print("Interstitial ad dismissed.")
}

/// Tells the delegate that a user click will open another app
/// (such as the App Store), backgrounding the current app.
///
/// This is not a reliable callback for an ad click event and is removed in
/// version 8. If you wish to listen to an ad causing a user to leave the app,
/// use applicationWillResignActive: or sceneWillResignActive: instead.
func interstitialWillLeaveApplication(_ ad: GADInterstitial) {
  print("Interstitial ad will leave application.")
}

উদ্দেশ্য-C

- (void)viewDidLoad {
  [super viewDidLoad];
  self.interstitial = [[GADInterstitial alloc] initWithAdUnitID:"ca-app-pub-3940256099942544/4411468910"];
  self.interstitial.delegate = self;
  ...
}

/// Tells the delegate that an interstitial will be presented.
- (void)interstitialWillPresentScreen:(GADInterstitial *)ad {
  NSLog(@"Interstitial ad will be presented.");
}

/// Tells the delegate the interstitial is to be animated off the screen.
- (void)interstitialWillDismissScreen:(GADInterstitial *)ad {
  NSLog(@"Interstitial ad will be dismissed.");
}

/// Tells the delegate the interstitial had been animated off the screen.
- (void)interstitialDidDismissScreen:(GADInterstitial *)ad {
  NSLog(@"Interstitial ad dismissed.");
}

/// Tells the delegate that a user click will open another app
/// (such as the App Store), backgrounding the current app.
///
/// This is not a reliable callback for an ad click event and is removed in
/// version 8. If you wish to listen to an ad causing a user to leave the app,
/// use applicationWillResignActive: or sceneWillResignActive: instead.
- (void)interstitialWillLeaveApplication:(GADInterstitial *)ad {
  NSLog(@"Interstitial ad will leave application.");
}

v8

সুইফট

override func viewDidLoad() {
  super.viewDidLoad()
  let request = GADRequest()
  GADInterstitialAd.load(withAdUnitID:"ca-app-pub-8123415297019784/4985798738",
                              request: request,
                    completionHandler: { (ad, error) in
                      if let error = error {
                        print(error.localizedDescription)
                        return
                      }
                      self.interstitial = ad
                      self.interstitial.fullScreenContentDelegate = self
                    }
  )
}

func adDidPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
  print("Ad did present full screen content.")
}

func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
  print("Ad failed to present full screen content with error \(error.localizedDescription).")
}

func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) {
  print("Ad did dismiss full screen content.")
}

উদ্দেশ্য-C

- (void)viewDidLoad {
  [super viewDidLoad];
  GADRequest *request = [GADRequest request];
  [GADInterstitialAd loadWithAdUnitID:@"ca-app-pub-3940256099942544/4411468910"
                              request:request
                    completionHandler:^(GADInterstitialAd *ad, NSError *error) {
    if (error) {
      NSLog(@"interstitial:didFailToReceiveAdWithError: %@", [error localizedDescription])
      return;
    }
    self.interstitial = ad;
    self.interstitial.fullScreenContentDelegate = self;
  }];
}

- (void)adDidPresentFullScreenContent:(id)ad {
  NSLog(@"Ad did present full screen content.");
}

- (void)ad:(id)ad didFailToPresentFullScreenContentWithError:(NSError *)error {
  NSLog(@"Ad failed to present full screen content with error %@.", [error localizedDescription]);
}

- (void)adDidDismissFullScreenContent:(id)ad {
  NSLog(@"Ad did dismiss full screen content.");
}

পুরস্কৃত

বিজ্ঞাপন লোড করুন

v7

সুইফট

import GoogleMobileAds
import UIKit

class ViewController: UIViewController, GADRewardedAdDelegate {
  /// The rewarded ad.
  var rewardedAd: GADRewardedAd?

  override func viewDidLoad() {
    super.viewDidLoad()
    rewardedAd = GADRewardedAd(adUnitID: "ca-app-pub-3940256099942544/1712485313")
    rewardedAd.delegate = self
    rewardedAd?.load(GADRequest()) { error in
      if let error = error {
        print("Rewarded ad failed to load with error: \(error.localizedDescription)")
      } else {
        print("Rewarded ad loaded.")
      }
    }
  }
}

উদ্দেশ্য-C

@import GoogleMobileAds;
@import UIKit;

@interface ViewController () 

@property(nonatomic, strong) GADRewardedAd *rewardedAd;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  self.rewardedAd = [[GADRewardedAd alloc]
      initWithAdUnitID:@"ca-app-pub-3940256099942544/1712485313"];
  self.rewardedAd.delegate = self;
  GADRequest *request = [GADRequest request];
  [self.rewardedAd loadRequest:request completionHandler:^(GADRequestError * _Nullable error) {
    if (error) {
      NSLog(@"Rewarded ad failed to load with error: %@", [error localizedDescription]);
    } else {
      NSLog(@"Rewarded ad loaded.");
    }
  }];
}

v8

সুইফট

import GoogleMobileAds
import UIKit

class ViewController: UIViewController, GADFullScreenContentDelegate {
  /// The rewarded ad.
  var rewardedAd: GADRewardedAd?

  override func viewDidLoad() {
  super.viewDidLoad()
  let request = GADRequest()
  GADRewardedAd.load(withAdUnitID: "ca-app-pub-8123415297019784/9501821136",
                          request: request, completionHandler: { (ad, error) in
                            if let error = error {
                              print("Rewarded ad failed to load with error: \(error.localizedDescription)")
                              return
                            }
                            self.rewardedAd = ad
                            self.rewardedAd?.fullScreenContentDelegate = self
                          }
  )
  }
}

উদ্দেশ্য-C

@import GoogleMobileAds;
@import UIKit;

@interface ViewController () 

@property(nonatomic, strong) GADRewardedAd *rewardedAd;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  GADRequest *request = [GADRequest request];
  [GADRewardedAd loadWithAdUnitID:@"ca-app-pub-3940256099942544/1712485313"
                          request:request
                completionHandler:^(GADRewardedAd *ad, NSError *error) {
    if (error) {
      NSLog(@"Rewarded ad failed to load with error: %@", [error localizedDescription]);
      return;
    }
    self.rewardedAd = ad;
    NSLog(@"Rewarded ad loaded.");
    self.rewardedAd.fullScreenContentDelegate = self;
}

বিজ্ঞাপন প্রদর্শন এবং পুরস্কার হ্যান্ডেল

পুরস্কৃত বিজ্ঞাপনের জন্য আপনাকে ইভেন্টটি পরিচালনা করতে হবে যখন একজন ব্যবহারকারী পুরস্কার অর্জন করেন। GADRewardedAd API-এর 7 সংস্করণের সাথে, আপনি GADRewardedAdDelegate প্রোটোকলের অংশ হিসাবে rewardedAd:userDidEarnReward: বাস্তবায়ন করেন। 8 সংস্করণের জন্য, আপনি বিজ্ঞাপনটি উপস্থাপন করার জন্য GADUserDidEarnRewardHandler প্রয়োগ করেন।

v7

সুইফট

func showRewardedAd() {
  ...
  if rewardedAd.isReady {
    rewardedAd.present(fromRootViewController: self delegate:self)
  } else {
    print("Ad wasn't ready")
  }
}

/// Tells the delegate that the user earned a reward.
func rewardedAd(_ rewardedAd: GADRewardedAd, userDidEarnReward: GADAdReward) {
  // TODO: Reward the user.
}

উদ্দেশ্য-C

- (void)showRewardedAd: {
  ...
  if (self.rewardedAd.isReady) {
    [self.rewardedAd presentFromRootViewController:self delegate:self];
  } else {
    NSLog(@"Ad wasn't ready");
  }
}

/// Tells the delegate that the user earned a reward.
- (void)rewardedAd:(GADRewardedAd *)rewardedAd userDidEarnReward:(GADAdReward *)reward {
  // TODO: Reward the user.
}

v8

সুইফট

func showRewardedAd() {
  ...
  if let ad = rewardedAd {
      ad.present(fromRootViewController: self,
               userDidEarnRewardHandler: {
                 let reward = ad.adReward
                 // TODO: Reward the user.
               }
      )
  } else {
    print("Ad wasn't ready")
  }
}

উদ্দেশ্য-C

- (void)showRewardedAd: {
  ...
  if (self.rewardedAd) {
    [self.rewardedAd presentFromRootViewController:self
                          userDidEarnRewardHandler:^ {
      GADAdReward *reward = self.rewardedAd.adReward;
      // TODO: Reward the user.
    }];
  } else {
    NSLog(@"Ad wasn't ready");
  }
}

উপস্থাপনা বিজ্ঞাপন ঘটনা

GADRewardedAd API এর মাধ্যমে আপনি একটি GADRewardedAdDelegate সেই পদ্ধতিতে পাস করেন যা বিজ্ঞাপনটি উপস্থাপন করে। GADRewardedAd API-এর সাথে, আপনি বিজ্ঞাপনটি উপস্থাপন করার আগে বিজ্ঞাপনে একটি সম্পত্তি হিসাবে একটি GADFullscreenContentDelegate সেট করেন।

v7

সুইফট

func showRewardedAd() {
  ...
  if rewardedAd.isReady {
    rewardedAd.present(fromRootViewController: self delegate:self)
  } else {
    print("Ad wasn't ready")
  }
}

/// Tells the delegate that the rewarded ad was presented.
func rewardedAdDidPresent(_ rewardedAd: GADRewardedAd) {
  print("Rewarded ad presented.")
}
/// Tells the delegate that the rewarded ad was dismissed.
func rewardedAdDidDismiss(_ rewardedAd: GADRewardedAd) {
  print("Rewarded ad dismissed.")
}
/// Tells the delegate that the rewarded ad failed to present.
func rewardedAd(_ rewardedAd: GADRewardedAd, didFailToPresentWithError error: Error) {
  print("Rewarded ad failed to present with error: \(error.localizedDescription).")
}

উদ্দেশ্য-C

- (void)showRewardedAd: {
  ...
  if (self.rewardedAd.isReady) {
    [self.rewardedAd presentFromRootViewController:self delegate:self];
  } else {
    NSLog(@"Ad wasn't ready");
  }
}

/// Tells the delegate that the rewarded ad was presented.
- (void)rewardedAdDidPresent:(GADRewardedAd *)rewardedAd {
  NSLog(@"Rewarded ad presented.");
}

/// Tells the delegate that the rewarded ad failed to present.
- (void)rewardedAd:(GADRewardedAd *)rewardedAd didFailToPresentWithError:(NSError *)error {
  NSLog(@"Rewarded ad failed to present with error: %@",
        [error localizedDescription]);
}

/// Tells the delegate that the rewarded ad was dismissed.
- (void)rewardedAdDidDismiss:(GADRewardedAd *)rewardedAd {
  NSLog(@"Rewarded ad dismissed.");
}

v8

সুইফট

override func viewDidLoad() {
  super.viewDidLoad()
  let request = GADRequest()
  GADRewardedAd.load(withAdUnitID: "ca-app-pub-8123415297019784/9501821136",
                          request: request, completionHandler: { (ad, error) in
                            if let error = error {
                              print(error.localizedDescription)
                              return
                            }
                            self.rewardedAd = ad
                            self.rewardedAd?.fullScreenContentDelegate = self
                          }
  )
}

/// Tells the delegate that the rewarded ad was presented.
func adDidPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
  print("Rewarded ad presented.")
}
/// Tells the delegate that the rewarded ad was dismissed.
func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) {
  print("Rewarded ad dismissed.")
}
/// Tells the delegate that the rewarded ad failed to present.
func ad(_ ad: GADFullScreenPresentingAd,
    didFailToPresentFullScreenContentWithError error: Error) {
  print("Rewarded ad failed to present with error: \(error.localizedDescription).")
}

উদ্দেশ্য-C

- (void)viewDidLoad {
  [super viewDidLoad];

  GADRequest *request = [GADRequest request];
  [GADRewardedAd loadWithAdUnitID:@"ca-app-pub-3940256099942544/1712485313"
                          request:request
                completionHandler:^(GADRewardedAd *ad, NSError *error) {
    if (error) {
      NSLog(@"Rewarded ad failed to load with error: %@", [error localizedDescription]);
      return;
    }
    self.rewardedAd = ad;
    NSLog(@"Rewarded ad loaded.");
    self.rewardedAd.fullScreenContentDelegate = self;
}

/// Tells the delegate that the rewarded ad was presented.
- (void)adDidPresentFullScreenContent:(id)ad {
  NSLog(@"Rewarded ad presented.");
}

/// Tells the delegate that the rewarded ad failed to present.
- (void)ad:(id)ad
    didFailToPresentFullScreenContentWithError:(NSError *)error {
  NSLog(@"Rewarded ad failed to present with error: %@",
       [error localizedDescription]);
}

/// Tells the delegate that the rewarded ad was dismissed.
- (void)adDidDismissFullScreenContent:(id)ad {
  NSLog(@"Rewarded ad dismissed.");
}

লিগ্যাসি GADRewardedBasedVideoAd API অপসারণ

নতুন GADRewardedAd API প্রথম প্রবর্তিত হয়েছিল মার্চ 2019 এ এবং এটি 18 মাসেরও বেশি সময় ধরে পছন্দের পুরস্কৃত API। লিগ্যাসি GADRewardedBasedVideoAd API-এর তুলনায় এটিতে আরও উন্নতি হয়েছে, যার মধ্যে এক সময়ে একাধিক পুরস্কৃত বিজ্ঞাপন লোড করার ক্ষমতা রয়েছে৷

লিগ্যাসি GADRewardedBasedVideoAd API SDK সংস্করণ 8.0.0 থেকে সরানো হয়েছে৷

অভিযোজিত ব্যানারের পক্ষে স্মার্ট ব্যানার অবচয়

স্মার্ট ব্যানার বিজ্ঞাপনগুলি অভিযোজিত ব্যানার বিজ্ঞাপনের পক্ষে অবহেলিত। অভিযোজিত ব্যানারগুলি বিজ্ঞাপনের প্রস্থ নির্ধারণে উচ্চতর কর্মক্ষমতা এবং আরও নমনীয়তা প্রদান করে। আপনি যদি পূর্ণ-প্রস্থ ব্যানার ব্যবহার চালিয়ে যেতে পছন্দ করেন, তবে এটি এখনও অভিযোজিত ব্যানার ব্যবহার করে করা যেতে পারে, যেমনটি নিম্নলিখিত কোড স্নিপেটে দেখানো হয়েছে:

সুইফট

class ViewController: UIViewController {

  override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    // Note: The safe area is not known until viewWillAppear.
    let adSize = getFullWidthAdaptiveAdSize()
  }

  func getFullWidthAdaptiveAdSize() -> GADAdSize {
    // Here safe area is taken into account, hence the view frame is used after the
    // view has been laid out.
    let frame = { () -> CGRect in
      if #available(iOS 11.0, *) {
        return view.frame.inset(by: view.safeAreaInsets)
      } else {
        return view.frame
      }
    }()
    return GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(frame.size.width)
  }
}

উদ্দেশ্য-C

@implementation ViewController

- (void)viewDidAppear:(BOOL)animated {
  [super viewDidAppear:animated];
  // Note: The safe area is not known until viewWillAppear.
  GADAdSize adSize = [self getFullWidthAdaptiveAdSize];
}

- (GADAdSize)getFullWidthAdaptiveAdSize {
  CGRect frame = self.view.frame;
  // Here safe area is taken into account, hence the view frame is used after
  // the view has been laid out.
  if (@available(iOS 11.0, *)) {
    frame = UIEdgeInsetsInsetRect(self.view.frame, self.view.safeAreaInsets);
  }
  return GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(frame.size.width);
}

@end

অ্যাপ্লিকেশন কলব্যাক অপসারণ ছেড়ে দিন

সমস্ত বিজ্ঞাপন বিন্যাসের জন্য willLeaveApplication কলব্যাকটি applicationDidEnterBackground: এবং sceneDidEnterBackground: পদ্ধতির পক্ষে সরানো হয়েছে। OS-স্তরের APIs ব্যবহার করে ব্যবহারকারীরা যখনই আপনার অ্যাপটি ছেড়ে চলে যান তখন আপনাকে অবহিত করে, এটি বিজ্ঞাপনের ইন্টারঅ্যাকশনের কারণে হোক বা না হোক।

মনে রাখবেন যে willLeaveApplication কলব্যাক কখনই একটি বিজ্ঞাপন ক্লিক হ্যান্ডলার হওয়ার উদ্দেশ্যে ছিল না, এবং ক্লিক রিপোর্ট করার জন্য এই কলব্যাকের উপর নির্ভর করা একটি সঠিক মেট্রিক তৈরি করেনি। উদাহরণস্বরূপ, একটি বহিরাগত ব্রাউজার চালু করা AdChoices আইকনে একটি ক্লিক কলব্যাককে আহ্বান করেছে কিন্তু একটি ক্লিক গণনা করেনি।

ক্লাসের নাম পরিবর্তন করুন

নীচের সারণীতে নির্দিষ্ট শ্রেণীর নাম তালিকাভুক্ত করা হয়েছে যেগুলি 8 সংস্করণে পরিবর্তিত হয়েছে বা সরানো হয়েছে। সংক্ষেপে:

  • GADUnifiedNativeAd সম্পর্কিত সমস্ত ক্লাসের নাম পরিবর্তন করে GADNativeAd করা হয়েছে।
  • GADRewardBasedVideoAd , GADNativeExpressAdView , এবং GADInstreamAd সরানো হয়েছে৷
  • DFP প্রিফিক্স সহ সমস্ত ক্লাস একটি GAM উপসর্গ দিয়ে প্রতিস্থাপিত হয়েছে৷
v7.68.0 ক্লাস v8.0.0 ক্লাস
DFPBannerView গ্যামব্যানারভিউ
DFPBannerViewOptions GAMBannerViewOptions
DFPI ইন্টারস্টিশিয়াল GAInterstitialAd
DFPrequest GAMR অনুরোধ
GADRequestError NSError
GADUnifiedNativeAdView GADNativeAdView
GADUnifiedNativeAd GADNative Ad
GADUnifiedNativeAdAssetIdentifiers GADNativeAdAssetIdentifiers
GADUnifiedNativeAdDelegate GADNativeAdDelegate
GADUnifiedNativeAdUnconfirmedClickDelegate GADNativeAdUnconfirmedClickDelegate
GADNativeCustomTemplateAd GADC CustomNativeAd
GADNativeCustomTemplateAdLoaderDelegate GADCustomNativeAdLoaderDelegate
GADNativeAdDelegate GADCustomNativeAdDelegate
GADINAppPurchase সরানো হয়েছে
GADInterstitial GADInterstitialAd
GADNativeExpressAdView সরানো হয়েছে
GADReward-ভিত্তিক ভিডিও বিজ্ঞাপন সরানো হয়েছে
GADInstreamAd সরানো হয়েছে
GADInstreamAdView সরানো হয়েছে

পদ্ধতি সরানো/প্রতিস্থাপিত

নীচের সারণীটি সংস্করণ 8-এ নির্দিষ্ট পরিবর্তনগুলি তালিকাভুক্ত করে। সংক্ষেপে:

  • পূর্বে অপ্রচলিত পদ্ধতি এবং বৈশিষ্ট্যগুলি সরানো হয়েছে৷
  • -willLeaveApplication: সমস্ত ফরম্যাটের জন্য প্রতিনিধি পদ্ধতি মুছে ফেলা হয়েছে।
  • বিজ্ঞাপন নেটওয়ার্ক শ্রেণীর নামটি GADResponseInfo সম্পত্তিতে স্থানান্তরিত হয়েছে।
  • পরীক্ষা ডিভাইস শনাক্তকারী GADRequestConfiguration বৈশিষ্ট্যে সরানো হয়েছে।
v7.68.0 ক্লাস v7.68.0 API v8.0.0 API নোট
GADMmobileAds +configureWithApplicationID: -startWithCompletionHandler: অ্যাপ আইডি এখন Info.plist এ সেট করা আছে।
+অটোমেটেডইন অ্যাপ ক্রয় প্রতিবেদন অক্ষম করুন -অটোমেটেডইন অ্যাপ ক্রয় প্রতিবেদন অক্ষম করুন
+SDKCrashReporting অক্ষম করুন -SDKCrashReporting অক্ষম করুন
GADRequest টেস্ট ডিভাইস GADRequest Configuration .testdeviceidentifiers testDeviceIdentifiers প্রপার্টি সমস্ত বিজ্ঞাপনের অনুরোধে প্রযোজ্য, যখন পুরানো testDevices প্রপার্টি প্রতি অনুরোধে সেট করা হয়েছিল।
লিঙ্গ সরানো হয়েছে
জন্মদিন সরানো হয়েছে
+sdk সংস্করণ GADMobileAds.sharedInstance .sdkVersion
-মাস:দিন:বছরের সাথে জন্মদিন সেট করুন: সরানো হয়েছে
-SetLocationWithDescription: -অক্ষাংশের সাথে অবস্থান: দ্রাঘিমাংশ: নির্ভুলতা:
-tagForChildDirected Treatment: [GADMobileAds.sharedInstance.requestConfiguration tagForChildDirectedTreatment]
GADERrorCode kGADERত্রুটি* GADERত্রুটি* k উপসর্গটি সমস্ত ত্রুটি কোড ধ্রুবক থেকে বাদ দেওয়া হয়েছে।
GADBannerView অটোরিফ্রেশ হয়েছে স্বয়ংক্রিয় লোড সক্ষম
inAppPurchaseDelegate সরানো হয়েছে
mediatedAdView সরানো হয়েছে
adNetworkClassName প্রতিক্রিয়া তথ্য .adNetworkClassName
DFPBannerView -SetValidAdSizesWithSizes: -সেট ValidAdSizes:
DFPBannerViewOptions -adSizeDelegate সরানো হয়েছে
GADBannerViewDelegate -adViewDidReceiveAd: -bannerViewDidReceiveAd:
-adView:didFailToReceive AdWithError: -bannerView:didFailToReceive AdWithError:
-adViewWillPresentScreen: -ব্যানারভিউ উইলপ্রেজেন্টস্ক্রিন:
-adViewWillDismissScreen: -ব্যানারভিউ উইল ডিসমিস স্ক্রিন:
-adViewDidDismissScreen: -bannerViewDidDismissScreen:
-adViewWillLeave অ্যাপ্লিকেশন: সরানো হয়েছে
GADNativeCustomTemplateAd টেমপ্লেট আইডি GADCustomNativeAd.formatID
-performClickOnAssetWithKey: customClickHandler: -performClickOnAssetWithKey:
GADNativeAdImageAd লোডার অপশন পছন্দের ইমেজ ওরিয়েন্টেশন GADNativeAdMediaAdOptions .mediaAspectRatio
GADInterstitial inAppPurchaseDelegate সরানো হয়েছে
প্রস্তুত সরানো হয়েছে এর পরিবর্তে canPresentFrom RootViewController:error: ব্যবহার করুন।
ব্যবহার করা হয়েছে সরানো হয়েছে
-init -initWithAdUnitID:
-setAdUnitID: -initWithAdUnitID:
adNetworkClassName প্রতিক্রিয়া তথ্য .adNetworkClassName
-ইন্টারস্টিশিয়াল ছাড়বে আবেদন: সরানো হয়েছে
GADUnifiedNativeAd ভিডিও কন্ট্রোলার mediaContent.videoController
adNetworkClassName প্রতিক্রিয়া তথ্য .adNetworkClassName