summaryrefslogtreecommitdiffhomepage
path: root/ios/Shared/ApplicationTarget.swift
blob: 693cec9285a49382044f8b86a31e823d6c709859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//
//  ApplicationTarget.swift
//  MullvadVPN
//
//  Created by pronebird on 09/06/2023.
//  Copyright © 2026 Mullvad VPN AB. All rights reserved.
//

import Foundation

enum ApplicationTarget: CaseIterable {
    case mainApp, packetTunnel

    /// Returns target bundle identifier.
    var bundleIdentifier: String {
        // "MainApplicationIdentifier" does not exist if running tests
        let mainBundleIdentifier =
            Bundle.main
            .object(forInfoDictionaryKey: "MainApplicationIdentifier") as? String ?? "tests"
        switch self {
        case .mainApp:
            return mainBundleIdentifier
        case .packetTunnel:
            return "\(mainBundleIdentifier).PacketTunnel"
        }
    }
}