Skip to content

Commit

Permalink
Merge pull request #120 from diogot/in_app_rating
Browse files Browse the repository at this point in the history
In app rating
  • Loading branch information
diogot authored Apr 16, 2017
2 parents fdabf5e + 31f3fbf commit a832d1a
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 12 deletions.
4 changes: 2 additions & 2 deletions MyWeight.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = MQRRG9G4R7;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -1761,7 +1761,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = MQRRG9G4R7;
ENABLE_NS_ASSERTIONS = NO;
Expand Down
14 changes: 13 additions & 1 deletion MyWeight/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import StoreKit

public class AppCoordinator {

Expand Down Expand Up @@ -61,9 +62,19 @@ public class AppCoordinator {
animated: true)
}

func askForReview() {
if #available(iOS 10.3, *) {
let key = "PlX0PBfZvIXZWmUvMXN3"
let defaults = UserDefaults.standard
let times = defaults.integer(forKey: key) + 1
defaults.set(times, forKey: key)
if times % 10 == 0 {
SKStoreReviewController.requestReview()
}
}
}
}


extension AppCoordinator: ListViewControllerDelegate {

public func didTapAddMeasure(last mass: Mass?)
Expand Down Expand Up @@ -97,6 +108,7 @@ extension AppCoordinator: AddViewControllerDelegate {

public func didEnd(on viewController: AddViewController) {
viewController.dismiss(animated: true, completion: nil)
askForReview()
}

}
Expand Down
2 changes: 1 addition & 1 deletion MyWeight/Resources/Info-Dev.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>15</string>
<string>16</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 1 addition & 1 deletion MyWeight/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>15</string>
<string>16</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
2 changes: 1 addition & 1 deletion MyWeight/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"Denied.Title.text" = "Permissions";

/* No comment provided by engineer. */
"Alert.FailToDelete.message" = "Please go to Heath App in ordet to delete this entry";
"Alert.FailToDelete.message" = "Please go to Heath App in order to delete this entry";

/* No comment provided by engineer. */
"Alert.FailToDelete.title" = "MyWeight isn't allowed to delete";
Expand Down
2 changes: 1 addition & 1 deletion MyWeightTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>15</string>
<string>16</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion MyWeightUITests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>15</string>
<string>16</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Watch Extension/Resources/Info-Dev.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<key>CFBundleVersion</key>
<string>15</string>
<string>16</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand Down
2 changes: 1 addition & 1 deletion Watch Extension/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<key>CFBundleVersion</key>
<string>15</string>
<string>16</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand Down
2 changes: 1 addition & 1 deletion watch/Info-Dev.plist → Watch/Info-Dev.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<key>CFBundleVersion</key>
<string>15</string>
<string>16</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
2 changes: 1 addition & 1 deletion watch/Info.plist → Watch/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<key>CFBundleVersion</key>
<string>15</string>
<string>16</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down

0 comments on commit a832d1a

Please sign in to comment.