https://github.com/stanwood/stanwooddialog_ios
An app rating dialog framework that links to the iTunes AppStore.
https://github.com/stanwood/stanwooddialog_ios
ios
Last synced: 4 months ago
JSON representation
An app rating dialog framework that links to the iTunes AppStore.
- Host: GitHub
- URL: https://github.com/stanwood/stanwooddialog_ios
- Owner: stanwood
- License: mit
- Created: 2017-11-20T12:46:56.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-02T04:55:24.000Z (over 5 years ago)
- Last Synced: 2025-06-22T06:05:03.486Z (4 months ago)
- Topics: ios
- Language: Swift
- Homepage:
- Size: 2.67 MB
- Stars: 3
- Watchers: 9
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# StanwoodDialog
[]()
[]()
[]()
[](https://codeclimate.com/github/stanwood/StanwoodDialog_iOS/maintainability)
[](https://app.bitrise.io/app/200a49178c1c4df4)
[](http://cocoapods.org/pods/StanwoodDialog)
[](https://travis-ci.org/stanwood/StanwoodDialog_iOS)
[](https://stanwood.github.io/StanwoodDialog_iOS/)## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Installation
StanwoodDialog_iOS is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'StanwoodDialog'
```## Usage
Add `import StanwoodDialog` and call the method bellow from wherever you are calling `AppDelegate`'s `applicationDidBecomeAvailable`:
If you wish to specify your string locally, you can add them here
```swift
RatingDialog.builder()
.set(paragraph1: "text1")
.set(paragraph2: "text2")
.set(paragraph3: "text3")
.set(paragraph4: "text4")
.set(cancelText: "cancel")
.set(okText: "accept")
.set(faceUrl: "faceUrlString")
.set(bannerUrl: "bannerUrlString")
.set(tintColor: .blue)
.set(appID: "284815942")
.set(rootView: UIApplication.shared.keyWindow!)
.buildAndShowIfNeeded { (state) in
switch state {
case .didCancel:
print("didCancel")
case .didShowInitialRateMe:
print("didShowInitialRateMe")
case .didShowAppleReviewController:
print("didShowAppleReviewController")
case .didSendToStore:
print("didSendToStore")
}
}
```
Ideally you would be fetching each one of these parameters remotely. For instance, from Firebase RemoteConfig to do some A/B testing and/or from a service like lokalise.co to provide internationalization.If you want to use values direct from Firebase RemoteConfig, you can use the rquired keys below to clean up your code.
With completion, as little as:
```swift
RatingDialog.builder().buildAndShowIfNeeded { (state) in
switch state {
case .didCancel:
print("didCancel")
case .didShowInitialRateMe:
print("didShowInitialRateMe")
case .didShowAppleReviewController:
print("didShowAppleReviewController")
case .didSendToStore:
print("didSendToStore")
}
}
```
Without completion:
```swift
RatingDialog.builder().buildAndShowIfNeeded()
```Required RemoteConfig keys
```
"ios_app_id" - ID od application in the store
"rate_dialog_text" - First line of text
"rate_dialog_text_2" - Second line of text
"rate_dialog_text_3" - Third line of text
"rate_dialog_text_4" - Fourth line of text
"rate_dialog_launch_count" - Number of launches required until dialog is shown
"rate_dialog_face_url" - Url string to load a face image
"rate_dialog_banner_url" - Url string to load a banner image
"rate_dialog_cancel_button" - Cancel button title
"rate_dialog_ok_button" - Ok button title
```
When using the RemoteConfig keys, ensure your config is set before initialising the dialog, otherwise the values will be wrongIf you don't have a URL for the profile and banner images, you may upload these to Firebase Storage (go to Store section in Firebase and click on [Upload Image]):
* the profile image should be 300x300 pixels (this will cover the 3 variations for 100x100 points)
* the banner image should be 300x1125 pixels (this will cover the 3 variations for 100x375 points)
## Test
Using a negative value in `RatingDialog.shouldShow(onLaunch: -1)` will result in the Rating Dialog being shown everytime.Also, while in `Debug`, the launch count doesn't need 30 minutes from the last launch to increase its count.
## Author
Eugène Peschard, eugene.peschard@stanwood.io
## License
StanwoodDialog is under MIT licence. See the [LICENSE](https://github.com/stanwood/Stanwood_Dialog_iOS/blob/master/LICENSE "Copyright © 2018 stanwood GmbH") file for more info.