Armchair

所属分类:虚拟/增强现实-VR/AR
开发工具:Swift
文件大小:625KB
下载次数:0
上传日期:2022-11-06 14:42:52
上 传 者sh-1993
说明:  Swift中一个简单而强大的iOS和OSX应用程序评论管理器
(A simple yet powerful App Review Manager for iOS and OSX in Swift)

文件列表:
.swift-version (4, 2020-12-04)
Armchair.podspec (1708, 2020-12-04)
Armchair.xcodeproj (0, 2020-12-04)
Armchair.xcodeproj\project.pbxproj (41525, 2020-12-04)
Armchair.xcodeproj\project.xcworkspace (0, 2020-12-04)
Armchair.xcodeproj\project.xcworkspace\contents.xcworkspacedata (153, 2020-12-04)
Armchair.xcodeproj\xcshareddata (0, 2020-12-04)
Armchair.xcodeproj\xcshareddata\xcschemes (0, 2020-12-04)
Armchair.xcodeproj\xcshareddata\xcschemes\Armchair.xcscheme (3552, 2020-12-04)
Armchair.xcodeproj\xcshareddata\xcschemes\ArmchairMac.xcscheme (2762, 2020-12-04)
Armchair.xcworkspace (0, 2020-12-04)
Armchair.xcworkspace\contents.xcworkspacedata (302, 2020-12-04)
Armchair.xcworkspace\xcshareddata (0, 2020-12-04)
Armchair.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (238, 2020-12-04)
Example (0, 2020-12-04)
Example\AppDelegate.swift (2575, 2020-12-04)
Example\Base.lproj (0, 2020-12-04)
Example\Base.lproj\LaunchScreen.storyboard (5996, 2020-12-04)
Example\Base.lproj\Main.storyboard (15789, 2020-12-04)
Example\Base.lproj\MainMenu.xib (61218, 2020-12-04)
Example\Images.xcassets (0, 2020-12-04)
Example\Images.xcassets\AppIcon.appiconset (0, 2020-12-04)
Example\Images.xcassets\AppIcon.appiconset\Contents.json (1590, 2020-12-04)
Example\Images.xcassets\LaunchImage.launchimage (0, 2020-12-04)
Example\Images.xcassets\LaunchImage.launchimage\Contents.json (739, 2020-12-04)
Example\Info-Mac.plist (1944, 2020-12-04)
Example\Info-iOS.plist (2534, 2020-12-04)
Example\ViewController.swift (9544, 2020-12-04)
Example\armchair.jpg (263361, 2020-12-04)
Example\icon.png (262062, 2020-12-04)
Example\logo.png (25902, 2020-12-04)
Example\main.m (245, 2020-12-04)
LICENSE (1091, 2020-12-04)
Localization (0, 2020-12-04)
Localization\ar.lproj (0, 2020-12-04)
Localization\ar.lproj\ArmchairLocalizable.strings (432, 2020-12-04)
Localization\arm.lproj (0, 2020-12-04)
Localization\arm.lproj\ArmchairLocalizable.strings (600, 2020-12-04)
... ...

