-
Notifications
You must be signed in to change notification settings - Fork 161
Will Xamarin.Google.iOS.UserMessagingPlatform be ever updated and documented? It has been almost 4 years since the last update. #628
Comments
Bing Chat provided me this answer of how use it, but I'm not sure it's workable. @mikeks would be a better tester than me. Thank you for clarifying your question. UserMessagingPlatform is a library that helps you display GDPR consent messages to your app users in the European Economic Area (EEA) or the UK¹. It is part of the Google Mobile Ads SDK and works with AdMob and other Google advertising products². To use UserMessagingPlatform in your iOS app, you need to follow these steps:
Here is an example of how to use UserMessagingPlatform in your iOS app: using Google.MobileAds;
using Google.MobileAds.Consent;
using UIKit;
namespace MyApp
{
public class AppDelegate : UIApplicationDelegate
{
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
// Initialize Google Mobile Ads SDK
MobileAds.SharedInstance.Start(null);
// Request consent information
ConsentInformation.SharedInstance.RequestConsentInfoUpdate(new string[] { "pub-0[1](https://cookieinformation.com/resources/blog/is-your-mobile-app-gdpr-compliant/)[2](https://www.appknox.com/resources/guides/make-your-mobile-app-compliant-to-gdpr)[3](https://support.google.com/admob/answer/10113207?hl=en)[4](https://stackoverflow.com/questions/50486708/how-to-add-gdpr-consent-dialog-in-app-and-gdpr-related-confusions)56789012345" }, (error) =>
{
if (error == null)
{
// Check user location
if (ConsentInformation.SharedInstance.IsRequestLocationInEeaOrUnknown)
{
// Load consent message
ConsentForm consentForm = new ConsentForm();
consentForm.Load((loadError) =>
{
if (loadError == null)
{
// Show consent message
consentForm.Show((dismissError, userPrefersAdFree) =>
{
if (dismissError == null)
{
// Handle user choice
switch (ConsentInformation.SharedInstance.ConsentStatus)
{
case ConsentStatus.NonPersonalized:
// Show non-personalized ads
break;
case ConsentStatus.Personalized:
// Show personalized ads
break;
default:
// No consent given, do not show ads
break;
}
}
});
}
});
}
}
});
return true;
}
}
} I hope this helps you with your app development. If you have any other questions, please feel free to ask. 😊 Source: Conversation with Bing, 9/18/2023 |
Hi @FANMixco, I have a .NET MAUI project running on .NET 7. I've implemented GDPR consent forms on Android using Xamarin.Google.UserMessagingPlatform, but have struggled to find anything for iOS. I tried to follow the guide above but "using Google.MobileAds.Consent;" returns: "The type or namespace name 'Consent' does not exist in the namespace 'Google.MobileAds' (are you missing an assembly reference?)" And as a result none of the code below that point works. I have the "Xamarin.Google.iOS.UserMessagingPlatform" nuget package installed. Do you have any idea where I'm going wrong? Or is the package just not compatible with .NET MAUI?. |
Hi @BenEastpoint, I'm the wrong candidate for your question. I don't develop for iOS. I opened the question since several people brought the same question to StackOverflow to my Android's example. I would say that as I raised in this ticket, the lib might be incompatible since as you could read in this question, the last time it was updated it was several years ago. You can check the contributors of this repo and asked them. |
I agree that Microsoft should provide bindings for this component. It's one of the core components for iOS developers and having them available would make the .NET iOS platform more attractive. To use it, you need to download the Objective-C package from here and copy the framework folders into the project. |
Any thoughts @rolfbjarne? I get frequent questions about this topic and I don't even own a mac. |
Do you know if this project is still alive @pjcollins? |
That's a question for our PM (CC @davidortinau) - or you could contact him at [email protected]. |
Thank you, @rolfbjarne. @tipa or @BenEastpoint, can you contact @davidortinau? This topic is outside my scope since I don't even own a mac. |
@tipa thanks for sharing your bindings, this is very useful. Looks like those are for .Net Maui. Working on converting them for Xamarin Forms as we are still running Forms in prod at this time. Maui is a work in progress on our side. Have you successfully ran them these bindings with Forms? |
No those bindings are not for Maui. I am using neither MAUI nor Forms, I am using "vanilla" .NET 8 for iOS |
Oh I see. Perfect, will try to figure out the Xamarin way from them then. Thanks again, this is a very good starting point. Will provide an update and contribute if we make it happen. |
Any comments @davidortinau? It seems the project is kind of death and no one is providing any input. If the project is dead, perhaps, it will be a good idea to achieve it or add some comments. Thanks. |
Any updates on this? It's very frustrating to deal with these kind of issues on a framework backed and supported by Microsoft. |
Did you consider reaching out by email to @davidortinau? I didn't and won't do it since it doesn't affect me. I'm not an iOS developer. |
I'd like to clarify that my intention is not to seek direct individual contact, but rather to direct attention to this GitHub issue and Microsoft. |
@alexmartinezm, I don't think that if you and the affected person don't contact @davidortinau directly, neither @microsoft nor his team will do anything about it, as it is not considered a major issue and only affects a few people. This is pretty obvious at this point. It's been almost 4 years since the last lib update and the drop of Visual Studio for Mac support just confirms Microsoft interest about iOS support. In my case, I'm unsubscribing from this topic. This is not my fight since I don't code for iOS. Good luck. |
I left a tweet in X if anyone else wants to give it a try: Here you have his direct X if anyone else dares to reach @davidortinau: |
Is there any update on this? |
Did you consider to tweet @davidortinau? |
The code from Bing Chat is outdated, but I was able to compile it with some changes. I didn't test it yet, I will update this when I test the code. Corrected code:
|
Hey @mjbond-msft, @Redth, @dalexsoto, do you know if this repo will be ever updated or is it a dead project? It seems almost 4 years since its last update and @davidortinau has never replied. If you plan to stop its development, perhaps, you can archive it and deprecate it to avoid more confusion. Thank you. |
Hey @mikeks, if you were able to fix the code, perhaps, you could provide the updated one here. It will be useful for everyone who codes for iOS (not my case). Thank you. |
Fellows, it seems the last time this library (Xamarin.Google.iOS.UserMessagingPlatform) was in 2020, and several Devs are facing issues. Also, there is no document of how to use it:
https://www.nuget.org/packages/Xamarin.Google.iOS.UserMessagingPlatform
You can see questions concerns in different places like here:
Currently, only the Android lib is being updated from time to time:
https://www.nuget.org/packages/Xamarin.Google.UserMessagingPlatform
Any additional thoughts, @mikeks?
The text was updated successfully, but these errors were encountered: