SDK ভার্সন মাইগ্রেট করা

এই পৃষ্ঠায় iOS-এর জন্য Google Mobile Ads SDK-এর বর্তমান ও আগের ভার্সনের মাইগ্রেশন কভার করা হয়েছে। আমরা আশা করছি যে ফেব্রুয়ারি ২০২৬-এ ১৩.০.০ ভার্সন রিলিজ করা হবে।

v12 থেকে v13-এ মাইগ্রেট করুন

ন্যূনতম ডেপ্লয়মেন্ট টার্গেট বাড়ানো হয়েছে

iOS 13-এ ন্যূনতম ডেপ্লয়মেন্ট টার্গেট বাড়ানো হয়েছে।

অ্যাঙ্কর করা অ্যাডাপ্টিভ ব্যানার সাইজ API-তে পরিবর্তন

ভার্সন ১৩.০.০-এ আগে থেকে থাকা অ্যাঙ্কর করা অ্যাডাপ্টিভ ব্যানার সাইজ API-এর ব্যবহার বন্ধ করা হয়েছে এবং বড় অ্যাঙ্কর করা অ্যাডাপ্টিভ ব্যানার বিজ্ঞাপনের জন্য সাইজ API নিয়ে আসা হয়েছে। Google Mobile Ads SDK নতুন বড় অ্যাঙ্কর করা অ্যাডাপ্টিভ ব্যানার সাইজ API ব্যবহার করে ব্যানার বিজ্ঞাপনে ভিডিও ডিমান্ড পরিবেশন করতে পারে।

নিচের সারণীতে বন্ধ হয়ে যাওয়া সাইজিং API এবং সেগুলির পরিবর্তে কী ব্যবহার করা হবে তার বিবরণ দেওয়া হল:

v12 (বন্ধ করা হয়েছে) v13 (পরিবর্তন)
GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width) GADLargeAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width)
GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width) GADLargeLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width)
GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width) GADLargePortraitAnchoredAdaptiveBannerAdSizeWithWidth(CGFloat width)

Swift 6 কনকারেন্সি সংক্রান্ত সহায়তা চালিয়ে যাওয়া হয়েছে

ভার্সন 13.0.0-এ Swift 6-এর স্ট্রিক্ট কনকারেন্সির জন্য সহায়তা যোগ করা চালিয়ে যাওয়া হয়েছে।

neighboringContentURLStrings অ্যারের জন্য আরও কঠোর ধরনের এনফোর্সমেন্ট যোগ করা হয়েছে

ভার্সন 13.0.0 থেকে শুরু করে, Google Mobile Ads SDK একটি ব্যতিক্রম উত্থাপন করে যদি একটি অবজেক্ট যা String টাইপ নয় সেটি neighboringContentURLStrings অ্যারেতে শনাক্ত করা হয়।

v11 থেকে v12-এ মাইগ্রেট করুন

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

Xcode-এর ন্যূনতম কাজ করা ভার্সন বাড়িয়ে 16.0 করা হয়েছে।

Swift নেমিং সাপোর্ট

Swift API ডিজাইন নির্দেশিকা-তে নামকরণ সংক্রান্ত নিয়ম মেনে চলার জন্য ভার্সন ১২.০.০-তে পরিবর্তন করা হয়েছে। এইসব পরিবর্তন শুধুমাত্র Swift-এর উপর প্রভাব ফেলে। Objective-C API-এর নামে কোনও পরিবর্তন করা হয়নি।

ক্লাস প্রিফিক্স পরিবর্তন

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

  • সব ধরনের নামের থেকে GAD প্রিফিক্স সরিয়ে দেওয়া হয়েছে।
  • GAM প্রিফিক্সের নাম পরিবর্তন করে AdManager করা হয়েছে।
  • GADM প্রিফিক্সের নাম পরিবর্তন করে Mediation করা হয়েছে।

সমস্যার সমাধান করা

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

নামকরণ সংক্রান্ত বিরোধের সমাধান করুন

নামকরণ সংক্রান্ত বিরোধ সমাধান করতে, মডিউলের মাধ্যমে প্রদান করা নেমস্পেস ব্যবহার করুন। যেমন, GADRequest-এর নাম এখন Request। নিম্নলিখিত উদাহরণ নেমস্পেস Google Mobile Ads SDK Request ক্লাস:

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

