Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating all libraries and samples to .net8 #357

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ The new plugin version 1.2.0 now supports .NET MAUI applications with .NET 6
To get started add the `GoogleService-Info.plist` and the `google-services.json` files to the root folder of your project and include them in the .csproj file like this:

```xml
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<GoogleServicesJson Include="google-services.json" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<BundleResource Include="GoogleService-Info.plist" />
</ItemGroup>
```
Expand Down Expand Up @@ -104,22 +104,22 @@ Ensure the `ApplicationId` in your `.csproj` file matches the `bundle_id` and `p
The plugin doesn't support Windows or Mac catalyst, so either remove their targets from your `.csproj` file or use [preprocessor directives](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives#conditional-compilation) and [MSBuild conditions](https://learn.microsoft.com/de-de/visualstudio/msbuild/msbuild-conditions?view=vs-2022), e.g:

```xml
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios' OR '$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios' OR '$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Plugin.Firebase" Version="1.2.0" />
</ItemGroup>
```

### Android specifics
- For package versions prior to `Plugin.Firebase 2.0.7`, `Plugin.Firebase.Auth 2.0.5`, `Plugin.Firebase.Firestore 2.0.5`, `Plugin.Firebase.Functions 2.0.2` or `Plugin.Firebase.Storage 2.0.2` add the following `ItemGroup` to your `.csproj` file to prevent build errors:
```xml
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk7" Version="1.7.10" ExcludeAssets="build;buildTransitive" />
<PackageReference Include="Xamarin.Kotlin.StdLib.Jdk8" Version="1.7.10" ExcludeAssets="build;buildTransitive" />
</ItemGroup>
```
- For later versions add the following `ItemGroup` to your `.csproj` file to prevent build errors:
```xml
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.12.0.2" />
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.3.0.1" />
Expand Down
13 changes: 9 additions & 4 deletions sample/Playground/Playground.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0-android;net7.0-ios</TargetFrameworks>
<TargetFrameworks>net8.0-android;net8.0-ios</TargetFrameworks>
<RootNamespace>Playground</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<OutputType>Exe</OutputType>

<!-- Display name -->
<ApplicationTitle>Playground</ApplicationTitle>
Expand All @@ -20,8 +21,6 @@

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<TargetPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">33</TargetPlatformVersion>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand All @@ -32,6 +31,12 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>

<!-- localization -->
<ItemGroup>
<EmbeddedResource Update="Resources\Localization.resx">
Expand Down Expand Up @@ -92,7 +97,7 @@
</ItemGroup>

<!-- needed for android build to work -->
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-android|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android|AnyCPU'">
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/Analytics/Analytics.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios</TargetFrameworks>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

Expand Down Expand Up @@ -64,11 +64,11 @@
<Compile Include="Shared\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<Compile Include="Platforms\Android\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<Compile Include="Platforms\iOS\**\*.cs" />
</ItemGroup>

Expand All @@ -78,11 +78,11 @@
</ItemGroup>

<!-- nuget packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.Firebase.Analytics" Version="121.3.0.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="AdamE.Firebase.iOS.Analytics" Version="10.24.0" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/Auth.Facebook/Auth.Facebook.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios</TargetFrameworks>
<UseMauiEssentials>true</UseMauiEssentials>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down Expand Up @@ -65,11 +65,11 @@
<Compile Include="Shared\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<Compile Include="Platforms\Android\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<Compile Include="Platforms\iOS\**\*.cs" />
</ItemGroup>

Expand All @@ -80,11 +80,11 @@
</ItemGroup>

<!-- nuget packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.Facebook.Android" Version="11.2.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="Xamarin.Facebook.iOS" Version="12.2.0.1" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/Auth.Google/Auth.Google.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios</TargetFrameworks>
<UseMauiEssentials>true</UseMauiEssentials>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down Expand Up @@ -65,11 +65,11 @@
<Compile Include="Shared\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<Compile Include="Platforms\Android\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<Compile Include="Platforms\iOS\**\*.cs" />
</ItemGroup>

Expand All @@ -80,11 +80,11 @@
</ItemGroup>

<!-- nuget packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.GooglePlayServices.Auth" Version="120.2.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="Xamarin.Google.iOS.SignIn" Version="5.0.2.4" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/Auth/Auth.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios</TargetFrameworks>
<UseMauiEssentials>true</UseMauiEssentials>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down Expand Up @@ -65,11 +65,11 @@
<Compile Include="Shared\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<Compile Include="Platforms\Android\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<Compile Include="Platforms\iOS\**\*.cs" />
</ItemGroup>

Expand All @@ -79,11 +79,11 @@
</ItemGroup>

<!-- nuget packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.Firebase.Auth" Version="122.2.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="AdamE.Firebase.iOS.Auth" Version="10.24.0" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/Bundled/Bundled.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios</TargetFrameworks>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

Expand Down Expand Up @@ -64,11 +64,11 @@
<Compile Include="Shared\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<Compile Include="Platforms\Android\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<Compile Include="Platforms\iOS\**\*.cs" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/CloudMessaging/CloudMessaging.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios</TargetFrameworks>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

Expand Down Expand Up @@ -64,11 +64,11 @@
<Compile Include="Shared\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<Compile Include="Platforms\Android\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<Compile Include="Platforms\iOS\**\*.cs" />
</ItemGroup>

Expand All @@ -78,11 +78,11 @@
</ItemGroup>

<!-- nuget packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.Firebase.Messaging" Version="123.0.8" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="AdamE.Firebase.iOS.CloudMessaging" Version="10.24.0" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/Core/Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios</TargetFrameworks>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

Expand Down Expand Up @@ -62,20 +62,20 @@
<Compile Include="Shared\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<Compile Include="Platforms\Android\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<Compile Include="Platforms\iOS\**\*.cs" />
</ItemGroup>

<!-- nuget packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="AdamE.Firebase.iOS.Core" Version="10.24.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="GoogleGson" Version="2.9.1" />
<PackageReference Include="Xamarin.Firebase.Common" Version="120.1.2" />
</ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/Crashlytics/Crashlytics.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios</TargetFrameworks>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

Expand Down Expand Up @@ -64,11 +64,11 @@
<Compile Include="Shared\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<Compile Include="Platforms\Android\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<Compile Include="Platforms\iOS\**\*.cs" />
</ItemGroup>

Expand All @@ -78,11 +78,11 @@
</ItemGroup>

<!-- nuget packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.Firebase.Crashlytics" Version="118.3.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="AdamE.Firebase.iOS.Crashlytics" Version="10.24.0" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/DynamicLinks/DynamicLinks.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios</TargetFrameworks>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

Expand Down Expand Up @@ -64,20 +64,20 @@
<Compile Include="Shared\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<Compile Include="Platforms\Android\**\*.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<Compile Include="Platforms\iOS\**\*.cs" />
</ItemGroup>

<!-- nuget packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.Firebase.Dynamic.Links" Version="121.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-ios'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="AdamE.Firebase.iOS.DynamicLinks" Version="10.24.0-alpha1" />
</ItemGroup>

Expand Down
Loading