Skip to content

Commit

Permalink
Merge pull request #19 from notifo-io/feature/versionOptimizations
Browse files Browse the repository at this point in the history
- add missing AndroidX package
- fix namespace 
- increased c# version to 9
- fixed missing default pullRefreshOptions
- don't await local notifications
  • Loading branch information
xamplum authored Jan 20, 2023
2 parents 68a0161 + a5c97a6 commit 3568e12
Show file tree
Hide file tree
Showing 10 changed files with 10,217 additions and 8,592 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<PackageProjectUrl>https://notifo.io</PackageProjectUrl>
<PackageTags>notifo xamarin firebase</PackageTags>
<Version>1.2.0-beta1</Version>
<LangVersion>7</LangVersion>
<LangVersion>9</LangVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion sample/Sample.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="io.notifo.xamarin.sample">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="31" />
<application android:label="Sample.Android" android:theme="@style/MainTheme"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
18,771 changes: 10,189 additions & 8,582 deletions sample/Sample.Android/Resources/Resource.designer.cs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions sample/Sample.Android/Sample.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@
<PackageReference Include="System.Numerics.Vectors">
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Wear">
<Version>1.2.0.7</Version>
</PackageReference>
<PackageReference Include="Xamarin.AndroidX.Work.Runtime">
<Version>2.7.1.5</Version>
</PackageReference>
<PackageReference Include="Xamarin.Firebase.Common">
<Version>120.0.0.5</Version>
</PackageReference>
Expand Down Expand Up @@ -132,6 +138,10 @@
<Project>{4f928a67-c5e7-44e2-be71-6ed155afed9c}</Project>
<Name>Notifo.SDK.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\sdk\Notifo.SDK.Worker\Notifo.SDK.Worker.csproj">
<Project>{938b1a56-1c33-40cb-8569-8625997945c8}</Project>
<Name>Notifo.SDK.Worker</Name>
</ProjectReference>
<ProjectReference Include="..\Sample\Sample.csproj">
<Project>{DD43F8B0-1925-477A-9FF5-BE3E01350E30}</Project>
<Name>Sample</Name>
Expand Down
2 changes: 1 addition & 1 deletion sample/Sample.iOS.Shared/Sample.iOS.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Notifo.SDK" Version="1.7.3" />
<PackageReference Include="Notifo.SDK" Version="1.7.4" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>
1 change: 1 addition & 0 deletions sample/Sample.iOS/Sample.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchDebug>true</MtouchDebug>
<CodesignProvision>VS: io.notifo.xamarin.sample Development</CodesignProvision>
<DeviceSpecificBuild>false</DeviceSpecificBuild>
</PropertyGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>..\..\Notifo.ruleset</CodeAnalysisRuleSet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ internal partial class NotifoMobilePushImplementation : NSObject, InternalIOSPus
private PullRefreshOptions refreshOptions;
private INotificationHandler notificationHandler;

partial void SetupPlatform()
{
this.refreshOptions = new PullRefreshOptions();
}

/// <inheritdoc />
public INotifoMobilePush SetRefreshOptions(PullRefreshOptions refreshOptions)
{
this.refreshOptions = refreshOptions ?? new PullRefreshOptions();
this.refreshOptions = refreshOptions;
return this;
}

Expand Down Expand Up @@ -82,7 +87,10 @@ private async Task PullPendingNotificationsAndTrack()
continue;
}

await ShowLocalNotificationAsync(notification);
// Do not "await" here. Trying to save time because of the 30 sec limit of the notification service extension.
// Notifications are pushed as quickly as possible to the ios notification scheduler.
// This could be a memory issue if there is a large amount of notifications.
ShowLocalNotificationAsync(notification).Forget();
}

if (trackImmediatly != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
<ItemGroup>
<ProjectReference Include="..\Notifo.SDK.Core\Notifo.SDK.Core.csproj" />
</ItemGroup>
</Project>
</Project>
4 changes: 2 additions & 2 deletions sdk/Notifo.SDK.Worker/Notifo.SDK.Worker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyName>Notifo.Xamarin.Worker</AssemblyName>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RootNamespace>Notifo.SDK</RootNamespace>
<RootNamespace>Notifo.SDK.Worker</RootNamespace>
<TargetFrameworks>monoandroid12.0;</TargetFrameworks>
</PropertyGroup>

Expand Down Expand Up @@ -45,4 +45,4 @@
<PackageReference Include="Xamarin.Android.Arch.Work.Runtime" Version="1.0.0.3">
</PackageReference>
</ItemGroup>
</Project>
</Project>
3 changes: 1 addition & 2 deletions sdk/Notifo.SDK.Worker/UpdateWorker.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
using System;
using System.Threading;
using Android.Runtime;
using AndroidX.Work;

namespace Notifo.SDK
{
internal sealed class UpdateWorker : Worker
internal sealed class UpdateWorker : AndroidX.Work.Worker
{
public UpdateWorker(IntPtr javaReference, JniHandleOwnership transfer)
: base(javaReference, transfer)
Expand Down

0 comments on commit 3568e12

Please sign in to comment.