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

[flutter_local_notifications] Rename Converters - conflict with another libraries #2175

Open
wants to merge 1 commit into
base: master
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Converters.h
// NotificationParser.h
// flutter_local_notifications
//

Expand All @@ -8,7 +8,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface Converters : NSObject
@interface NotificationParser : NSObject
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Rather than renaming from Converters to NotificationParser, would you be able to add the FLN prefix (an abbreviation of flutter local notifications) so that it's FLNConverters instead? Idea came about seeing the official plugins use FLT (presumably for Flutter)


+ (UNNotificationCategoryOptions)parseNotificationCategoryOptions:
(NSArray *)options API_AVAILABLE(ios(10.0), macosx(10.14));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "Converters.h"
#import "NotificationParser.h"

@implementation Converters
@implementation NotificationParser

+ (UNNotificationCategoryOptions)parseNotificationCategoryOptions:
(NSArray *)options {
Expand Down
1 change: 0 additions & 1 deletion flutter_local_notifications/ios/Classes/Converters.h

This file was deleted.

1 change: 0 additions & 1 deletion flutter_local_notifications/ios/Classes/Converters.m

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "FlutterLocalNotificationsPlugin.h"
#import "ActionEventSink.h"
#import "Converters.h"
#import "NotificationParser.h"
#import "FlutterEngineManager.h"

@implementation FlutterLocalNotificationsPlugin {
Expand Down Expand Up @@ -316,7 +316,7 @@ - (void)configureNotificationCategories:(NSDictionary *_Nonnull)arguments
NSString *identifier = action[@"identifier"];
NSString *title = action[@"title"];
UNNotificationActionOptions options =
[Converters parseNotificationActionOptions:action[@"options"]];
[NotificationParser parseNotificationActionOptions:action[@"options"]];

if ((options & UNNotificationActionOptionForeground) != 0) {
[foregroundActionIdentifiers addObject:identifier];
Expand All @@ -343,7 +343,7 @@ - (void)configureNotificationCategories:(NSDictionary *_Nonnull)arguments
categoryWithIdentifier:category[@"identifier"]
actions:newActions
intentIdentifiers:@[]
options:[Converters parseNotificationCategoryOptions:
options:[NotificationParser parseNotificationCategoryOptions:
category[@"options"]]];

[notificationCategories addObject:notificationCategory];
Expand Down
1 change: 0 additions & 1 deletion flutter_local_notifications/macos/Classes/Converters.m

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,15 @@ public class FlutterLocalNotificationsPlugin: NSObject, FlutterPlugin, UNUserNot
newActions.append(UNNotificationAction(
identifier: identifier,
title: title,
options: Converters.parseNotificationActionOptions(options)
options: NotificationParser.parseNotificationActionOptions(options)
))
} else if type == "text" {
let buttonTitle = action["buttonTitle"] as! String
let placeholder = action["placeholder"] as! String
newActions.append(UNTextInputNotificationAction(
identifier: identifier,
title: title,
options: Converters.parseNotificationActionOptions(options),
options: NotificationParser.parseNotificationActionOptions(options),
textInputButtonTitle: buttonTitle,
textInputPlaceholder: placeholder
))
Expand All @@ -288,7 +288,7 @@ public class FlutterLocalNotificationsPlugin: NSObject, FlutterPlugin, UNUserNot
intentIdentifiers: [],
hiddenPreviewsBodyPlaceholder: nil,
categorySummaryFormat: nil,
options: Converters.parseNotificationCategoryOptions(category["options"] as! [NSNumber])
options: NotificationParser.parseNotificationCategoryOptions(category["options"] as! [NSNumber])
)

notificationCategories.insert(notificationCategory)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Converters.h
// NotificationParser.h
// flutter_local_notifications
//

Expand All @@ -8,7 +8,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface Converters : NSObject
@interface NotificationParser : NSObject

+ (UNNotificationCategoryOptions)parseNotificationCategoryOptions:
(NSArray *)options API_AVAILABLE(ios(10.0), macos(10.14));
Expand Down