39 Commits

Author SHA1 Message Date
Matt Coneybeare
b92da20460 Remove the deprecated ct parameter 2020-12-04 08:49:35 -05:00
Matt Coneybeare
c54a35059c version bump 2019-10-30 18:47:53 -04:00
Matt Coneybeare
fedb19b8a7 Merge pull request #135 from weakfl/swift5
Update to Swift 5
2019-10-25 11:21:18 -04:00
weak
51eca2a931 Conversion to Swift 5
- convert all targets to Swift 5
- bump .swift-version
- update podspec
- fix warnings
2019-09-19 10:47:04 +02:00
weak
b22a605285 update projects to recommended settings 2019-09-19 10:23:37 +02:00
Matt Coneybeare
118a777ff2 Merge pull request #125 from samwize/master
Enable useStoreKitReviewPrompt for macOS 10.4+
2018-12-15 08:39:28 -05:00
Junda
690bf6be67 Enable useStoreKitReviewPrompt for macOS 10.4+ 2018-11-28 15:24:53 +08:00
Matt Coneybeare
1ea2201dd3 bump podspec 2018-10-29 15:04:25 -04:00
Matt Coneybeare
fb6e2444be Merge pull request #123 from metasmile/patch-1
add "s.swift_version = '4.2'"
2018-10-04 08:30:36 -04:00
metasmile
ddc5a0d7ea Update Armchair.podspec 2018-10-02 18:21:15 +02:00
Matt Coneybeare
7f05ad9ef6 Merge pull request #122 from bitsfabrik/master
change cancel action style & swift 4.2 changes
2018-09-28 07:55:56 -04:00
BiNo
94817f1715 swift 4.2 fix 2018-09-18 14:05:52 +02:00
BiNo
abeb3eb4b1 Merge branch 'master_original' 2018-09-18 13:56:02 +02:00
Matt Coneybeare
3d9c47bf60 Merge pull request #121 from metasmile/master
Remove Xcode warning forArmchair.swift:720:14
2018-08-31 14:32:13 -04:00
metasmile
fcd99c015a Merge pull request #1 from metasmile/metasmile-patch-1
Remove Xcode warning forArmchair.swift:720:14
2018-08-29 17:41:33 +02:00
metasmile
66fb9abb8d Remove Xcode warning forArmchair.swift:720:14
'let' properties are implicitly 'final'; use 'public' instead of 'open'
2018-08-29 17:40:29 +02:00
Philip Messlehner
d5ba63a0a4 removed duplicate cancel action 2018-07-24 10:38:09 +02:00
Philip Messlehner
44b930169c changed ordering and make use of cancel action 2018-07-24 10:28:57 +02:00
Matt Coneybeare
f7ed2b2063 Merge pull request #119 from mabidakun/Xcode-9.3-Swift-4.1-Fixes
Xcode 9.3 swift 4.1 fixes
2018-04-09 06:40:38 -04:00
Mike O. Abidakun
de6e53da44 Applies Xcode-9.3. Fix-it which adds compile time warnings for the implicit retention of self. 2018-03-30 21:38:58 +01:00
Mike O. Abidakun
ead9ec4656 Replaces code for checking the platform and OS version, with a simplified call that meets the original intent.
The original intent was to check if the code was running in an iOS simulator on an x86 architecture.
This solution was provided by a FixIt in Xcode-9.3.
2018-03-30 21:36:44 +01:00
Mike O. Abidakun
ffd05b16a5 Fixes a compile-time failure caused by referening to the useStoreKitReviewPrompt method, which is no included for macOS. 2018-03-30 21:33:37 +01:00
Matt Coneybeare
a8c1dfdae5 Merge pull request #112 from MartinMoizard/master
Improve iOS 10.3 review dialog support + documentation
2017-11-10 12:16:23 -05:00
Martin Moizard
b3bd6ecc16 Restore func hideRatingAlert() 2017-11-10 17:11:29 +01:00
Matt Coneybeare
773c9c9ddd Merge pull request #111 from 1bannamgiauten/patch-1
missing ; in end of line one
2017-10-29 12:43:59 -04:00
Martin Moizard
90ce675259 Add documentation on new API 2017-10-27 10:53:51 +02:00
Tuan Nguyen
f53bf4637d missing ; in end of line one 2017-10-21 01:12:17 +07:00
Matt Coneybeare
804141486d update podspec 2017-10-11 14:28:33 -04:00
Matt Coneybeare
86bb26031d updated iOS 11 review string template 2017-10-11 12:54:42 -04:00
Matt Coneybeare
74ae451630 updated iOS 11 review string template 2017-10-11 11:46:01 -04:00
Matt Coneybeare
c70e28dd42 Merge branch 'master' of github.com:UrbanApps/Armchair 2017-10-11 11:41:39 -04:00
Matt Coneybeare
04208a6f75 Merge pull request #110 from ArturoLee/master
Rate Button is now Bold
2017-10-05 11:27:07 -04:00
ArturoLee
5c963bda6a UIAlertActionStyle.cancel was assigned to the rate button so it can appear bold.
UIAlertActionStyle.default was assigned to the cancel button so it can have a regular font 2017-10-02 19:41:34 -04:00
Matt Coneybeare
04cb290dc1 updated podspec 2017-09-17 08:23:23 -04:00
Matt Coneybeare
a4f97f92c3 updated podspec 2017-09-15 09:20:14 -04:00
whitepixelstudios
adc0a0d580 Update iOS 10.3 review dialog support 2017-07-31 12:25:05 +10:00
whitepixelstudios
dddaa62c25 Changes 2017-07-31 11:52:04 +10:00
whitepixelstudios
ea3ab5ed28 Merge remote-tracking branch 'UrbanApps/master'
# Conflicts:
#	Source/Armchair.swift
2017-07-31 11:50:17 +10:00
whitepixelstudios
068c4b92c1 Remove ios < 9 support [Alertview] 2017-07-31 11:44:12 +10:00
15 changed files with 228 additions and 157 deletions