Swift-এ করা পরিবর্তনের বিস্তারিত তালিকা

নিচের সারণীতে Swift API-তে করা পরিবর্তনগুলি তালিকাভুক্ত করা হয়েছে:

ভার্সন ১১ ভার্সন ১২
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
Ad Manager
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

ধ্রুবক

ভার্সন ১১ ভার্সন ১২
GADAdLoaderAdType.gamBanner AdLoaderAdType.adManagerBanner
GADAdSizeBanner AdSizeBanner
GADAdSizeFluid AdSizeFluid
GADAdSizeFullBanner AdSizeFullBanner
GADAdSizeInvalid AdSizeInvalid
GADAdSizeLargeBanner AdSizeLargeBanner
GADAdSizeLeaderboard AdSizeLeaderboard
GADAdSizeMediumRectangle AdSizeMediumRectangle
GADAdSizeSkyscraper AdSizeSkyscraper
GoogleMobileAdsVersionString GoogleMobileAdsVersion

প্রপার্টি

ধরন ভার্সন ১১ ভার্সন ১২
GADAdLoader loading isLoading
GADAudioVideoManager audioSessionApplicationManaged isAudioSessionApplicationManaged
GADBannerView autoloadEnabled isAutoloadEnabled
GADMobileAds sharedInstance shared
applicationMuted isApplicationMuted
GADMuteThisAdReason reasonDescription reason
GADNativeAd customMuteThisAdAvailable isCustomMuteThisAdAvailable
GADNativeAdCustomClickGestureOptions tapsAllowed areTapsAllowed
GADNativeAdImageAdLoaderOptions imageLoadingDisabled isImageLoadingDisabled
GADNativeMuteThisAdLoaderOptions customMuteThisAdRequested isCustomMuteThisAdRequested
GADNativeSignalRequest imageLoadingDisabled isImageLoadingDisabled
customMuteThisAdRequested isCustomMuteThisAdRequested
GADRequest neighboringContentURLStrings neighboringContentURLs
GADResponseInfo extrasDictionary extras
GADServerSideVerificationOptions customRewardString customRewardText
GADSignal signalString signal
GADSignalRequest neighboringContentURLStrings neighboringContentURLs
GADVideoController customControlsRequested areCustomControlsRequested
clickToExpandEnabled isClickToExpandEnabled
GADVideoOptions startMuted shouldStartMuted
customControlsRequested areCustomControlsRequested
clickToExpandRequested isClickToExpandRequested

ফাংশন

ধরন ভার্সন ১১ ভার্সন ১২
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:)
GADRewardedAd load(withAdResponseString:) load(with:)
load(withAdUnitID:request:completionHandler:) load(with:request:completionHandler:)
canPresent(fromRootViewController:) canPresent(from:)
present(fromRootViewController:userDidEarnRewardHandler:) present(from:userDidEarnRewardHandler:)
GADRewardedInterstitialAd 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:)
GADMediationInterstitialAd present(fromRootViewController:) present(from:)
GADMediationRewardedAd present(fromRootViewController:) present(from:)
GAMInterstitialAd load(withAdManagerAdUnitID:request:completionHandler:) load(with:request:completionHandler:)

কাস্টম টার্গেটিং প্যারামিটার সেট করা

বিজ্ঞাপনের অনুরোধে কাস্টম টার্গেটিং সেট করতে, customTargeting ব্যবহার করুন।

ভিডিও মিউট করার স্ট্যাটাস নিয়ন্ত্রণ করার জন্য API-তে পরিবর্তন

GADVideoController-এ isMuted প্রপার্টি এবং setMute: পদ্ধতি muted প্রপার্টি দিয়ে পরিবর্তন করা হয়েছে।

ইনলাইন অ্যাডাপ্টিভ বিজ্ঞাপনে পরিবর্তন

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

কাস্টম সার্চ বিজ্ঞাপন সরিয়ে দেওয়া হয়েছে

নিম্নলিখিত ক্লাসগুলি সরিয়ে দেওয়া হয়েছে এবং এর পরিবর্তে অন্য কোনও ক্লাস যোগ করা হয়নি:

  • GADDynamicHeightSearchBannerView
  • GADDynamicHeightSearchRequest
  • GADSearchBannerView

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

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

