Skip to content

Commit

Permalink
Use correct consumer key on iPad
Browse files Browse the repository at this point in the history
  • Loading branch information
David Skuza committed Oct 19, 2022
1 parent af39ff0 commit e36b540
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
<string>$(POCKET_API_BASE_URL)</string>
<key>PocketAPIConsumerKey</key>
<string>$(POCKET_API_CONSUMER_KEY)</string>
<key>PocketAPIConsumerKeyPad</key>
<string>$(POCKET_API_CONSUMER_KEY_PAD)</string>
<key>SentryDSN</key>
<string>$(SENTRY_DSN)</string>
<key>SnowplowEndpoint</key>
Expand Down
8 changes: 6 additions & 2 deletions PocketKit/Sources/PocketKit/Keys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import Foundation
import UIKit

struct Keys {
static let shared = Keys()
Expand All @@ -21,6 +21,10 @@ struct Keys {
fatalError("Unable to extract PocketApiConsumerKey from main bundle")
}

guard let pocketApiConsumerKeyPad = info["PocketAPIConsumerKeyPad"] as? String else {
fatalError("Unable to extract PocketApiConsumerKeyPad from main bundle")
}

guard let sentryDSN = info["SentryDSN"] as? String else {
fatalError("Unable to extract SentryDSN from main bundle")
}
Expand All @@ -33,7 +37,7 @@ struct Keys {
fatalError("Unable to extract BrazeAPIKey from main bundle")
}

self.pocketApiConsumerKey = pocketApiConsumerKey
self.pocketApiConsumerKey = UIDevice.current.userInterfaceIdiom == .pad ? pocketApiConsumerKeyPad : pocketApiConsumerKey
self.sentryDSN = sentryDSN
self.brazeAPIEndpoint = brazeAPIEndpoint
self.brazeAPIKey = brazeAPIKey
Expand Down
8 changes: 6 additions & 2 deletions PocketKit/Sources/SaveToPocketKit/Keys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import Foundation
import UIKit

struct Keys {
static let shared = Keys()
Expand All @@ -19,11 +19,15 @@ struct Keys {
fatalError("Unable to extract PocketApiConsumerKey from main bundle")
}

guard let pocketApiConsumerKeyPad = info["PocketAPIConsumerKeyPad"] as? String else {
fatalError("Unable to extract PocketApiConsumerKeyPad from main bundle")
}

guard let sentryDSN = info["SentryDSN"] as? String else {
fatalError("Unable to extract SentryDSN from main bundle")
}

self.pocketApiConsumerKey = pocketApiConsumerKey
self.pocketApiConsumerKey = UIDevice.current.userInterfaceIdiom == .pad ? pocketApiConsumerKeyPad : pocketApiConsumerKey
self.sentryDSN = sentryDSN
}
}
2 changes: 2 additions & 0 deletions SaveToPocket/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
<string>$(POCKET_API_BASE_URL)</string>
<key>PocketAPIConsumerKey</key>
<string>$(POCKET_API_CONSUMER_KEY)</string>
<key>PocketAPIConsumerKeyPad</key>
<string>$(POCKET_API_CONSUMER_KEY_PAD)</string>
<key>SentryDSN</key>
<string>${SENTRY_DSN}</string>
</dict>
Expand Down

0 comments on commit e36b540

Please sign in to comment.