-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from xamplum/adaptToNewFirebasePlugins
Adapt to new firebase plugins
- Loading branch information
Showing
23 changed files
with
2,540 additions
and
19,538 deletions.
There are no files selected for viewing
19,553 changes: 76 additions & 19,477 deletions
19,553
sample/Sample.Android/Resources/Resource.designer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 72 additions & 56 deletions
128
sdk/Notifo.SDK.FirebasePlugin/Notifo.SDK.FirebasePlugin.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,75 @@ | ||
<Project Sdk="MSBuild.Sdk.Extras/3.0.22"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.1;xamarinios10;monoandroid12.0;</TargetFrameworks> | ||
<LangVersion>8.0</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<RootNamespace>Notifo.SDK.FirebasePlugin</RootNamespace> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="logo-squared.png" Pack="true" PackagePath="\" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<CodeAnalysisRuleSet>..\..\Notifo.ruleset</CodeAnalysisRuleSet> | ||
<AssemblyName>Notifo.Xamarin.FirebasePlugin</AssemblyName> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="**\*.netstandard.cs" /> | ||
<Compile Remove="**\*.android.cs" /> | ||
<Compile Remove="**\*.ios.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) "> | ||
<Compile Include="**\*.netstandard.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('xamarinios')) "> | ||
<Compile Include="**\*.ios.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('monoandroid')) "> | ||
<Compile Include="**\*.android.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" /> | ||
<PackageReference Include="Plugin.FirebasePushNotification" Version="3.4.22" /> | ||
<PackageReference Include="RefactoringEssentials" Version="5.6.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Notifo.SDK\Notifo.SDK.Core.csproj" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<TargetFrameworks>netstandard2.1;xamarinios10;monoandroid12.0;</TargetFrameworks> | ||
<LangVersion>8.0</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<RootNamespace>Notifo.SDK.FirebasePlugin</RootNamespace> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="logo-squared.png" Pack="true" PackagePath="\" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<CodeAnalysisRuleSet>..\..\Notifo.ruleset</CodeAnalysisRuleSet> | ||
<AssemblyName>Notifo.Xamarin.FirebasePlugin</AssemblyName> | ||
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="**\*.netstandard.cs" /> | ||
<Compile Remove="**\*.android.cs" /> | ||
<Compile Remove="**\*.ios.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) "> | ||
<Compile Include="**\*.netstandard.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('xamarinios')) "> | ||
<Compile Include="**\*.ios.cs" /> | ||
<PackageReference Include="Xamarin.Firebase.iOS.CloudMessaging" Version="8.10.0" /> | ||
<PackageReference Include="Xamarin.Firebase.iOS.Installations" Version="8.10.0" /> | ||
<PackageReference Include="Xamarin.Firebase.iOS.Core" Version="8.10.0" /> | ||
<PackageReference Include="Xamarin.Firebase.iOS.InstanceID" Version="4.8.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" $(TargetFramework.StartsWith('monoandroid')) "> | ||
<Compile Include="**\*.android.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" /> | ||
<PackageReference Include="RefactoringEssentials" Version="5.6.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Xamarin.Firebase.iOS.CloudMessaging" Version="8.10.0.1" /> | ||
<PackageReference Include="Xamarin.Firebase.iOS.Core" Version="8.10.0.1" /> | ||
<PackageReference Include="Xamarin.Firebase.iOS.Installations" Version="8.10.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Notifo.SDK\Notifo.SDK.Core.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'monoandroid12.0'"> | ||
<PackageReference Include="Xamarin.Firebase.Common"> | ||
<Version>120.0.0.5</Version> | ||
</PackageReference> | ||
<PackageReference Include="Xamarin.Firebase.Messaging"> | ||
<Version>122.0.0.5</Version> | ||
</PackageReference> | ||
</ItemGroup> | ||
</Project> |
56 changes: 56 additions & 0 deletions
56
...DK.FirebasePlugin/PluginFirebasePushNotifications/CrossFirebasePushNotification.shared.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
|
||
namespace Plugin.FirebasePushNotification | ||
{ | ||
/// <summary> | ||
/// Cross platform FirebasePushNotification implemenations | ||
/// </summary> | ||
public static class CrossFirebasePushNotification | ||
{ | ||
private static Lazy<IFirebasePushNotification> implementation = new Lazy<IFirebasePushNotification>(() => CreateFirebasePushNotification(), System.Threading.LazyThreadSafetyMode.PublicationOnly); | ||
|
||
/// <summary> | ||
/// Gets if the plugin is supported on the current platform. | ||
/// </summary> | ||
public static bool IsSupported => implementation.Value == null ? false : true; | ||
|
||
/// <summary> | ||
/// Current settings to use | ||
/// </summary> | ||
public static IFirebasePushNotification Current | ||
{ | ||
get | ||
{ | ||
var ret = implementation.Value; | ||
if (ret == null) | ||
{ | ||
throw NotImplementedInReferenceAssembly(); | ||
} | ||
return ret; | ||
} | ||
} | ||
|
||
#if ANDROID | ||
public static FirebasePushNotificationManager Android => (FirebasePushNotificationManager)Current; | ||
#elif IOS | ||
public static FirebasePushNotificationManager IOS => (FirebasePushNotificationManager)Current; | ||
#endif | ||
|
||
private static IFirebasePushNotification CreateFirebasePushNotification() | ||
{ | ||
|
||
#if NETSTANDARD1_0 || NETSTANDARD2_0 || NETSTANDARD2_1 | ||
return null; | ||
#else | ||
#pragma warning disable IDE0022 // Use expression body for methods | ||
return new FirebasePushNotificationManager(); | ||
#pragma warning restore IDE0022 // Use expression body for methods | ||
#endif | ||
} | ||
|
||
internal static Exception NotImplementedInReferenceAssembly() | ||
{ | ||
return new NotImplementedException("This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation."); | ||
} | ||
} | ||
} |
Oops, something went wrong.