শ্রেণী নোট
GADErrorMediationNoFill এখন সমস্যা GADErrorNoFill হিসেবে রিটার্ন করা হয়।
GADErrorReceivedInvalidResponse GADErrorReceivedInvalidAdString দিয়ে পরিবর্তন করা হয়েছে।

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

GADSimulatorID কে সরানো হয়েছে। সিমুলেটর আগে থেকেই ডিফল্ট হিসেবে টেস্ট মোডে থাকে।

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

GADRequest-এ customTargeting ডিকশনারি এখন ভ্যালু টাইপ হিসেবে String-এর পরিবর্তে Any ব্যবহার করে। এটি আপনাকে API-তে নিউমেরিক ভ্যালু পাস করার সুবিধা দেয়।

অতিরিক্ত প্যারামিটারে পরিবর্তন

  • additionalParameters-এ কী পাস করার ফলে Ad Manager-এর বিজ্ঞাপনের অনুরোধে আর কাস্টম টার্গেটিং প্রয়োগ করা হয় না। কাস্টম টার্গেটিং প্রয়োগ করতে, কাস্টম টার্গেটিং দেখুন।

v10 থেকে v11-এ মাইগ্রেট করুন

ন্যূনতম ডেপ্লয়মেন্ট টার্গেট

ন্যূনতম ডেপ্লয়মেন্ট টার্গেট iOS 12-এ বাড়ানো হয়েছে।

Xcode-এর ন্যূনতম ভার্সন

Xcode-এর ন্যূনতম কাজ করে এমন ভার্সন বাড়িয়ে 15.1 করা হয়েছে।

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

Google Mobile Ads SDK ভার্সন 11.0.0 শুধুমাত্র iOS 13 এবং তার পরবর্তী ভার্সনে চলা ডিভাইসে বিজ্ঞাপন দেখায়।

GoogleAppMeasurement ডিপেন্ডেন্সি সরানো হয়েছে

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

ফুল-স্ক্রিন বিজ্ঞাপন উপস্থাপনায় পরিবর্তন

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

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

-canPresentFromRootViewController:error: এবং -presentFromRootViewController:-এ ভিউ কন্ট্রোলার প্যারামিটার নালেবেল। nil পাস করা হলে, ভিউ কন্ট্রোলার হায়ারার্কির সবচেয়ে উপরের ভিউ কন্ট্রোলার থেকে বিজ্ঞাপনটি উপস্থাপন করা হয়।

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

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

v11.0.0 Type পদ্ধতি নোট
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) কোনও পরিবর্তন করা হয়নি।
GADRequestConfiguration setSameAppKeyEnabled(_ enabled: Bool) পরিবর্তে setPublisherFirstPartyIDEnabled(_ enabled: Bool) ব্যবহার করুন।
tagForUnderAge(ofConsent underAgeOfConsent: Bool) পরিবর্তে tagForUnderAgeOfConsent প্রপার্টি ব্যবহার করুন।
tag(forChildDirectedTreatment childDirectedTreatment: Bool) পরিবর্তে tagForChildDirectedTreatment প্রপার্টি ব্যবহার করুন।

প্রপার্টি সরানো হয়েছে

নিম্নলিখিত প্রপার্টিগুলি সরানো হয়েছে।

v11.0.0 ক্লাস প্রপার্টি নোট
GADMediationAdConfiguration hasUserLocation কোনও পরিবর্তন করা হয়নি।
userLatitude
userLongitude
userLocationAccuracyInMeters
childDirectedTreatment পরিবর্তে GADMobileAds.sharedInstance.requestConfiguration.tagForChildDirectedTreatment ব্যবহার করুন।
GADResponseInfo adNetworkClassName পরিবর্তে loadedAdNetworkResponseInfo থেকে adNetworkClassName ব্যবহার করুন।

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

GADAdFormatUnknown সরিয়ে দেওয়া হয়েছে এবং এর পরিবর্তে কিছু যোগ করা হয়নি।

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

ভার্সন 11.0.0 sdkVersion সরিয়ে দেয়। Google Mobile Ads SDK ভার্সন লগ করতে, পরিবর্তে versionNumber ব্যবহার করুন।

ভার্সন 10.0.0

GADMobileAds.sharedInstance().sdkVersion

