GADMobileAds ক্লাসটি Google Mobile Ads SDK দ্বারা সংগৃহীত নির্দিষ্ট কিছু তথ্য নিয়ন্ত্রণের জন্য গ্লোবাল সেটিংস প্রদান করে।
ভিডিও বিজ্ঞাপনের ভলিউম নিয়ন্ত্রণ
আপনার অ্যাপে যদি নিজস্ব ভলিউম কন্ট্রোল থাকে, যেমন কাস্টম মিউজিক বা সাউন্ড ইফেক্টের ভলিউম, তাহলে Google Mobile Ads SDK কে অ্যাপের ভলিউমের তথ্য জানালে ভিডিও বিজ্ঞাপনগুলো অ্যাপের ভলিউম সেটিংস মেনে চলে। এর ফলে ব্যবহারকারীরা প্রত্যাশিত অডিও ভলিউমে ভিডিও বিজ্ঞাপনগুলো পান।
The device volume, controlled through volume buttons or OS-level volume slider, determines the volume for device audio output. However, apps can independently adjust volume levels relative to the device volume to tailor the audio experience.
For App Open, Banner, Interstitial, Rewarded, and Rewarded Interstitial ad formats you can report the relative app volume to Google Mobile Ads SDK by setting the applicationVolume property. Valid ad volume values range from 0.0 (silent) to 1.0 (current device volume). Here's an example of how to report the relative app volume to the SDK:
সুইফট
func viewDidLoad() {
super.viewDidLoad()
// Set app volume to be half of the current device volume.
MobileAds.shared.applicationVolume = 0.5
...
}
উদ্দেশ্য-সি
- (void)viewDidLoad {
[super viewDidLoad];
// Set app volume to be half of the current device volume.
GADMobileAds.sharedInstance.applicationVolume = 0.5;
...
}
For App Open, Banner, Interstitial, Rewarded, and Rewarded Interstitial ad formats, you can inform Google Mobile Ads SDK that the app volume has been muted by setting the applicationMuted property:
সুইফট
MobileAds.shared.applicationMuted = true
উদ্দেশ্য-সি
GADMobileAds.sharedInstance.applicationMuted = YES;
ডিফল্টরূপে, applicationVolume মান 1 (বর্তমান ডিভাইস ভলিউম) এবং applicationMuted মান NO সেট করা থাকে।
স্থানীয় বিজ্ঞাপন
মিউট সেটিংস নিয়ন্ত্রণ করার নির্দেশাবলীর জন্য GADVideoOptions দেখুন। নেটিভ বিজ্ঞাপনের জন্য কাস্টম ভলিউম নিয়ন্ত্রণের সুবিধা নেই।
অডিও সেশন
Audio sessions let you express to the system your intentions for your app's audio behavior. Additional information on audio sessions can be found in Apple's Audio Session Programming Guide . The available options for managing Google Mobile Ads SDK audio is through the audioVideoManager property.
If you don't use audio in your app, you don't need to use these APIs. Google Mobile Ads SDK automatically manages the audio session category when it plays audio. If you do play audio in your app and you want tighter control of how and when Google Mobile Ads SDK plays audio, you can make use of these APIs.
অডিও ভিডিও ম্যানেজারে, আপনি যদি অডিও সেশন ক্যাটাগরি পরিচালনার দায়িত্ব নিজে নিতে চান, তাহলে audioSessionIsApplicationManaged প্রপার্টিটি YES এ সেট করতে পারেন।
If you want to manage the audio session category, you can implement GADAudioVideoManagerDelegate and set the delegate property on the audio video manager to be notified of ads video and audio playback events. You should then change the audio session category to the relevant category according to Apple's Audio Session Programming Guide .
আপনার অ্যাপটি যদি উপরের API-গুলো ব্যবহার করে গান বাজায়, তবে প্রস্তাবিত পদ্ধতিটি দেখানোর জন্য এখানে একটি সরলীকৃত কোড নমুনা দেওয়া হলো:
সুইফট
func setUp() {
MobileAds.shared.audioVideoManager.delegate = self
MobileAds.shared.audioVideoManager.audioSessionIsApplicationManaged = false
}
// MARK: - GADAudioVideoManagerDelegate
func audioVideoManagerWillPlayAudio(_ audioVideoManager: GADAudioVideoManager) {
// The Google Mobile Ads SDK is notifying your app that it will play audio. You
// could optionally pause music depending on your apps design.
MyAppObject.shared.pauseAllMusic()
}
func audioVideoManagerDidStopPlayingAudio(_ audioVideoManager: GADAudioVideoManager) {
// The Google Mobile Ads SDK is notifying your app that it has stopped playing
// audio. Depending on your design, you could resume music here.
MyAppObject.shared.resumeAllMusic()
}
উদ্দেশ্য-সি
- (void)setUp {
GADMobileAds.sharedInstance.audioVideoManager.delegate = self;
GADMobileAds.sharedInstance.audioVideoManager.audioSessionIsApplicationManaged = NO;
}
#pragma mark - GADAudioVideoManagerDelegate
- (void)audioVideoManagerWillPlayAudio:(GADAudioVideoManager *)audioVideoManager {
// Google Mobile Ads SDK is notifying your app that it will play audio. You
// could optionally pause music depending on your apps design.
[MyAppObject.sharedInstance pauseAllMusic];
}
- (void)audioVideoManagerDidStopPlayingAudio:(GADAudioVideoManager *)audioVideoManager {
// Google Mobile Ads SDK is notifying your app that it has stopped playing
// audio. Depending on your design, you could resume music here.
[MyAppObject.sharedInstance resumeAllMusic];
}
দুর্ঘটনা প্রতিবেদন
Google Mobile Ads SDK একটি আইওএস অ্যাপে ঘটা ব্যতিক্রমগুলো পরীক্ষা করে এবং এসডিকে-র কারণে ঘটলে সেগুলো রেকর্ড করে রাখে। এরপর এসডিকে-র পরবর্তী সংস্করণগুলোতে এই ব্যতিক্রমগুলোর সমাধান করা হয়।
Crash reporting is enabled by default. If you don't want SDK-related exceptions to be recorded, you can disable this feature by calling the disableSDKCrashReporting method. The best time to call this method is when the app launches:
সুইফট
import GoogleMobileAds
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
MobileAds.shared.disableSDKCrashReporting()
return true
}
}
উদ্দেশ্য-সি
@import GoogleMobileAds;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GADMobileAds disableSDKCrashReporting];
return YES;
}
@end
কুকি সেটিংসের জন্য সম্মতি
If your app has special requirements, you can set the optional NSUserDefaults gad_has_consent_for_cookies . Google Mobile Ads SDK enables limited ads (LTD) if the gad_has_consent_for_cookies preference is set to zero.
সুইফট
UserDefaults.standard.set(0, forKey: "gad_has_consent_for_cookies")
উদ্দেশ্য-সি
NSUserDefaults.standardUserDefaults().setObject(Int(0),
forKey: "gad_has_consent_for_cookies");