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

প্ল্যাটফর্ম বেছে নিন: iOS Unity Android (Legacy)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Swift-এর নামকরণ সংক্রান্ত সহায়তা

Swift API ডিজাইন নির্দেশিকা মেনে চলার জন্য ভার্সন 12.0.0-এ পরিবর্তন করা হয়েছে। এইসব পরিবর্তন শুধুমাত্র 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-তে করা পরিবর্তনগুলি নিম্নলিখিত সারণীতে তালিকাভুক্ত করা হয়েছে:

ভার্সন 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
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

ধ্রুবক

ভার্সন 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
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

ফাংশন

ধরন ভার্সন 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:)
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:-এর ভিউ কন্ট্রোলার প্যারামিটার নাল হতে পারে। শূন্য মান পাস করা হলে, ভিউ কন্ট্রোলার হায়ারার্কিতে সবচেয়ে উপরের ভিউ কন্ট্রোলার থেকে বিজ্ঞাপন দেখানো হয়।

সরিয়ে দেওয়া পদ্ধতি

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

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) কোনও রিপ্লেসমেন্ট নেই।
GADRequestConfiguration setSameAppKeyEnabled(_ enabled: Bool) এর পরিবর্তে setPublisherFirstPartyIDEnabled(_ enabled: Bool) ব্যবহার করুন।
tagForUnderAge(ofConsent underAgeOfConsent: Bool) পরিবর্তে, tagForUnderAgeOfConsent প্রপার্টি ব্যবহার করুন।
tag(forChildDirectedTreatment childDirectedTreatment: Bool) পরিবর্তে, tagForChildDirectedTreatment প্রপার্টি ব্যবহার করুন।

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

নিম্নলিখিত প্রপার্টি সরিয়ে দেওয়া হয়েছে।

v11.0.0 Class প্রপার্টি নোট
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-এর সমস্যা ম্যানেজ করার ক্ষেত্রে পরিবর্তন

11.0.0 ভার্সন থেকে শুরু করে, 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-এর প্রয়োজনীয়তা

GoogleAppMeasurement.xcframework এখন সব Ad Manager অ্যাপের জন্য প্রয়োজন। আপনি 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 হল 11.

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

স্ট্যাটাস বার কন্ট্রোল আরও কঠোরভাবে প্রয়োগ করা

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

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

adDidPresentFullScreenContent: পরিবর্তন করে adWillPresentFullScreenContent: করুন

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

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

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

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

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

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

এপিআই

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

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 আপডেট

ভার্সন 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.");
}

Legacy 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

ছুটির আবেদন সংক্রান্ত কলব্যাক সরিয়ে দেওয়া

applicationDidEnterBackground: এবং sceneDidEnterBackground: মেথডের জন্য সব বিজ্ঞাপন ফর্ম্যাটের willLeaveApplication কলব্যাক সরিয়ে দেওয়া হয়েছে। ব্যবহারকারীরা আপনার অ্যাপ ছেড়ে বেরিয়ে গেলে, OS-লেভেল API আপনাকে বিজ্ঞপ্তি পাঠায়। এটি বিজ্ঞাপন ইন্টার‍্যাকশনের কারণে হোক বা না হোক, এই বিজ্ঞপ্তি পাঠানো হয়।

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

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

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

  • GADUnifiedNativeAd সম্পর্কিত সব ক্লাসের নাম পরিবর্তন করে GADNativeAd করা হয়েছে।
  • GADRewardBasedVideoAd, GADNativeExpressAdView ও GADInstreamAd-কে সরিয়ে দেওয়া হয়েছে।
  • DFP প্রিফিক্স সহ সব ক্লাস GAM প্রিফিক্স দিয়ে পরিবর্তন করা হয়েছে।
v7.68.0 Class 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 Class 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