ভার্সন 11.0.0

GADGetStringFromVersionNumber(GADMobileAds.sharedInstance().versionNumber)

GADAdLoader-এর সমস্যা ম্যানেজ করার পদ্ধতিতে পরিবর্তন

ভার্সন ১১.০.০ থেকে শুরু করে, GADAdLoader বিজ্ঞাপনের অনুরোধ করে না যদি এর delegate অনুরোধ করা বিজ্ঞাপনের ধরনের ডেলিগেট প্রোটোকল মেনে না চলে। আগে, বিজ্ঞাপনের অনুরোধ করার পরে এটি ব্যর্থ হয়েছে।

টেস্টিংয়ের আচরণে পরিবর্তন

নিম্নলিখিত প্রপার্টি true রিটার্ন করলে, আপডেট করা শর্ত দেখানোর জন্য টেবিল দেখুন।

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

v9 থেকে v10-এ মাইগ্রেট করুন

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

Google Mobile Ads SDK ভার্সন 10.0.0 শুধুমাত্র iOS 12 এবং তার পরবর্তী ভার্সন চালানো ডিভাইসে বিজ্ঞাপন দেখায়।

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

Ad Manager অ্যাপ আইডির প্রয়োজনীয়তা

Ad Manager অ্যাপ আইডি এখন Info.plist-এ সব Ad Manager অ্যাপের জন্য প্রয়োজন এবং ca-app-pub-################~########## ফর্ম্যাট প্রয়োজন। আরও বিবরণের জন্য আপনার Info.plist আপডেট করুন দেখুন।

GoogleAppMeasurement.xcframework-এর প্রয়োজনীয়তা

সব Ad Manager অ্যাপের জন্য এখন GoogleAppMeasurement.xcframework প্রয়োজন। আপনি যদি Cocoapods বা Swift Package Manager-এর মাধ্যমে Google Mobile Ads SDK ইনস্টল করেন, তাহলে আপনাকে আর কোনও অতিরিক্ত অ্যাকশন নিতে হবে না। আপনি ম্যানুয়ালি ফ্রেমওয়ার্ক ইনস্টল করলে, আরও বিবরণের জন্য ম্যানুয়াল ডাউনলোড দেখুন।

বিটকোড সহ বিল্ডিং আর কাজ করে না

Google Mobile Ads SDK ইন্টিগ্রেট করতে আপনার মোবাইল অ্যাপে বিটকোড বন্ধ করতে হবে।

সরানো প্রকারগুলি

ধরন নোট
GADGender কোনও পরিবর্তন করা হয়নি।
GADMRewardBasedVideoAdNetworkAdapterProtocol নেটওয়ার্ক বেছে নিন বিকল্পে তালিকাভুক্ত সব পুরস্কার প্রদানকারী মিডিয়েশন অ্যাডাপ্টার এক বছরের বেশি সময় ধরে এই প্রোটোকল ব্যবহার করা বন্ধ করে দিয়েছে। মধ্যস্থতা ও কাস্টম ইভেন্টের জন্য GADMediationAdapter ব্যবহার করুন।
GADMRewardBasedVideoAdNetworkConnectorProtocol

প্রপার্টি সরানো হয়েছে

নিম্নলিখিত প্রপার্টিগুলি কোনও বিকল্প ছাড়াই সরিয়ে দেওয়া হয়েছে।

v10.0.0 ক্লাস প্রপার্টি
GADMediationAdRequest userBirthday
userGender
userHasLocation
userLatitude
userLongitude
userLocationAccuracyInMeters
userLocationDescription
GADCustomEventRequest userHasLocation
userLatitude
userLongitude
userLocationAccuracyInMeters
userLocationDescription

v8 থেকে v9-এ মাইগ্রেট করুন

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

iOS Google Mobile Ads SDK ভার্সন 9.0.0-এর জন্য iOS-এর ন্যূনতম ভার্সন হল iOS 11।

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

স্ট্যাটাস বার কন্ট্রোলের আরও কঠোর এনফোর্সমেন্ট

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

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

adDidPresentFullScreenContent: থেকে adWillPresentFullScreenContent:-এ নাম পরিবর্তন করুন

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

GADRequest-এ লোকেশন সেটিং API সরান

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

কাস্টম ইভেন্ট ইন্টারফেসের অবচিতি

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

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