View File

@@ -1 +1 @@
3.0
5.0

View File

@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Armchair"
s.version = "0.3.1"
s.version = "0.3.7"
s.summary = "A simple yet powerful App Review Manager for iOS and OSX in Swift"
s.description = <<-DESC
A simple yet powerful App Review Manager for iOS and OSX in Swift.
@@ -22,11 +22,12 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/UrbanApps/Armchair.git', :tag => s.version }
s.license = { :type => "MIT", :file => "LICENSE" }
s.source_files = "Source/*.{h,swift}"
s.resources = "Localization/*.lproj"
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.10'
s.requires_arc = true
s.swift_version = '5.0'
end

View File

@@ -318,7 +318,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1100;
ORGANIZATIONNAME = Armchair;
TargetAttributes = {
E6A0AF6419C9CFF400C3A7DC = {
@@ -326,20 +326,21 @@
ProvisioningStyle = Manual;
};
E6D8B8EF19C756A4001AD043 = {
LastSwiftMigration = 0900;
LastSwiftMigration = 1100;
};
F8111E3219A95C8B0040E7D1 = {
CreatedOnToolsVersion = 6.0;
LastSwiftMigration = 0800;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = F8111E2D19A95C8B0040E7D1 /* Build configuration list for PBXProject "Armchair" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = F8111E2919A95C8B0040E7D1;
productRefGroup = F8111E2919A95C8B0040E7D1;
@@ -545,7 +546,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -571,7 +572,7 @@
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -618,6 +619,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -626,12 +628,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -677,6 +681,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -685,12 +690,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -743,7 +750,7 @@
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -765,7 +772,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,8 +26,16 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F8111E3219A95C8B0040E7D1"
BuildableName = "Armchair.framework"
BlueprintName = "Armchair"
ReferencedContainer = "container:Armchair.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@@ -40,23 +48,11 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F8111E3219A95C8B0040E7D1"
BuildableName = "Armchair.framework"
BlueprintName = "Armchair"
ReferencedContainer = "container:Armchair.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -72,8 +68,6 @@
ReferencedContainer = "container:Armchair.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,18 +26,14 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -53,8 +49,6 @@
ReferencedContainer = "container:Armchair.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -28,7 +28,7 @@
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
AppDelegate.setupArmchair()
return true
}

View File

@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
@@ -30,6 +40,16 @@
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
@@ -59,6 +79,16 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {

View File

@@ -1,4 +1,4 @@
"If you enjoy using %@, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!" = "Cảm ơn bạn đã sử dụng ứng dụng %@ trong thời gian qua, bạn có thể dành chút thời gian để đánh giá ứng dụng trong AppStore không? Sẽ không mất quá 1 phút nhưng chúng tôi rất trân trọng điều đó!"
"If you enjoy using %@, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!" = "Cảm ơn bạn đã sử dụng ứng dụng %@ trong thời gian qua, bạn có thể dành chút thời gian để đánh giá ứng dụng trong AppStore không? Sẽ không mất quá 1 phút nhưng chúng tôi rất trân trọng điều đó!";
"Rate %@" = "Đánh giá %@";
"No, Thanks" = "Không, xin cảm ơn";
"Remind me later" = "Hãy nhắc nhở tôi sau";

View File

@@ -161,17 +161,18 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1100;
ORGANIZATIONNAME = Armchair;
TargetAttributes = {
E60FA7B919C908FE00179D70 = {
CreatedOnToolsVersion = 6.1;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = E60FA7B519C908FE00179D70 /* Build configuration list for PBXProject "Mac Example" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -281,6 +282,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -289,12 +291,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -334,6 +338,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -342,12 +347,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -380,11 +387,13 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = "Example/Info-Mac.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -392,11 +401,13 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = "Example/Info-Mac.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Release;
};

View File

@@ -284,6 +284,14 @@ Armchair.shouldPromptIfRated() -> Bool
Armchair.shouldPromptIfRated(shouldPromptIfRated: Bool)
```
The `useStoreKitReviewPrompt` configuration determines wether or not to try showing the SKStoreReviewController's requestReview() prompt instead of the default prompt. This setting has some effects only on iOS version >= 10.3. It's default value is `false`.
```swift
// GETTER
Armchair.useStoreKitReviewPrompt() -> Bool
// SETTER
Armchair.useStoreKitReviewPrompt(useStoreKitReviewPrompt: Bool)
```
The `useMainAppBundleForLocalizations` configuration is a way to tell Armchair that you are providing your own translations for the review prompt popup strings. This may be because you are just customizing them, or that you have set your own text for the popup. If set to `true`, the main bundle will always be used to load localized strings. You have to include the translations either in a file called `ArmchairLocalizable.strings` or the standard `Localizable.strings`. If set to `false` Armchair will look in its own translation bundle for the translating strings. It's default value is `false`.
```swift

View File

@@ -243,6 +243,13 @@ public func shouldPromptIfRated(_ shouldPromptIfRated: Bool) {
Manager.defaultManager.shouldPromptIfRated = shouldPromptIfRated
}
/*
* Return whether Armchair will try and present the Storekit review prompt (useful for custom dialog modification)
*/
public var shouldTryStoreKitReviewPrompt : Bool {
return Manager.defaultManager.shouldTryStoreKitReviewPrompt
}
/*
* If set to true, the main bundle will always be used to load localized strings.
* Set this to true if you have provided your own custom localizations in
@@ -270,7 +277,7 @@ public func affiliateCode(_ affiliateCode: String) {
}
/*
* If you are an Apple Affiliate, enter your campaign code here.
* If you are an Apple Affiliate, enter your campaign code here. (DEPRECATED)
* Default => "Armchair-<appID>"
*/
public func affiliateCampaignCode() -> String {
@@ -280,19 +287,17 @@ public func affiliateCampaignCode(_ affiliateCampaignCode: String) {
Manager.defaultManager.affiliateCampaignCode = affiliateCampaignCode
}
#if os(iOS)
/*
* If set to true, use SKStoreReviewController's requestReview() prompt instead of the default prompt.
* If not on iOS 10.3+, reort to the default prompt.
* Default => false.
*/
public func useStoreKitReviewPrompt() -> Bool {
return Manager.defaultManager.useStoreKitReviewPrompt
}
public func useStoreKitReviewPrompt(_ useStoreKitReviewPrompt: Bool) {
Manager.defaultManager.useStoreKitReviewPrompt = useStoreKitReviewPrompt
}
#endif
/*
* If set to true, use SKStoreReviewController's requestReview() prompt instead of the default prompt.
* If not on iOS 10.3+ or macOS 10.4+, resort to the default prompt.
* Default => false.
*/
public func useStoreKitReviewPrompt() -> Bool {
return Manager.defaultManager.useStoreKitReviewPrompt
}
public func useStoreKitReviewPrompt(_ useStoreKitReviewPrompt: Bool) {
Manager.defaultManager.useStoreKitReviewPrompt = useStoreKitReviewPrompt
}
/*
* 'true' will show the Armchair alert everytime. Useful for testing
@@ -710,7 +715,7 @@ public enum ArmchairKey: String, CustomStringConvertible {
}
open class ArmchairTrackingInfo: CustomStringConvertible {
open let info: Dictionary<ArmchairKey, AnyObject>
public let info: Dictionary<ArmchairKey, AnyObject>
init(info: Dictionary<ArmchairKey, AnyObject>) {
self.info = info
@@ -742,7 +747,7 @@ public struct AppiraterKey {
// MARK: PRIVATE Interface
#if os(iOS)
open class ArmchairManager : NSObject, UIAlertViewDelegate, SKStoreProductViewControllerDelegate { }
open class ArmchairManager : NSObject, SKStoreProductViewControllerDelegate { }
#elseif os(OSX)
open class ArmchairManager : NSObject, NSAlertDelegate { }
#else
@@ -762,11 +767,12 @@ open class Manager : ArmchairManager {
// MARK: Review Alert & Properties
#if os(iOS)
fileprivate var ratingAlert: UIAlertView? = nil
fileprivate let reviewURLTemplate = "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&id=APP_ID&at=AFFILIATE_CODE&ct=AFFILIATE_CAMPAIGN_CODE&action=write-review"
fileprivate var ratingAlert: UIAlertController? = nil
fileprivate let reviewURLTemplate = "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&id=APP_ID&at=AFFILIATE_CODE&ct=AFFILIATE_CAMPAIGN_CODE&action=write-review"
fileprivate let reviewURLTemplateiOS11 = "https://itunes.apple.com/us/app/idAPP_ID?ls=1&mt=8&at=AFFILIATE_CODE&action=write-review"
#elseif os(OSX)
private var ratingAlert: NSAlert? = nil
private let reviewURLTemplate = "macappstore://itunes.apple.com/us/app/idAPP_ID?ls=1&mt=12&at=AFFILIATE_CODE&ct=AFFILIATE_CAMPAIGN_CODE"
private let reviewURLTemplate = "macappstore://itunes.apple.com/us/app/idAPP_ID?ls=1&mt=12&at=AFFILIATE_CODE"
#else
#endif
@@ -878,13 +884,13 @@ open class Manager : ArmchairManager {
// It is my affiliate code. It is better that somebody's code is used rather than nobody's.
fileprivate var affiliateCode: String = "11l7j9"
fileprivate var affiliateCampaignCode: String = "Armchair"
fileprivate var useStoreKitReviewPrompt: Bool = false
#if os(iOS)
fileprivate var usesAnimation: Bool = true
fileprivate var tintColor: UIColor? = nil
fileprivate lazy var usesAlertController: Bool = self.defaultUsesAlertController()
fileprivate lazy var opensInStoreKit: Bool = self.defaultOpensInStoreKit()
fileprivate var useStoreKitReviewPrompt: Bool = false
fileprivate func defaultOpensInStoreKit() -> Bool {
return operatingSystemVersion >= 8
@@ -1206,74 +1212,87 @@ open class Manager : ArmchairManager {
return (daysBeforeReminding > 0 && remindButtonTitle != nil)
}
public var shouldTryStoreKitReviewPrompt : Bool {
#if os(iOS)
if #available(iOS 10.3, *), useStoreKitReviewPrompt {
return true
}
#endif
return false
}
fileprivate func requestStoreKitReviewPrompt() -> Bool {
if #available(iOS 10.3, OSX 10.14, *), useStoreKitReviewPrompt {
SKStoreReviewController.requestReview()
// Assume this version is rated. There is no API to tell if the user actaully rated.
userDefaultsObject?.setBool(true, forKey: keyForArmchairKeyType(ArmchairKey.RatedCurrentVersion))
userDefaultsObject?.setBool(true, forKey: keyForArmchairKeyType(ArmchairKey.RatedAnyVersion))
userDefaultsObject?.synchronize()
#if os(iOS)
closeModalPanel()
#endif
return true
}
return false
}
fileprivate func showRatingAlert() {
if let customClosure = customAlertClosure {
customClosure({[weak self] in self?._rateApp()}, {[weak self] in self?.remindMeLater()}, {[weak self] in self?.dontRate()})
customClosure({[weak self] in
if let result = self?.requestStoreKitReviewPrompt(), result {
///Showed storekit prompt, all done
} else {
/// Didn't show storekit prompt, present app store manually
self?._rateApp()
}
}, {[weak self] in self?.remindMeLater()}, {[weak self] in self?.dontRate()})
if let closure = self.didDisplayAlertClosure {
closure()
}
} else {
if requestStoreKitReviewPrompt() {
///Showed storekit prompt, all done
return
}
#if os(iOS)
if #available(iOS 10.3, *), useStoreKitReviewPrompt {
SKStoreReviewController.requestReview()
// Assume this version is rated. There is no API to tell if the user actaully rated.
userDefaultsObject?.setBool(true, forKey: keyForArmchairKeyType(ArmchairKey.RatedCurrentVersion))
userDefaultsObject?.setBool(true, forKey: keyForArmchairKeyType(ArmchairKey.RatedAnyVersion))
userDefaultsObject?.synchronize()
return
/// Didn't show storekit prompt, present app store manually
let alertView : UIAlertController = UIAlertController(title: reviewTitle, message: reviewMessage, preferredStyle: .alert)
alertView.addAction(UIAlertAction(title: rateButtonTitle, style: .default, handler: {
(alert: UIAlertAction!) in
self._rateApp()
}))
if (showsRemindButton()) {
alertView.addAction(UIAlertAction(title: remindButtonTitle!, style: .default, handler: {
(alert: UIAlertAction!) in
self.remindMeLater()
}))
}
if (operatingSystemVersion >= 8 && usesAlertController) || operatingSystemVersion >= 9 {
/* iOS 8 uses new UIAlertController API*/
let alertView : UIAlertController = UIAlertController(title: reviewTitle, message: reviewMessage, preferredStyle: UIAlertControllerStyle.alert)
alertView.addAction(UIAlertAction(title: cancelButtonTitle, style:UIAlertActionStyle.cancel, handler: {
(alert: UIAlertAction!) in
self.dontRate()
}))
if (showsRemindButton()) {
alertView.addAction(UIAlertAction(title: remindButtonTitle!, style:UIAlertActionStyle.default, handler: {
(alert: UIAlertAction!) in
self.remindMeLater()
}))
}
alertView.addAction(UIAlertAction(title: rateButtonTitle, style:UIAlertActionStyle.default, handler: {
(alert: UIAlertAction!) in
self._rateApp()
}))
// get the top most controller (= the StoreKit Controller) and dismiss it
if let presentingController = UIApplication.shared.keyWindow?.rootViewController {
if let topController = Manager.topMostViewController(presentingController) {
topController.present(alertView, animated: usesAnimation) { [weak self] in
if let closure = self?.didDisplayAlertClosure {
closure()
}
print("presentViewController() completed")
alertView.addAction(UIAlertAction(title: cancelButtonTitle, style: .cancel, handler: {
(alert: UIAlertAction!) in
self.dontRate()
}))
ratingAlert = alertView
// get the top most controller (= the StoreKit Controller) and dismiss it
if let presentingController = UIApplication.shared.keyWindow?.rootViewController {
if let topController = Manager.topMostViewController(presentingController) {
topController.present(alertView, animated: usesAnimation) { [weak self] in
if let closure = self?.didDisplayAlertClosure {
closure()
}
print("presentViewController() completed")
}
// note that tint color has to be set after the controller is presented in order to take effect (last checked in iOS 9.3)
alertView.view.tintColor = tintColor
}
} else {
/* Otherwise we use UIAlertView still */
var alertView: UIAlertView
if (showsRemindButton()) {
alertView = UIAlertView(title: reviewTitle, message: reviewMessage, delegate: self, cancelButtonTitle: cancelButtonTitle, otherButtonTitles: remindButtonTitle!, rateButtonTitle)
} else {
alertView = UIAlertView(title: reviewTitle, message: reviewMessage, delegate: self, cancelButtonTitle: cancelButtonTitle, otherButtonTitles: rateButtonTitle)
}
// If we have a remind button, show it first. Otherwise show the rate button
// If we have a remind button, show the rate button next. Otherwise stop adding buttons.
alertView.cancelButtonIndex = -1
ratingAlert = alertView
alertView.show()
if let closure = didDisplayAlertClosure {
closure()
}
// note that tint color has to be set after the controller is presented in order to take effect (last checked in iOS 9.3)
alertView.view.tintColor = tintColor
}
#elseif os(OSX)
let alert: NSAlert = NSAlert()
@@ -1309,19 +1328,6 @@ open class Manager : ArmchairManager {
// MARK: PRIVATE Alert View / StoreKit Delegate Methods
#if os(iOS)
open func alertView(_ alertView: UIAlertView, didDismissWithButtonIndex buttonIndex: Int) {
// cancelButtonIndex is set to -1 to show the cancel button up top, but a tap on it ends up here with index 0
if (alertView.cancelButtonIndex == buttonIndex || 0 == buttonIndex) {
// they don't want to rate it
dontRate()
} else if (showsRemindButton() && 1 == buttonIndex) {
// remind them later
remindMeLater()
} else {
// they want to rate it
_rateApp()
}
}
//Delegate call from the StoreKit view.
open func productViewControllerDidFinish(_ viewController: SKStoreProductViewController!) {
@@ -1330,23 +1336,23 @@ open class Manager : ArmchairManager {
//Close the in-app rating (StoreKit) view and restore the previous status bar style.
fileprivate func closeModalPanel() {
let usedAnimation = usesAnimation
if modalPanelOpen {
UIApplication.shared.setStatusBarStyle(currentStatusBarStyle, animated:usesAnimation)
let usedAnimation = usesAnimation
modalPanelOpen = false
// get the top most controller (= the StoreKit Controller) and dismiss it
if let presentingController = UIApplication.shared.keyWindow?.rootViewController {
if let topController = Manager.topMostViewController(presentingController) {
topController.dismiss(animated: usesAnimation) {
if let closure = self.didDismissModalViewClosure {
closure(usedAnimation)
}
}
topController.dismiss(animated: usesAnimation) {}
currentStatusBarStyle = UIStatusBarStyle.default
}
}
}
if let closure = self.didDismissModalViewClosure {
closure(usedAnimation)
}
}
#elseif os(OSX)
@@ -1440,8 +1446,8 @@ open class Manager : ArmchairManager {
UIApplication.shared.openURL(url)
}
}
// Check for iOS simulator
#if (arch(i386) || arch(x86_64)) && os(iOS)
#if targetEnvironment(simulator)
debugLog("iTunes App Store is not supported on the iOS simulator.")
debugLog(" - We would have went to \(reviewURLString()).")
debugLog(" - Try running on a test-device")
@@ -1462,10 +1468,14 @@ open class Manager : ArmchairManager {
}
fileprivate func reviewURLString() -> String {
let template = reviewURLTemplate
#if os(iOS)
let template = operatingSystemVersion >= 11 ? reviewURLTemplateiOS11 : reviewURLTemplate
#elseif os(OSX)
let template = reviewURLTemplate
#else
#endif
var reviewURL = template.replacingOccurrences(of: "APP_ID", with: "\(appID)")
reviewURL = reviewURL.replacingOccurrences(of: "AFFILIATE_CODE", with: "\(affiliateCode)")
reviewURL = reviewURL.replacingOccurrences(of: "AFFILIATE_CAMPAIGN_CODE", with: "\(affiliateCampaignCode)")
return reviewURL
}
@@ -1712,11 +1722,11 @@ open class Manager : ArmchairManager {
private static func getRootViewController() -> UIViewController? {
if var window = UIApplication.shared.keyWindow {
if window.windowLevel != UIWindowLevelNormal {
if window.windowLevel != UIWindow.Level.normal {
let windows: NSArray = UIApplication.shared.windows as NSArray
for candidateWindow in windows {
if let candidateWindow = candidateWindow as? UIWindow {
if candidateWindow.windowLevel == UIWindowLevelNormal {
if candidateWindow.windowLevel == UIWindow.Level.normal {
window = candidateWindow
break
}
@@ -1752,8 +1762,11 @@ open class Manager : ArmchairManager {
if let alert = ratingAlert {
debugLog("Hiding Alert")
#if os(iOS)
if alert.isVisible {
alert.dismiss(withClickedButtonIndex: alert.cancelButtonIndex, animated: false)
let isAlertVisible = alert.isViewLoaded && alert.view.window != nil
if isAlertVisible {
alert.dismiss(animated: false, completion: {
self.dontRate()
})
}
#elseif os(OSX)
if let window = NSApplication.shared.keyWindow {
@@ -1761,7 +1774,7 @@ open class Manager : ArmchairManager {
parent.endSheet(window)
}
}
#else
#endif
ratingAlert = nil
@@ -1819,9 +1832,9 @@ open class Manager : ArmchairManager {
fileprivate func setupNotifications() {
#if os(iOS)
NotificationCenter.default.addObserver(self, selector: #selector(Manager.appWillResignActive(_:)), name: NSNotification.Name.UIApplicationWillResignActive, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationDidFinishLaunching(_:)), name: NSNotification.Name.UIApplicationDidFinishLaunching, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationWillEnterForeground(_:)), name: NSNotification.Name.UIApplicationWillEnterForeground, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Manager.appWillResignActive(_:)), name: UIApplication.willResignActiveNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationDidFinishLaunching(_:)), name: UIApplication.didFinishLaunchingNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationWillEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil)
#elseif os(OSX)
NotificationCenter.default.addObserver(self, selector: #selector(Manager.appWillResignActive(_:)), name: NSApplication.willResignActiveNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(Manager.applicationDidFinishLaunching(_:)), name: NSApplication.didFinishLaunchingNotification, object: nil)

View File

@@ -87,9 +87,9 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
939461E32333725B00C8A00E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
939461E42333725B00C8A00E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
E60FA81719C9219600179D70 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = "<group>"; };
E66F854919D0A7C600AD80EC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
E6A0AF5D19C9C89E00C3A7DC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/Main.storyboard; sourceTree = "<group>"; };
E6C49DC519C23C91006A4544 /* iOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
E6E5F4C219C8E18E008A6C1B /* armchair.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = armchair.jpg; sourceTree = "<group>"; };
E6E5F4CC19C8E388008A6C1B /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
@@ -188,22 +188,23 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1100;
ORGANIZATIONNAME = Armchair;
TargetAttributes = {
F8111E0419A951050040E7D1 = {
CreatedOnToolsVersion = 6.0;
DevelopmentTeam = 9H3S97RP4K;
LastSwiftMigration = 0830;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = F8111E0019A951050040E7D1 /* Build configuration list for PBXProject "iOS Example" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = F8111DFC19A951050040E7D1;
productRefGroup = F8111DFC19A951050040E7D1;
@@ -303,7 +304,7 @@
E66F854819D0A7C600AD80EC /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
E66F854919D0A7C600AD80EC /* en */,
939461E42333725B00C8A00E /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
@@ -311,7 +312,7 @@
F8111E1019A951050040E7D1 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
E6A0AF5D19C9C89E00C3A7DC /* en */,
939461E32333725B00C8A00E /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
@@ -323,6 +324,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -331,12 +333,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -377,6 +381,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
@@ -385,12 +390,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -425,7 +432,6 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
@@ -436,7 +442,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "iOS Example";
PROVISIONING_PROFILE = "";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -445,7 +451,6 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = "$(SRCROOT)/Example/Info-iOS.plist";
@@ -454,7 +459,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "iOS Example";
PROVISIONING_PROFILE = "";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};