Skip to content

Commit

Permalink
Remove Mac Catalyst support
Browse files Browse the repository at this point in the history
  • Loading branch information
infinitepower18 committed May 3, 2024
1 parent b8d298b commit 95408f9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription

let package = Package(
name: "EmailClientHelper",
platforms: [.iOS(.v12), .macCatalyst(.v13), .visionOS(.v1)],
platforms: [.iOS(.v12), .visionOS(.v1)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# EmailClientHelper
A simple helper package to send an email using 3rd party email clients. Supported clients include Gmail, Outlook and Yahoo Mail.

Currently, the package only supports iOS, Mac Catalyst and visionOS.
Currently, the package only supports iOS and visionOS.

You will also need to add this in your app's `Info.plist`:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Helper package to send an email using 3rd party apps

A simple helper package to send an email using 3rd party email clients. Supported clients include Gmail, Outlook and Yahoo Mail.

Currently, the package only supports iOS, Mac Catalyst and visionOS.
Currently, the package only supports iOS and visionOS.

You will also need to add this in your app's `Info.plist`:

Expand Down
8 changes: 4 additions & 4 deletions Sources/EmailClientHelper/EmailClientHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class EmailClientHelper {
public static var availableClients: [EmailClient] {
var clients: [EmailClient] = []

#if os(iOS) || os(visionOS) || targetEnvironment(macCatalyst)
#if os(iOS) || os(visionOS)
for client in EmailClient.allCases {
if isClientAvailable(client) {
clients.append(client)
Expand All @@ -33,7 +33,7 @@ public class EmailClientHelper {
/// - Parameter client: The email client to check
/// - Returns: Whether the client is available
public static func isClientAvailable(_ client: EmailClient) -> Bool {
#if os(iOS) || os(visionOS) || targetEnvironment(macCatalyst)
#if os(iOS) || os(visionOS)
let urlProtocol = URL(string: "\(client.rawValue)://")

if let urlProtocol = urlProtocol, UIApplication.shared.canOpenURL(urlProtocol) {
Expand All @@ -55,7 +55,7 @@ public class EmailClientHelper {
public static func getEmailURL(client: EmailClient, to: String, subject: String = "", body: String = "") -> URL? {
var url: URL?

#if os(iOS) || os(visionOS) || targetEnvironment(macCatalyst)
#if os(iOS) || os(visionOS)
let encodedSubject = subject.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
let encodedBody = body.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)

Expand Down Expand Up @@ -83,7 +83,7 @@ public class EmailClientHelper {
/// - subject: The email subject
/// - body: The email body
public static func sendEmail(client: EmailClient, to: String, subject: String = "", body: String = "") {
#if os(iOS) || os(visionOS) || targetEnvironment(macCatalyst)
#if os(iOS) || os(visionOS)
let url: URL? = getEmailURL(client: client, to: to, subject: subject, body: body)

if let url {
Expand Down

0 comments on commit 95408f9

Please sign in to comment.