এপিআই

নিচের সারণীতে কাস্টম ইভেন্ট API-এর সাথে সম্পর্কিত মিডিয়েশন অ্যাডাপ্টার API-এর তালিকা দেওয়া আছে যে API-গুলি 9.0.0 ভার্সন থেকে ব্যবহার করা শুরু করতে হবে।

v8 v9
GADCustomEventBanner
GADCustomEventInterstitial
GADCustomEventNativeAd
GADMediationAdapter GADMediationBannerAd
GADMediationInterstitialAd
GADMediationInterscrollerAd
GADMediationRewardedAd
GADMediationNativeAd
delegate GADMediationAdapter ক্লাসের প্রতিটি লোড ফাংশনের লোড সম্পূর্ণকরণ হ্যান্ডলারের মাধ্যমে ডেলিগেট ফেরত দেওয়া হয়
-init -init
-requestBannerAd:parameter:label:request: -loadBannerForAdConfiguration:completionHandler:
-requestInterstitialAdWithParameter:label:request: -loadInterstitialForAdConfiguration:completionHandler:
-requestNativeAdWithParameter:request:adTypes:options:rootViewController: -loadNativeAdForAdConfiguration:completionHandler:
প্রযোজ্য নয় -loadInterscrollerAdForAdConfiguration:completionHandler:
প্রযোজ্য নয় -loadRewardedAdForAdConfiguration: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
-customEventBannerWillPresentModal:
-customEventInterstitialWillPresentModal:
-willPresentFullScreenView
-customEventBannerWillDismissModal:
-customEventInterstitialWillDismissModal:
-willDismissFullScreenView
-customEventBannerDidDismissModal:
-customEventInterstitialDidDismissModal:
-didDismissFullScreenView
-customEventBannerWillLeaveApplication:
-customEventInterstitialWillLeaveApplication:
-willBackgroundApplication
viewControllerForPresentingModalView -[GADMediationBannerAd view]

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

পদ্ধতি, কনস্ট্যান্ট বা প্রপার্টিতে পরিবর্তন
kGAD-টি প্রিফিক্সড কনস্ট্যান্ট সরানো হয়েছে। GAD- প্রিফিক্সড কনস্ট্যান্ট ব্যবহার করুন।
GADAdNetworkResponseInfo credentials সরানো হয়েছে। পরিবর্তে adUnitMapping ব্যবহার করুন।
GAMRequest GAMRequest-এ kGAMSimulatorID বন্ধ করা হয়েছে। পরিবর্তে GADRequestConfiguration-এ GADSimulatorID ব্যবহার করুন।
GADCustomNativeAd GADCustomNativeAd-এ mediaView বন্ধ করা হয়েছে। পরিবর্তে mediaContent ব্যবহার করুন।
GoogleMobileAds-এ অ্যাপ-মধ্যস্থ কেনাকাটা সংক্রান্ত API GoogleMobileAds-এ inAppPurchase API সরানো হয়েছে।

v7 থেকে v8-এ মাইগ্রেট করুন

Google Mobile Ads SDK ভার্সন 8.0.0-এ কিছু বড় পরিবর্তন করা হয়েছে এবং কিছু API-এর নাম পরিবর্তন করা হয়েছে ও কিছু API সরিয়ে দেওয়া হয়েছে।

ফুল-স্ক্রিন ফর্ম্যাট API আপডেট

