গুগল ইউজার মেসেজিং প্ল্যাটফর্ম (UMP) SDK হল একটি গোপনীয়তা এবং বার্তাপ্রেরণ সরঞ্জাম যা আপনাকে গোপনীয়তা পছন্দগুলি পরিচালনা করতে সহায়তা করে। আরও তথ্যের জন্য, গোপনীয়তা এবং বার্তাপ্রেরণ সম্পর্কে দেখুন।
একটি বার্তার ধরণ তৈরি করুন
Create user messages with one of the Available user message types under the Privacy & messaging tab of your AdMob account. The UMP SDK attempts to display a privacy message created from the AdMob Application ID set in your project.
আরও বিস্তারিত জানার জন্য, গোপনীয়তা এবং বার্তাপ্রেরণ সম্পর্কে দেখুন।
ব্যবহারকারীর সম্মতির তথ্য পান
প্রতিটি অ্যাপ লঞ্চের সময় requestConsentInfoUpdate() ব্যবহার করে ব্যবহারকারীর সম্মতি তথ্য আপডেট করার অনুরোধ করা উচিত। এই অনুরোধটি নিম্নলিখিতগুলি পরীক্ষা করে:
- সম্মতি প্রয়োজন কিনা । উদাহরণস্বরূপ, প্রথমবারের জন্য সম্মতি প্রয়োজন, অথবা পূর্ববর্তী সম্মতির সিদ্ধান্তের মেয়াদ শেষ হয়ে গেছে।
- গোপনীয়তা বিকল্পের প্রবেশ বিন্দু প্রয়োজন কিনা । কিছু গোপনীয়তা বার্তার জন্য অ্যাপগুলিকে ব্যবহারকারীদের যেকোনো সময় তাদের গোপনীয়তা বিকল্পগুলি পরিবর্তন করার অনুমতি দিতে হয়।
@override
void initState() {
super.initState();
// Create a ConsentRequestParameters object.
final params = ConsentRequestParameters();
// Request an update to consent information on every app launch.
ConsentInformation.instance.requestConsentInfoUpdate(
params,
() async {
// Called when consent information is successfully updated.
},
(FormError error) {
// Called when there's an error updating consent information.
},
);
}
গোপনীয়তা বার্তা ফর্মটি লোড করুন এবং উপস্থাপন করুন
After you have received the most up-to-date consent status, call loadAndShowConsentFormIfRequired() to load any forms required to collect user consent. After loading, the forms present immediately.
@override
void initState() {
super.initState();
// Create a ConsentRequestParameters object.
final params = ConsentRequestParameters();
// Request an update to consent information on every app launch.
ConsentInformation.instance.requestConsentInfoUpdate(
params,
() async {
ConsentForm.loadAndShowConsentFormIfRequired((loadAndShowError) {
if (loadAndShowError != null) {
// Consent gathering failed.
}
// Consent has been gathered.
});
},
(FormError error) {
// Handle the error.
},
);
}
গোপনীয়তার বিকল্পগুলি
Some privacy message forms are presented from a publisher-rendered privacy options entry point, letting users manage their privacy options at any time. To learn more about which message your users see at the privacy options entry point, see Available user message types .
গোপনীয়তা বিকল্পের প্রবেশ বিন্দু প্রয়োজন কিনা তা পরীক্ষা করুন
requestConsentInfoUpdate() কল করার পর, আপনার অ্যাপের জন্য একটি গোপনীয়তা বিকল্প এন্ট্রি পয়েন্ট প্রয়োজন কিনা তা নির্ধারণ করতে getPrivacyOptionsRequirementStatus() চেক করুন। যদি একটি এন্ট্রি পয়েন্ট প্রয়োজন হয়, তাহলে আপনার অ্যাপে একটি দৃশ্যমান এবং ইন্টারঅ্যাক্টেবল UI উপাদান যোগ করুন যা গোপনীয়তা বিকল্প ফর্ম উপস্থাপন করে। যদি একটি গোপনীয়তা এন্ট্রি পয়েন্ট প্রয়োজন না হয়, তাহলে আপনার UI উপাদানটি দৃশ্যমান এবং ইন্টারঅ্যাক্টেবল নয় এমনভাবে কনফিগার করুন।
/// Helper variable to determine if the privacy options entry point is required.
Future<bool> isPrivacyOptionsRequired() async {
return await ConsentInformation.instance
.getPrivacyOptionsRequirementStatus() ==
PrivacyOptionsRequirementStatus.required;
}
গোপনীয়তা বিকল্পের প্রয়োজনীয়তার স্থিতির সম্পূর্ণ তালিকার জন্য, দেখুন।PrivacyOptionsRequirementStatus
গোপনীয়তা বিকল্প ফর্মটি উপস্থাপন করুন
যখন ব্যবহারকারী আপনার উপাদানের সাথে ইন্টারঅ্যাক্ট করে, তখন গোপনীয়তা বিকল্প ফর্মটি উপস্থাপন করুন:
ConsentForm.showPrivacyOptionsForm((formError) {
if (formError != null) {
debugPrint("${formError.errorCode}: ${formError.message}");
}
});
ব্যবহারকারীর সম্মতিতে বিজ্ঞাপনের অনুরোধ করুন
বিজ্ঞাপনের অনুরোধ করার আগে, ব্যবহারকারীর কাছ থেকে সম্মতি পেয়েছেন কিনা তা পরীক্ষা করতে canRequestAds() ব্যবহার করুন:
await ConsentInformation.instance.canRequestAds()
সম্মতি সংগ্রহের সময় বিজ্ঞাপনের অনুরোধ করা যাবে কিনা তা পরীক্ষা করার জন্য নিম্নলিখিত স্থানগুলি তালিকাভুক্ত করা হল:
- বর্তমান অধিবেশনে UMP SDK সম্মতি সংগ্রহ করার পর।
-
requestConsentInfoUpdate()কল করার পরপরই। UMP SDK পূর্ববর্তী অ্যাপ সেশনে সম্মতি পেয়ে থাকতে পারে।
সম্মতি সংগ্রহের প্রক্রিয়া চলাকালীন যদি কোনও ত্রুটি দেখা দেয়, তাহলে বিজ্ঞাপনের অনুরোধ করতে পারবেন কিনা তা পরীক্ষা করে দেখুন। UMP SDK পূর্ববর্তী অ্যাপ সেশনের সম্মতির স্থিতি ব্যবহার করে।
অপ্রয়োজনীয় বিজ্ঞাপন অনুরোধের কাজ রোধ করুন
As you check canRequestAds() after gathering consent and after calling requestConsentInfoUpdate() , ensure your logic prevents redundant ad requests that might result in both checks returning true . For example, with a boolean variable.
পরীক্ষামূলক
If you want to test the integration in your app as you're developing, follow these steps to programmatically register your test device. Be sure to remove the code that sets these test device IDs before you release your app.
-
requestConsentInfoUpdate()কল করুন। লগ আউটপুটে নিচের উদাহরণের মতো একটি বার্তা আছে কিনা তা পরীক্ষা করুন, যা আপনার ডিভাইস আইডি এবং এটিকে পরীক্ষামূলক ডিভাইস হিসেবে কীভাবে যুক্ত করবেন তা দেখায়:
অ্যান্ড্রয়েড
Use new ConsentDebugSettings.Builder().addTestDeviceHashedId("33BE2250B43518CCDA7DE426D04EE231") to set this as a debug device.আইওএস
<UMP SDK>To enable debug mode for this device, set: UMPDebugSettings.testDeviceIdentifiers = @[2077ef9a63d2b398840261c8221a0c9b]আপনার ক্লিপবোর্ডে আপনার পরীক্ষামূলক ডিভাইস আইডি কপি করুন।
ConsentDebugSettings.testIdentifiersকল করতে আপনার কোড পরিবর্তন করুন এবং আপনার পরীক্ষামূলক ডিভাইস আইডিগুলির একটি তালিকা পাস করুন।ConsentDebugSettings debugSettings = ConsentDebugSettings( testIdentifiers: ["TEST-DEVICE-HASHED-ID"], ); ConsentRequestParameters params = ConsentRequestParameters(consentDebugSettings: debugSettings); ConsentInformation.instance.requestConsentInfoUpdate(params, () async { // ... };
জোর করে ভূগোল তৈরি করুন
The UMP SDK provides a way to test your app's behavior as though the device were located in various regions, such as the EEA or UK, using debugGeography . Note that debug settings only work on test devices.
ConsentDebugSettings debugSettings = ConsentDebugSettings(
debugGeography: DebugGeography.debugGeographyEea,
testIdentifiers: ["TEST-DEVICE-HASHED-ID"],
);
ConsentRequestParameters params =
ConsentRequestParameters(consentDebugSettings: debugSettings);
ConsentInformation.instance.requestConsentInfoUpdate(params, () async {
// ...
};
সম্মতির অবস্থা রিসেট করুন
When testing your app with the UMP SDK, you might find it helpful to reset the state of the SDK so that you can simulate a user's first install experience. The SDK provides the reset() method to do this.
ConsentInformation.instance.reset();
GitHub-এ উদাহরণ
এই পৃষ্ঠায় আমাদের Flutter উদাহরণগুলিতে UMP SDK ইন্টিগ্রেশনের একটি সম্পূর্ণ উদাহরণ দেখুন।