In my .NET8
MAUI
application, I have a few functions for every platform but most of the code is the same. I saw somewhere that I could do something like:
#if iOS
public async Task<string> Register(NSData rawToken)
{
var nativeToken = rawToken.ToPushTokenString();
#endif
#if ANDROID
public async Task<string> Register(string nativeToken)
{
#endif
// code
}
I tried but Visual Studio disagrees and gets me an error. Is there any particular configuration I have to change? How does this pre-processor command work?