ভার্সন 8.0.0 থেকে শুরু করে, ইন্টারস্টিশিয়াল এবং পুরস্কার প্রদানকারী বিজ্ঞাপন আরও সামঞ্জস্যের জন্য একটি জেনেরিক ফুল স্ক্রিন বিজ্ঞাপন স্টাইল শেয়ার করে। এই নতুন ফুল-স্ক্রিন বিজ্ঞাপন API-এর সাথে ভার্সন ৭ ফুল-স্ক্রিন বিজ্ঞাপন API-এর দুটি প্রধান পার্থক্য রয়েছে:

  1. স্ট্যাটিক ক্লাস মেথড load.

    ফুল-স্ক্রিন বিজ্ঞাপন লোড করা/দেখানোর আগের পদ্ধতিটি নিচে উল্লেখ করা হল:

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

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

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

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

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

    ইভেন্টের প্রকার আগে থেকে থাকা API v8 API
    লোড ইভেন্ট GADInterstitialDelegate বা GADRewardedAdDelegate GAMInterstitialAdLoadCompletionHandler বা GADRewardedAdLoadCompletionHandler
    প্রেজেন্টেশন ইভেন্ট GADFullScreenContentDelegate

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

    ভার্সন ৮-এ, লোড ও প্রেজেন্টেশন ইভেন্ট আলাদা। আপনি এখন বিজ্ঞাপন লোড করার আগে একটি GADFullScreenContentDelegate সেট করার পরিবর্তে বিজ্ঞাপন দেখানোর আগে যেকোনও সময় এটি রেজিস্টার করতে পারবেন। বিজ্ঞাপন লোড ইভেন্ট, যা প্রতিটি ফর্ম্যাটের জন্য নির্দিষ্ট, লোড পদ্ধতিতে পাস করা একটি লোড সমাপ্তি হ্যান্ডলারে চলে যায়।

স্থান

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

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

v7

Swift

import GoogleMobileAds
import UIKit

class ViewController: UIViewController, GADInterstitialDelegate {

  var interstitial: DFPInterstitial!

  override func viewDidLoad() {
    super.viewDidLoad()
    interstitial = DFPInterstitial(adUnitID: "/21775744923/example/interstitial")
    interstitial.delegate = self
    let request = GAMRequest()
    interstitial.load(request)
  }

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

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

Objective-C

@import GoogleMobileAds;
@import UIKit;

@interface ViewController () 

@property(nonatomic, strong) DFPInterstitial *interstitial;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];
  self.interstitial = [[DFPInterstitial alloc]
      initWithAdUnitID:@"/21775744923/example/interstitial"];
  self.interstitial.delegate = self;
  GAMRequest *request = [GAMRequest request];
  [self.interstitial loadRequest:request];
}

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

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

v8

Swift

import GoogleMobileAds
import UIKit

class ViewController: UIViewController, GADFullScreenContentDelegate {

  var interstitial: GAMInterstitialAd?

  override func viewDidLoad() {
    super.viewDidLoad()
    let request = GAMRequest()
    GAMInterstitialAd.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
                      }
    )
  }
}

Objective-C

@import GoogleMobileAds;
@import UIKit;

@interface ViewController () 

@property(nonatomic, strong) GAMInterstitialAd *interstitial;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];
  GAMRequest *request = [GAMRequest request];
  [GAMInterstitialAd loadWithAdUnitID:@"/21775744923/example/interstitial"
                              request:request
                    completionHandler:^(GAMInterstitialAd *ad, NSError *error) {
    if (error) {
      NSLog(@"Failed to load interstitial ad with error: %@", [error localizedDescription]);
      return;
    }
    self.interstitial = ad;
    self.interstitial.fullScreenContentDelegate = self;
  }];
}

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

v7

Swift

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

Objective-C

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

v8

Swift

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

Objective-C

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

প্রেজেন্টেশন বিজ্ঞাপন ইভেন্ট

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

v7

Swift

override func viewDidLoad() {
  super.viewDidLoad()
  interstitial = DFPInterstitial(adUnitID: "/21775744923/example/interstitial")
  interstitial.delegate = self
  ...
}

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

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

/// Tells the delegate the interstitial had been animated off the screen.
func interstitialDidDismissScreen(_ ad: DFPInterstitial) {
  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: DFPInterstitial) {
  print("Interstitial ad will leave application.")
}

Objective-C

- (void)viewDidLoad {
  [super viewDidLoad];
  self.interstitial = [[DFPInterstitial alloc] initWithAdUnitID:"/21775744923/example/interstitial"];
  self.interstitial.delegate = self;
  ...
}

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

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

/// Tells the delegate the interstitial had been animated off the screen.
- (void)interstitialDidDismissScreen:(DFPInterstitial *)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:(DFPInterstitial *)ad {
  NSLog(@"Interstitial ad will leave application.");
}

v8

Swift

override func viewDidLoad() {
  super.viewDidLoad()
  let request = GAMRequest()
  GAMInterstitialAd.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.")
}

Objective-C

