فهرست منبع

Merge pull request #173 from bizz84/feature/add-SKError-cloudServiceRevoked-xcode8.3

Update to Xcode 8.3, iOS 10.3
Andrea Bizzotto 8 سال پیش
والد
کامیت
2d29746dfa
3فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 3 3
      .travis.yml
  2. 3 0
      SwiftyStoreKit-iOS-Demo/ViewController.swift
  3. 1 1
      scripts/build.sh

+ 3 - 3
.travis.yml

@@ -1,7 +1,7 @@
 language: objective-c
 language: objective-c
-osx_image: xcode8
-before_install:
-  - rvm get stable
+osx_image: xcode8.3
+#before_install:
+#  - rvm get stable
 
 
 install:
 install:
   - ./scripts/install_swiftlint.sh
   - ./scripts/install_swiftlint.sh

+ 3 - 0
SwiftyStoreKit-iOS-Demo/ViewController.swift

@@ -213,6 +213,7 @@ extension ViewController {
         }
         }
     }
     }
 
 
+    // swiftlint:disable cyclomatic_complexity
     func alertForPurchaseResult(_ result: PurchaseResult) -> UIAlertController? {
     func alertForPurchaseResult(_ result: PurchaseResult) -> UIAlertController? {
         switch result {
         switch result {
         case .success(let product):
         case .success(let product):
@@ -236,6 +237,8 @@ extension ViewController {
                 return alertWithTitle("Purchase failed", message: "Access to cloud service information is not allowed")
                 return alertWithTitle("Purchase failed", message: "Access to cloud service information is not allowed")
             case .cloudServiceNetworkConnectionFailed: // the device could not connect to the nework
             case .cloudServiceNetworkConnectionFailed: // the device could not connect to the nework
                 return alertWithTitle("Purchase failed", message: "Could not connect to the network")
                 return alertWithTitle("Purchase failed", message: "Could not connect to the network")
+            case .cloudServiceRevoked: // user has revoked permission to use this cloud service
+                return alertWithTitle("Purchase failed", message: "Could service was revoked")
             }
             }
         }
         }
     }
     }

+ 1 - 1
scripts/build.sh

@@ -4,4 +4,4 @@ xcodebuild -project SwiftyStoreKit.xcodeproj -target SwiftyStoreKit_iOS
 xcodebuild -project SwiftyStoreKit.xcodeproj -target SwiftyStoreKit_macOS
 xcodebuild -project SwiftyStoreKit.xcodeproj -target SwiftyStoreKit_macOS
 xcodebuild -project SwiftyStoreKit.xcodeproj -target SwiftyStoreKit_tvOS
 xcodebuild -project SwiftyStoreKit.xcodeproj -target SwiftyStoreKit_tvOS
 
 
-xcodebuild test -project SwiftyStoreKit.xcodeproj -scheme SwiftyStoreKitTests -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.0'
+xcodebuild test -project SwiftyStoreKit.xcodeproj -scheme SwiftyStoreKitTests -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.3'