Skip to content

Commit 9ef61e7

Browse files
Fix IAP on Mac
1 parent 76aa267 commit 9ef61e7

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
osx_image: xcode11.1
1+
osx_image: xcode11.3
22
language: objective-c
33

44
# Handle git submodules yourself

ChatSecureCore/Classes/View Controllers/PurchaseViewController.swift

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,18 @@ public class PurchaseViewController: UIViewController {
4747
return [smallMoneyButton: .small, mediumMoneyButton: .medium, bigMoneyButton: .big]
4848
}
4949

50-
enum Product: String {
51-
case small = "3_donation_monthly" // "3_donation_nonconsumable" // "3_donation_consumable"
52-
case medium = "6_donation_monthly" // "6_donation_consumable"
53-
case big = "20_donation_monthly" // "20_donation_consumable"
54-
static let allProductsSet = Set([small.rawValue, medium.rawValue, big.rawValue])
50+
enum Product: String, CaseIterable {
51+
#if targetEnvironment(macCatalyst)
52+
case small = "3_donation_monthly_mac"
53+
case medium = "6_donation_monthly_mac"
54+
case big = "20_donation_monthly_mac"
55+
#else
56+
case small = "3_donation_monthly"
57+
case medium = "6_donation_monthly"
58+
case big = "20_donation_monthly"
59+
#endif
60+
61+
static var allProductsSet: Set<String> { Set(allCases.map { $0.rawValue }) }
5562
var emoji: String {
5663
switch self {
5764
case .small:

OTRAssets/OTRBranding.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ + (BOOL) allowOMEMO {
175175

176176
/** Returns true if we're running the official ChatSecure */
177177
+ (BOOL) matchesUpstream {
178-
return [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.chrisballinger.ChatSecure"];
178+
return [[[NSBundle mainBundle] bundleIdentifier] containsString:@"com.chrisballinger.ChatSecure"];
179179
}
180180

181181
+ (BOOL) allowsDonation {

0 commit comments

Comments
 (0)