- (void)viewDidLoad {
  [super viewDidLoad];
  GAMRequest *request = [GAMRequest request];
  [GAMInterstitialAd loadWithAdUnitID:@"/21775744923/example/interstitial"
                              request:request
                    completionHandler:^(GAMInterstitialAd *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

Swift

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(GAMRequest()) { error in
      if let error = error {
        print("Rewarded ad failed to load with error: \(error.localizedDescription)")
      } else {
        print("Rewarded ad loaded.")
      }
    }
  }
}

Objective-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;
  GAMRequest *request = [GAMRequest 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

Swift

import GoogleMobileAds
import UIKit

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

  override func viewDidLoad() {
  super.viewDidLoad()
  let request = GAMRequest()
  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
                          }
  )
  }
}

Objective-C

@import GoogleMobileAds;
@import UIKit;

@interface ViewController () 

@property(nonatomic, strong) GADRewardedAd *rewardedAd;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  GAMRequest *request = [GAMRequest 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-এর ভার্সন ৭-এর মাধ্যমে, আপনি GADRewardedAdDelegate প্রোটোকলের অংশ হিসেবে rewardedAd:userDidEarnReward: প্রয়োগ করেন। ভার্সন ৮-এর জন্য, বিজ্ঞাপন দেখানোর উদ্দেশ্যে আপনি GADUserDidEarnRewardHandler প্রয়োগ করেন।

v7

Swift

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.
}

Objective-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

Swift

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")
  }
}

Objective-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

Swift

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).")
}

Objective-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

Swift

override func viewDidLoad() {
  super.viewDidLoad()
  let request = GAMRequest()
  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).")
}

Objective-C

- (void)viewDidLoad {
  [super viewDidLoad];

  GAMRequest *request = [GAMRequest 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 প্রথমবার ২০১৯ সালের মার্চ মাসে চালু করা হয় এবং ১৮ মাসের বেশি সময় ধরে এটিই পুরস্কার প্রদানকারী API হিসেবে ব্যবহার করা হচ্ছে। এটি পুরনো GADRewardedBasedVideoAd API-এর তুলনায় আরও উন্নত, যার মধ্যে রয়েছে একসাথে একাধিক পুরস্কার প্রদানকারী বিজ্ঞাপন লোড করার ক্ষমতা।

SDK ভার্সন 8.0.0 থেকে পুরনো GADRewardedBasedVideoAd API সরিয়ে দেওয়া হয়েছে।

অ্যাডাপ্টিভ ব্যানারের জন্য স্মার্ট ব্যানার বন্ধ করা

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

Swift

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)
  }
}

Objective-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-লেভেল API ব্যবহার করে, ব্যবহারকারী আপনার অ্যাপ থেকে বেরিয়ে গেলেই আপনাকে বিজ্ঞপ্তি পাঠানো হয়, সেটি বিজ্ঞাপনের সাথে ইন্টার‍্যাকশনের কারণে হোক বা না হোক।

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

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

নিচের সারণিতে নির্দিষ্ট ক্লাসের নাম তালিকাভুক্ত করা হয়েছে যা ভার্সন ৮-এ পরিবর্তন করা হয়েছে বা সরিয়ে দেওয়া হয়েছে। সংক্ষেপে:

  • GADUnifiedNativeAd-এর সাথে সম্পর্কিত সব ক্লাসের নাম পরিবর্তন করে GADNativeAd করা হয়েছে।
  • GADRewardBasedVideoAd, GADNativeExpressAdView এবং GADInstreamAd সরিয়ে দেওয়া হয়েছে।
  • DFP প্রিফিক্স সহ সব ক্লাস GAM প্রিফিক্স দিয়ে পরিবর্তন করা হয়েছে।
