Skip to content

Commit

Permalink
Merge branch 'release/v3.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gPinato committed Mar 28, 2017
2 parents 7891f2d + 617f4e9 commit cb46a65
Show file tree
Hide file tree
Showing 24 changed files with 113 additions and 53 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## 3.4.0

#### Added
- Form caching. Forms loaded from our servers will be now cached locally and will be correctly displayed even when the user is offline.


#### Updated

- Updated SDK to be compatible with Swift 3.1

#### Removed

- Removed some unecessary logs


## 3.3.2

#### Fixed
Expand Down
16 changes: 9 additions & 7 deletions Readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ Usabilla for Apps allows you to collect feedback from your user with great ease

Take a look at our [Wiki](https://github.com/usabilla/usabilla-u4a-ios-sdk/wiki) for a complete and in depth guide on how to install and customize the SDK.

## Latest changes in v3.3.2
## Latest changes in v3.4.0

#### Fixed
#### Added
- Form caching. Forms loaded from our servers will be now cached locally and will be correctly displayed even when the user is offline.

- Redirect to App Store button not working correctly
- The mood control now correctly displays the 2 or 3 options mode
- The feedback result access level has been set to public

#### Updated
- Added the `form` parameter to `formDidClose`

- Updated SDK to be compatible with Swift 3.1

#### Removed

- Removed some unecessary logs

## Requirements

Expand Down Expand Up @@ -199,7 +201,7 @@ The **abandonedPageIndex** is only set if the user cancels the form before submi
Here is a sample implementation :

```swift
func formDidClose(formID: String, with feedbackResults: [FeedbackResult]) {
func formDidClose(_ form: UINavigationController, formID: String, with feedbackResults: [FeedbackResult]){
guard let feedback = feedbackResults.first else {
return
}
Expand Down
Binary file modified UsabillaFeedbackForm.framework/Assets.car
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
// Generated by Apple Swift version 3.1 (swiftlang-802.0.48 clang-802.0.38)
#pragma clang diagnostic push

#if defined(__has_include) && __has_include(<swift/objc-prologue.h>)
Expand Down Expand Up @@ -68,6 +68,11 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
#else
# define SWIFT_NOESCAPE
#endif
#if defined(__has_attribute) && __has_attribute(warn_unused_result)
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
# define SWIFT_WARN_UNUSED_RESULT
#endif
#if !defined(SWIFT_CLASS_EXTRA)
# define SWIFT_CLASS_EXTRA
#endif
Expand Down Expand Up @@ -114,6 +119,18 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
#if !defined(SWIFT_UNAVAILABLE)
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
#endif
#if !defined(SWIFT_UNAVAILABLE_MSG)
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
#endif
#if !defined(SWIFT_AVAILABILITY)
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
#endif
#if !defined(SWIFT_DEPRECATED)
# define SWIFT_DEPRECATED __attribute__((deprecated))
#endif
#if !defined(SWIFT_DEPRECATED_MSG)
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
#endif
#if defined(__has_feature) && __has_feature(modules)
@import Foundation;
@import UIKit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,35 @@ open class UsabillaFeedbackForm {
open class func load() {
_ = SubmissionManager.shared // init the singleton to send persisted feedback
}

open class func removeCachedForms() {
CacheManager.shared.removeAllCachedForms()
}

open class func loadFeedbackForm(_ appId: String, screenshot: UIImage? = nil, customVariables: [String: Any]? = nil, themeConfig: UsabillaThemeConfigurator = UsabillaThemeConfigurator()) {
NetworkManager.getFormJsonFromServer(appId, screenshot: screenshot, customVariables: customVariables, themeConfig: themeConfig)

FormStore.loadForm(id: appId, screenshot: screenshot, customVariables: customVariables, themeConfig: themeConfig).then { form in
UsabillaFeedbackForm.viewForForm(form: form, customeVariables: customVariables)
}.catch {_ in
if let defaulForm = FormStore.loadDefaultForm(appId, screenshot: screenshot, customVariables: customVariables, themeConfig: themeConfig) {
UsabillaFeedbackForm.viewForForm(form: defaulForm, customeVariables: customVariables)
}
}
}

private static func viewForForm(form: FormModel, customeVariables: [String: Any]? = nil) {
let storyboard = UIStoryboard(name: "USAStoryboard", bundle: Bundle(identifier: "com.usabilla.UsabillaFeedbackForm"))
guard let base = storyboard.instantiateViewController(withIdentifier: "base") as? UINavigationController,
let formController = base.childViewControllers[0] as? FormViewController else {
return
}

formController.initWithFormModel(form)
formController.customVars = customeVariables

DispatchQueue.main.async {
UsabillaFeedbackForm.delegate?.formLoadedCorrectly(base, active: true)
}
}

open class func takeScreenshot(_ view: UIView) -> UIImage? {
Expand Down
Binary file modified UsabillaFeedbackForm.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified UsabillaFeedbackForm.framework/UsabillaFeedbackForm
Binary file not shown.
Loading

0 comments on commit cb46a65

Please sign in to comment.