Skip to content

Commit

Permalink
Fixed #334 And #414
Browse files Browse the repository at this point in the history
Notification not working on iOS
  • Loading branch information
thudugala committed Jun 16, 2023
1 parent 8fc97a2 commit 22541b3
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 20 deletions.
3 changes: 1 addition & 2 deletions Sample/Direct Maui/LocalNotification.Sample/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ public static MauiApp CreateMauiApp()
.AddiOS(iOS =>
{
#if IOS
iOS.UseCustomDelegate = true;
iOS.SetCustomUserNotificationCenterDelegate(new CustomUserNotificationCenterDelegate());
//iOS.SetCustomUserNotificationCenterDelegate(new CustomUserNotificationCenterDelegate());
#endif
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ public static MauiAppBuilder UseLocalNotification(this MauiAppBuilder builder, A
{
iOS.FinishedLaunching((application, _) =>
{
if (localNotificationBuilder.IOSBuilder.UseCustomDelegate)
{
LocalNotificationCenter.SetCustomUserNotificationCenterDelegate(localNotificationBuilder.IOSBuilder.CustomUserNotificationCenterDelegate);
}
LocalNotificationCenter.SetUserNotificationCenterDelegate(localNotificationBuilder.IOSBuilder.CustomUserNotificationCenterDelegate);
return true;
});
iOS.WillEnterForeground(application =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public partial class LocalNotificationCenter
/// and set it using this method
/// </summary>
/// <param name="notificationDelegate"></param>
public static void SetCustomUserNotificationCenterDelegate(UserNotificationCenterDelegate notificationDelegate = null)
public static void SetUserNotificationCenterDelegate(UserNotificationCenterDelegate notificationDelegate = null)
{
UNUserNotificationCenter.Current.Delegate = notificationDelegate ?? new UserNotificationCenterDelegate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Description>The local notification plugin provides a way to show local notifications from Xamarin and MAUI apps.</Description>
<PackageIcon>icon.png</PackageIcon>
<Copyright>Copyright © Elvin (Tharindu) Thudugala</Copyright>
<Version>10.1.5</Version>
<Version>10.1.6</Version>
<PackageReleaseNotes>Check: https://github.com/thudugala/Plugin.LocalNotification/releases </PackageReleaseNotes>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down Expand Up @@ -71,7 +71,7 @@
<Compile Include="**/Platforms/Android/**/*.cs" />
<PackageReference Include="Xamarin.Build.Download" Version="0.11.4" PrivateAssets="All"/>
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.10.1.1" />
<PackageReference Include="Xamarin.GooglePlayServices.Location" Version="120.0.0.2" />
<PackageReference Include="Xamarin.GooglePlayServices.Location" Version="120.0.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
</ItemGroup>
Expand All @@ -84,7 +84,7 @@

<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
<Compile Include="**/Platforms/Android/**/*.cs" />
<PackageReference Include="Xamarin.GooglePlayServices.Location" Version="120.0.0.2" />
<PackageReference Include="Xamarin.GooglePlayServices.Location" Version="120.0.0.1" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('-ios'))">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ namespace Plugin.LocalNotification.iOSOption
/// </summary>
public interface IiOSLocalNotificationBuilder
{
/// <summary>
///
/// </summary>
bool UseCustomDelegate { get; set; }

#if IOS
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ namespace Plugin.LocalNotification.iOSOption
/// <inheritdoc/>
public class iOSLocalNotificationBuilder : IiOSLocalNotificationBuilder
{
/// <summary>
///
/// </summary>
public bool UseCustomDelegate { get; set; }

#if IOS
/// <summary>
///
Expand Down

0 comments on commit 22541b3

Please sign in to comment.