![Armchair: A simple yet powerful App Review Manager for iOS and OSX in Swift](https://raw.githubusercontent.com/UrbanApps/Armchair/assets/armchair.png) Armchair is a simple yet powerful App Review Manager for iOS and OSX written in Swift. It is based on [UAAppReviewManager](https://github.com/UrbanApps/UAAppReviewManager) and [Appirater](https://github.com/arashpayan/appirater) but completely rewritten for apps that want to benefit from the power of this new language. ## Why Armchair? The average end-user will only write a review if something is wrong with your App. This leads to an unfairly negative skew in the ratings, when the majority of satisfied customers don’t leave reviews and only the dissatisfied ones do. In order to counter-balance the negatives, Armchair prompts the user to write a review, but only after the developer knows they are satisfied. For example, you may only show the popup if the user has been using it for more than a week, and has done at least 5 significant events (the core functionality of your App). The rules are fully customizable for your App and easy to setup. Here are just a few of the things that make Armchair better than the other rating frameworks and repos: While the tests to prove it seem to be missing, Apple claims that Swift is a lot faster than Objective-C. Enjoy the benefits of using a framework built entirely in Swift, and work with a familiar syntax without having to deal with bridging headers or other Objective-C shenanigans. ##### Both iOS and OS X Support Many developers publish apps for both iOS and OS X. Out of the box, Armchair supports iOS and OS X apps that are sold through the respective App Stores. The API is the same for both with the exception of a handful of iOS specific functions, described in [Usage](#usage). ##### Fully Configurable at Runtime Armchair is fully configurable, even at runtime. This means that the prompt you display can be dynamic, based on the end-user's score or status. The rules that govern how and when it should be shown can all be set the same way, allowing you to have the most control over the presentation and timing of your review prompt. ##### Default Localizations for Dozens of Languages If you choose to use the default Armchair strings for your app, you will get the added benefit of localization in over 32 languages. Otherwise, customization is easy, and overriding the localization strings is a piece of cake, simply by including your own strings files and letting Armchair know. ##### Prevent Rating Prompts on Different Devices If your users have the same app, same version installed on two different devices, you really shouldn't pop up the same rating prompt on each one. Armchair allows you to optionally keep your user's usage stats in the `NSUbiquitousKeyValueStore`, or any other store you want to keep track of syncing yourself to prevent dual prompts. ##### Uses UIApplication/NSApplication Lifecycle Notifications Armchair listens for ApplicationDidLaunch and ApplicationWillEnterForeground notifications. This allows you to worry about your app, and not about tracking in your application delegate functions, so there are fewer lines of code for you to write. ##### Easy to Setup It takes only 1 line of code to get started. Armchair is very powerful when digging under the hood, but also very simple to setup for standard configurations. ##### iTunes Affiliate Codes If you are an iTunes Affiliate, you can easily setup Armchair to use your code and campaign. Full disclosure: If you aren't an iTunes Affiliate, the default code used in the app is the author's. It is better to have somebody's code rather than nobody's, so please leave it at the default setting if you aren't going to set one yourself. Think of it as a small token of appreciation for creating and open-sourcing Armchair. ##### Ready For Primetime Armchair is clean code, well documented and well organized. It is easy to understand the logic flow and the purpose of each function. It doesn't mix logic up randomly between Class functions and Instance functions. Its API is clean and predictable. --- ![The Golden Rule](https://raw.githubusercontent.com/UrbanApps/Armchair/assets/golden-rule.png) 1. Don't be a dick. Seriously. It is easy to piss off your customers by not really considering how the prompting popup interrupts their flow. This was widely discussed in early 2014 by many well-known tech bloggers and caused a big hooplah in the community. We think that having an app review prompt is fine, but only when presented at the right time, and only when you don't ask too frequently. The criteria for the smart display of a prompt varies for each app, but consider adding one at the end of a positive user workflow, rather than the beginning. Tweak the variables so that you don't annoy your customers, and you will enjoy the maximum benefit from your app review prompting. --- ## Screenshots ![iOS Example Shots](https://raw.githubusercontent.com/UrbanApps/Armchair/assets/armchair-iOS.png) ![Mac Example Shots](https://raw.githubusercontent.com/UrbanApps/Armchair/assets/armchair-OSX.png) ## Requirements - Xcode 6.1+ - iOS 8.0+, Mac OS X 10.10+ ## Installation > **Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks (10.9).** > > Armchair is no longer supported on iOS 7 due to the lack of support for frameworks. Without frameworks, running Travis-CI against iOS 7 would require a second duplicated test target. The separate test suite would need to import all the Swift files and the tests would need to be duplicated and re-written. This split would be too difficult to maintain to ensure the highest possible quality of the Armchair ecosystem. ### CocoaPods [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: ```bash $ gem install cocoapods ``` > CocoaPods 0.39.0+ is required to build Armchair. To integrate Armchair into your Xcode project using CocoaPods, specify it in your `Podfile`: ```ruby source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' platform :osx, '10.10' use_frameworks! pod 'Armchair', '>= 0.3' #Add the following in order to automatically set debug flags for armchair in debug builds post_install do |installer| installer.pods_project.targets.each do |target| if target.name == 'Armchair' target.build_configurations.each do |config| if config.name == 'Debug' config.build_settings['OTHER_SWIFT_FLAGS'] = '-DDebug' else config.build_settings['OTHER_SWIFT_FLAGS'] = '' end end end end end ``` Then, run the following command: ```bash $ pod install ``` ### Carthage [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. Once you [install](https://github.com/Carthage/Carthage#installing-carthage) Carthage, you can integrate Armchair into your Xcode project by specifying it in your `Cartfile`: ```ogdl github "UrbanApps/Armchair" ``` Run `carthage update` to build the framework and drag the built `Armchair.framework` into your Xcode project. ## Usage ### Simple 1-line Setup Armchair includes sensible defaults as well as reads data from your localized, or unlocalized `info.plist` to set itself up. While everything is configurable, the only **required** item to configure is your App Store ID. This call is the same for iOS and Mac apps, and should be made as part of your App Delegate's `initialize()` function ```swift Armchair.appID("12345678") ``` That's it to get started. Setting Armchair up with this line uses some sensible default criterion (detailed below) and will present a rating prompt whenever they are met. ### Custom Configuration Optionally, if you are using significant events in your app to track when the user does something of significance, add this line to any place where this event happens, such as a `levelDidFinish` function, or `userDidUploadPhoto` function. ```swift Armchair.userDidSignificantEvent(true) ``` In order for this to mean anything to Armchair, you also have to set the threshold for significant events. Typically, this, and all other logic configuration settings, should be made as part of your App Delegate's `initialize()` function so it can get the notifications on app launch. ```swift Armchair.significantEventsUntilPrompt(5) ``` As mentioned above, the `appID` is the only required item to configure. It is used to generate the URL that will link to the page. Most often, this is configured to the App that is currently running, but there may be an instance where you want to set it to another app, such as in an App that reviews other Apps. ```swift // GETTER Armchair.appID() -> String // SETTER Armchair.appID(appID: String) ``` ##### Display Strings The `appName` is used in several places on the review prompt popup. It can be configured here to customize your message without losing any of the default localizations. By default, Armchair will read the value from your localized, or unlocalized `info.plist`, but you can set it specifically if you want. ```swift // GETTER Armchair.appName() -> String // SETTER Armchair.appName(appName: String) ``` The `reviewTitle` is the title to use on the review prompt popup. It's default value is a localized "Rate \", but you can set it to anything you want. ```swift // GETTER Armchair.reviewTitle() -> String // SETTER Armchair.reviewTitle(reviewTitle: String) ``` The `reviewMessage` is the message to use on the review prompt popup. It's default value is a localized "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!", but you can change it specifically if you want. However, if you do change it, you will need to provide your own localization strings as shown farther down below. ```swift // GETTER Armchair.reviewMessage() -> String // SETTER Armchair.reviewMessage(reviewMessage: String) ``` The `cancelButtonTitle` is the button title to use on the review prompt popup for the "Cancel" action. Its default value is a localized "No, Thanks" ```swift // GETTER Armchair.cancelButtonTitle() -> String // SETTER Armchair.cancelButtonTitle(cancelButtonTitle: String) ``` The `rateButtonTitle` is the button title to use on the review prompt popup for the "Rate" action. Its default value is a localized "Rate \" ```swift // GETTER Armchair.rateButtonTitle() -> String // SETTER Armchair.rateButtonTitle(rateButtonTitle: String) ``` The `remindButtonTitle` is the button title to use on the review prompt popup for the "Remind" action. Its default value is a localized "Remind me later" ```swift // GETTER Armchair.remindButtonTitle() -> String // SETTER Armchair.remindButtonTitle(remindButtonTitle: String) ``` ##### Logic The `daysUntilPrompt` configuration determines how many days the users will need to have the same version of your App installed before they will be prompted to rate it. It's default is 30 days. ```swift // GETTER Armchair.daysUntilPrompt() -> UInt // SETTER Armchair.daysUntilPrompt(daysUntilPrompt: UInt) ``` The `usesUntilPrompt` configuration determines how many times the user will need to have 'used' the same version of you App before they will be prompted to rate it. Its default is 20 uses. ```swift // GETTER Armchair.usesUntilPrompt() -> UInt // SETTER Armchair.usesUntilPrompt(usesUntilPrompt: UInt) ``` An example of a 'use' would be if the user launched the app, or brings it to the foreground. Armchair keeps track of these internally by listening to UIApplication/NSApplication lifecycle notifications. As discussed briefly above, the `significantEventsUntilPrompt` configuration determines how many "significant events" the user will need to have before they will be prompted to rate the App. It defaults to 0 significant events. ```swift // GETTER Armchair.significantEventsUntilPrompt() -> UInt // SETTER Armchair.significantEventsUntilPrompt(significantEventsUntilPrompt: UInt) ``` A significant event can be anything you want to be in your app. In a telephone app, a significant event might be placing or receiving a call. In a game, it might be beating a level or a boss. This is just another layer of filtering that can be used to make sure that only the most loyal of your users are being prompted to rate you on the app store. If you leave this at a value of 0 (default), then this won't be a criterion used for rating. To tell Armchair that the user has performed a significant event, call the function: ```swift Armchair.userDidSignificantEvent(canPromptForRating: Bool) ``` The `daysBeforeReminding` configuration determines how many days Armchair will wait before reminding the user to rate again, should they select the "Remind Me Later" option on the first alert. It defaults to 1 day. A value of 0 will remove the "Remind Me Later" button and disable this feature. ```swift // GETTER Armchair.daysBeforeReminding() -> UInt // SETTER Armchair.daysBeforeReminding(daysBeforeReminding: UInt) ``` The `tracksNewVersions` configuration determines whether or not Armchair should track a new app version if detected. By default, Armchair tracks **all** new bundle versions. When it detects a new version, it resets the values saved for usage, significant events, popup shown, user action etc... By setting this to `NO` Armchair will **only** track the version it was initialized with, or the one it last knew about. If this setting is set to `true`, Armchair will reset itself after each new version detection. Its default value is `true`. ```swift // GETTER Armchair.tracksNewVersions() -> Bool // SETTER Armchair.tracksNewVersions(tracksNewVersions: Bool) ``` The `shouldPromptIfRated` configuration determines whether or not to show the review prompt to users who have rated the app once before. This setting is a little like the `tracksNewVersions` setting, but a little less nuclear. Setting this to `false` will cause new users of the app to get the popup, but won't ask users who have already been asked for a popup in the past. This is useful if you release small bug-fix versions and don't want to pester your existing users with popups for every minor version, but want to ensure new users get prompted for a review. For example, you might set this to false for every minor build, then when you push a major version upgrade, leave it as true to ask for a rating again. Its default value is `true`. ```swift // GETTER Armchair.shouldPromptIfRated() -> Bool // SETTER 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 // GETTER Armchair.useMainAppBundleForLocalizations() -> Bool // SETTER Armchair.useMainAppBundleForLocalizations(useMainAppBundleForLocalizations: Bool) ``` ##### Affiliate Codes The `affiliateCode` configuration is optional and is used to configure with the review URL. If you are an Apple Affiliate, enter your code here. If none is set, the author's code will be used as it is better to be set as something rather than nothing. If you want to thank me for making Armchair, feel free to leave this value at it's default. ```swift // GETTER Armchair.affiliateCode() -> String // SETTER Armchair.affiliateCode(affiliateCode: String) ``` The `affiliateCampaignCode` configuration is optional and is used to configure the review URL. It provides context to the affiliate code and defaults to "Armchair-\". ```swift // GETTER Armchair.affiliateCampaignCode() -> String // SETTER Armchair.affiliateCampaignCode(affiliateCampaignCode: String) ``` ##### Debug Mode The `debugEnabled` configuration is useful for testing how your review prompt popup looks and for testing. Setting it to `true` will show the Armchair alert every time by tricking the app into thinking the conditions for a prompt have been met. Calling this function in a production build (determined when `Debug` swift compiler flag is *not* defined) has no effect. In App Store builds, you don't have to worry about accidentally leaving debug on. The default value of `debugEnabled` is `false`. ```swift // GETTER Armchair.debugEnabled() -> Bool // SETTER Armchair.debugEnabled(debugEnabled: Bool) ``` ##### Logging Armchair allows you to set a closure to capture debug log and to plug in the desired logging framework. ```swift Armchair.logger(logger: ArmchairLogger) ``` ##### iOS Only Configuration These configuration functions only make sense for iOS builds due to their dependency on iOS-only frameworks and functions. The `usesAnimation` configuration determines whether or not Armchair uses animation when presenting a modal `SKStoreProductViewController`. Its default value is `true`. ```swift // GETTER Armchair.usesAnimation() -> Bool // SETTER Armchair.usesAnimation(usesAnimation: Bool) ``` The `tintColor` configuration specifies a tint color that is applied to UIAlertController when `usesAlertController` is true. Its default value is `nil`, which means that tint color is not customized. ```swift // GETTER Armchair.tintColor() -> UIColor? // SETTER Armchair.tintColor(tintColor: UIColor?) ``` The `usesAlertController` configuration determines whether or not Armchair uses a UIAlertController when presenting an alert on iOS 8. By default, we do not use it because the reordering of buttons is not possible in the alert controller as of iOS 8.0. It's default value is `false`. Changing this value does not affect iOS 7 at all. ```swift // GETTER Armchair.usesAlertController() -> Bool // SETTER Armchair.usesAlertController(usesAnimation: Bool) ``` The `opensInStoreKit` configuration determines if Armchair will open the App Store link inside the App using a `SKStoreProductViewController`. By default, this is `false` on iOS 7, and `true` on iOS 8. ```swift // GETTER Armchair.opensInStoreKit() -> Bool // SETTER Armchair.opensInStoreKit(opensInStoreKit: Bool) ``` There are 2 reasons why the default is `false` on iOS 7. - The SKStoreProductViewController __does not allow the user to write a review__ (as of iOS 7)! - iTunes affiliate codes do not work (as of iOS 7) inside SKStoreProductViewController. ### Armchair Functions `userDidSignificantEvent(canPromptForRating: Bool)` tells Armchair that the user performed a significant event. A s ... ...

近期下载者

相关文件


收藏者