v7.68.0 ক্লাস v8.0.0 ক্লাস
DFPBannerView GAMBannerView
DFPBannerViewOptions GAMBannerViewOptions
DFPInterstitial GAMInterstitialAd
DFPRequest GAMRequest
GADRequestError NSError
GADUnifiedNativeAdView GADNativeAdView
GADUnifiedNativeAd GADNativeAd
GADUnifiedNativeAdAssetIdentifiers GADNativeAdAssetIdentifiers
GADUnifiedNativeAdDelegate GADNativeAdDelegate
GADUnifiedNativeAdUnconfirmedClickDelegate GADNativeAdUnconfirmedClickDelegate
GADNativeCustomTemplateAd GADCustomNativeAd
GADNativeCustomTemplateAdLoaderDelegate GADCustomNativeAdLoaderDelegate
GADNativeAdDelegate GADCustomNativeAdDelegate
GADInAppPurchase সরানো হয়েছে
GADInterstitial GADInterstitialAd
GADNativeExpressAdView সরানো হয়েছে
GADRewardBasedVideoAd সরানো হয়েছে
GADInstreamAd সরানো হয়েছে
GADInstreamAdView সরানো হয়েছে

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

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

  • আগে থেকে বন্ধ করা পদ্ধতি ও প্রপার্টি সরিয়ে দেওয়া হয়েছে।
  • সব ফর্ম্যাটের জন্য -willLeaveApplication: ডেলিগেট পদ্ধতি সরিয়ে দেওয়া হয়েছে।
  • বিজ্ঞাপন নেটওয়ার্ক ক্লাস নাম GADResponseInfo প্রপার্টিতে সরানো হয়েছে।
  • টেস্ট ডিভাইস শনাক্তকারী GADRequestConfiguration প্রপার্টিতে সরানো হয়েছে।
v7.68.0 ক্লাস v7.68.0 API v8.0.0 API নোট
GADMobileAds +configureWithApplicationID: -startWithCompletionHandler: অ্যাপ আইডি এখন Info.plist-এ সেট করা হয়েছে।
+disableAutomatedInAppPurchaseReporting -disableAutomatedInAppPurchaseReporting
+disableSDKCrashReporting -disableSDKCrashReporting
GADRequest testDevices GADRequestConfiguration.testdeviceidentifiers testDeviceIdentifiers প্রপার্টি সব বিজ্ঞাপনের অনুরোধের ক্ষেত্রে প্রযোজ্য, যেখানে পুরনো testDevices প্রপার্টি প্রতিটি অনুরোধের জন্য সেট করা হয়েছিল।
লিঙ্গগত পরিচয় সরানো হয়েছে
জন্মদিন সরানো হয়েছে
+sdkVersion GADMobileAds.sharedInstance.sdkVersion
-setBirthdayWithMonth:day:year: সরানো হয়েছে
-setLocationWithDescription: -setLocationWithLatitude:longitude:accuracy:
-tagForChildDirectedTreatment: [GADMobileAds.sharedInstance.requestConfiguration tagForChildDirectedTreatment]
GADErrorCode kGADError* GADError* সব ত্রুটি কোড কনস্ট্যান্ট থেকে k প্রিফিক্স বাদ দেওয়া হয়েছে।
GADBannerView hasAutoRefreshed autoloadEnabled
inAppPurchaseDelegate সরানো হয়েছে
mediatedAdView সরানো হয়েছে
adNetworkClassName responseInfo.adNetworkClassName
DFPBannerView -setValidAdSizesWithSizes: -setValidAdSizes:
DFPBannerViewOptions -adSizeDelegate সরানো হয়েছে
GADBannerViewDelegate -adViewDidReceiveAd: -bannerViewDidReceiveAd:
-adView:didFailToReceiveAdWithError: -bannerView:didFailToReceiveAdWithError:
-adViewWillPresentScreen: -bannerViewWillPresentScreen:
-adViewWillDismissScreen: -bannerViewWillDismissScreen:
-adViewDidDismissScreen: -bannerViewDidDismissScreen:
-adViewWillLeaveApplication: সরানো হয়েছে
GADNativeCustomTemplateAd templateID GADCustomNativeAd.formatID
-performClickOnAssetWithKey:customClickHandler: -performClickOnAssetWithKey:
GADNativeAdImageAdLoaderOptions preferredImageOrientation GADNativeAdMediaAdOptions.mediaAspectRatio
GADInterstitial inAppPurchaseDelegate সরানো হয়েছে
isReady সরানো হয়েছে পরিবর্তে canPresentFromRootViewController:error: ব্যবহার করুন।
hasBeenUsed সরানো হয়েছে
-init -initWithAdUnitID:
-setAdUnitID: -initWithAdUnitID:
adNetworkClassName responseInfo.adNetworkClassName
-interstitialWillLeaveApplication: সরানো হয়েছে
GADUnifiedNativeAd videoController mediaContent.videoController
adNetworkClassName responseInfo.adNetworkClassName