diff --git a/plugin.xml b/plugin.xml index 709cd91..cff2dcf 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="2.0.4"> Telerik AppFeedback This plugin allows the app to include Telerik AppFeedback functionality on device shake. diff --git a/src/ios/TLRKFeedback.m b/src/ios/TLRKFeedback.m index ea11d5d..2ac6543 100644 --- a/src/ios/TLRKFeedback.m +++ b/src/ios/TLRKFeedback.m @@ -7,11 +7,16 @@ #import "TLRKFeedback.h" #import "CDVDevice.h" -#import +#import #import @implementation TLRKFeedback +static NSString * const kFeedbackSentAlertTitleSettingName = @"feedbackSentAlertTitle"; +static NSString * const kFeedbackSentAlertTextSettingName = @"feedbackSentAlertText"; +static NSString * const kFeedbackTitleSettingName = @"feedbackTitle"; +static NSString * const kIOSFeedbackOptionsKeyName = @"iOS"; + @synthesize webView; -(void)initialize: (CDVInvokedUrlCommand *)command @@ -34,6 +39,31 @@ -(void)initialize: (CDVInvokedUrlCommand *)command uid = objc_msgSend(objc_msgSend(UIDevice.currentDevice, identifierForVendorSEL), @selector(UUIDString)); } + // iOS localization specific options + // using UTF8 strings to allow displaying Chinese, Cyrillic, etc. chars + NSDictionary *feedbackOptions = command.arguments.count > 2 ? command.arguments[2] : nil; + + NSDictionary *iOSLocalizationOptions = [feedbackOptions valueForKey:kIOSFeedbackOptionsKeyName]; + + NSString *feedbackSentAlertTitle = [iOSLocalizationOptions valueForKey:kFeedbackSentAlertTitleSettingName]; + if (feedbackSentAlertTitle !=nil && ![feedbackSentAlertTitle isKindOfClass:[NSNull class]]) { + const char *cString = [feedbackSentAlertTitle UTF8String]; + [TKFeedback feedbackSettings].feedbackSentAlertTitle = [NSString stringWithUTF8String:cString]; + } + + NSString *feedbackSentAlertText = [iOSLocalizationOptions valueForKey:kFeedbackSentAlertTextSettingName]; + if (feedbackSentAlertText != nil && ![feedbackSentAlertText isKindOfClass:[NSNull class]]) { + const char *cString = [feedbackSentAlertText UTF8String]; + [TKFeedback feedbackSettings].feedbackSentAlertText = [NSString stringWithUTF8String:cString]; + } + + NSString *feedbackTitle = [iOSLocalizationOptions valueForKey:kFeedbackTitleSettingName]; + if (feedbackTitle != nil && ![feedbackTitle isKindOfClass:[NSNull class]]) { + const char *cString = [feedbackTitle UTF8String]; + [TKFeedback feedbackSettings].feedbackTitle = [NSString stringWithUTF8String:cString]; + } + // end iOS localization options + TKFeedback.dataSource = [[TKPlatformFeedbackSource alloc] initWithKey:apiKey uid:uid apiBaseURL:apiUrl parameters:NULL]; [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK] callbackId:command.callbackId]; diff --git a/src/ios/TelerikAppFeedback.framework/.DS_Store b/src/ios/TelerikAppFeedback.framework/.DS_Store new file mode 100644 index 0000000..2fc2f21 Binary files /dev/null and b/src/ios/TelerikAppFeedback.framework/.DS_Store differ diff --git a/src/ios/TelerikAppFeedback.framework/Headers/TKFeedback.h b/src/ios/TelerikAppFeedback.framework/Headers/TKFeedback.h index 8bd0a88..937a50b 100644 --- a/src/ios/TelerikAppFeedback.framework/Headers/TKFeedback.h +++ b/src/ios/TelerikAppFeedback.framework/Headers/TKFeedback.h @@ -5,6 +5,8 @@ // Copyright (c) 2014 Telerik. All rights reserved. // +#import "TKFeedbackSettings.h" + @protocol TKFeedbackDataSource; @interface TKFeedback : NSObject @@ -21,4 +23,6 @@ + (BOOL)feedbackIsShown; ++ (TKFeedbackSettings*) feedbackSettings; + @end diff --git a/src/ios/TelerikAppFeedback.framework/Headers/TKFeedbackController.h b/src/ios/TelerikAppFeedback.framework/Headers/TKFeedbackController.h index fa0de57..e3f9d42 100644 --- a/src/ios/TelerikAppFeedback.framework/Headers/TKFeedbackController.h +++ b/src/ios/TelerikAppFeedback.framework/Headers/TKFeedbackController.h @@ -17,7 +17,7 @@ Initializes the feedback controller. @param contentController The view controller that can be used as a root view controller in the application. */ -- (id)initWithContentController:(UIViewController *)contentController; +- (instancetype)initWithContentController:(UIViewController *)contentController; /** The view controller that contain root view controller (read-only). diff --git a/src/ios/TelerikAppFeedback.framework/Headers/TKFeedbackSettings.h b/src/ios/TelerikAppFeedback.framework/Headers/TKFeedbackSettings.h new file mode 100644 index 0000000..77d3954 --- /dev/null +++ b/src/ios/TelerikAppFeedback.framework/Headers/TKFeedbackSettings.h @@ -0,0 +1,48 @@ +// +// Header.h +// AppFeedback +// +// Created by Deyan Ginev on 8/16/16. +// Copyright © 2016 Telerik. All rights reserved. +// + +#import + +@interface TKFeedbackSettings : NSObject + +/** + Determines if the Alert window at the end of the feedback process is shown. + */ +@property (nonatomic) BOOL showFeedbackSentAlert; + +/** + Determines the title of the Alert window shown at the end of the feedback process. + */ +@property (nonatomic) NSString* feedbackSentAlertTitle; + +/** + Determines the text of the Alert window shown at the end of the feedback process. + */ +@property (nonatomic) NSString* feedbackSentAlertText; + +/** + Determines the title of the feedback window. + */ +@property (nonatomic) NSString* feedbackTitle; + +/** + Determines the text displayed in the button which starts the feedback procedure. + */ +@property (nonatomic) NSString* feedbackMenuSendCaption; + +/** + Determines the text displayed in the button which opens the settings menu of the AppFeedback component. + */ +@property (nonatomic) NSString* feedbackMenuSettingsCaption; + +/** + Determines the text of the button which shows the current feedback items. + */ +@property (nonatomic) NSString* feedbackMenuMyFeedbackCaption; + +@end diff --git a/src/ios/TelerikAppFeedback.framework/Headers/TKPlatformFeedbackSource.h b/src/ios/TelerikAppFeedback.framework/Headers/TKPlatformFeedbackSource.h index 264dd82..f42974f 100644 --- a/src/ios/TelerikAppFeedback.framework/Headers/TKPlatformFeedbackSource.h +++ b/src/ios/TelerikAppFeedback.framework/Headers/TKPlatformFeedbackSource.h @@ -16,14 +16,14 @@ Initializes a new instnace of the object. @param apiKey The apiKey used to connect with Telerik platform. */ -- (id)initWithKey:(NSString *)apiKey; +- (instancetype)initWithKey:(NSString *)apiKey; /** Initializes a new instnace of the object. @param apiKey The apiKey used to connect with Telerik platform. @param uid The user id used to connect with Telerik platform. */ -- (id)initWithKey:(NSString *)apiKey uid:(NSString *)uid; +- (instancetype)initWithKey:(NSString *)apiKey uid:(NSString *)uid; /* Initializes a new instance of the object. @@ -32,7 +32,7 @@ @param apiBaseURL The base url to use when connecting with the server. @param parameters Key/value pairs that will be appended with every query to the server. */ -- (id)initWithKey:(NSString *)apiKey uid:(NSString *)uid apiBaseURL:(NSString *)apiBaseUrl parameters:(NSDictionary*)parameters; +- (instancetype)initWithKey:(NSString *)apiKey uid:(NSString *)uid apiBaseURL:(NSString *)apiBaseUrl parameters:(NSDictionary*)parameters; /** The API key created in the Telerik AppFeedback service for your application. diff --git a/src/ios/TelerikAppFeedback.framework/Headers/AppFeedback.h b/src/ios/TelerikAppFeedback.framework/Headers/TelerikAppFeedback.h similarity index 80% rename from src/ios/TelerikAppFeedback.framework/Headers/AppFeedback.h rename to src/ios/TelerikAppFeedback.framework/Headers/TelerikAppFeedback.h index 44b9104..06373ef 100644 --- a/src/ios/TelerikAppFeedback.framework/Headers/AppFeedback.h +++ b/src/ios/TelerikAppFeedback.framework/Headers/TelerikAppFeedback.h @@ -1,10 +1,12 @@ // -// TelerikUI.h -// TelerikUI +// TelerikAppFeedback.h +// TelerikAppFeedback // // Copyright (c) 2013 Telerik. All rights reserved. // +#import + @interface TelerikAppFeedback : NSObject + (NSString*)versionString; diff --git a/src/ios/TelerikAppFeedback.framework/TelerikAppFeedback b/src/ios/TelerikAppFeedback.framework/TelerikAppFeedback index 446128b..2e3f010 100644 Binary files a/src/ios/TelerikAppFeedback.framework/TelerikAppFeedback and b/src/ios/TelerikAppFeedback.framework/TelerikAppFeedback differ diff --git a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/AppFeedback.h b/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/AppFeedback.h deleted file mode 100644 index 44b9104..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/AppFeedback.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// TelerikUI.h -// TelerikUI -// -// Copyright (c) 2013 Telerik. All rights reserved. -// - -@interface TelerikAppFeedback : NSObject - -+ (NSString*)versionString; - -@end - -#import "TKFeedbackController.h" -#import "TKFeedbackDataSource.h" -#import "TKPlatformFeedbackSource.h" -#import "TKFeedbackItem.h" -#import "TKFeedback.h" \ No newline at end of file diff --git a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedback.h b/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedback.h deleted file mode 100644 index 8bd0a88..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedback.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// TKFeedback.h -// TryAppFeed -// -// Copyright (c) 2014 Telerik. All rights reserved. -// - -@protocol TKFeedbackDataSource; - -@interface TKFeedback : NSObject - -+ (id)dataSource; - -+ (void)setDataSource:(id)dataSource; - -+ (void)showFeedback; - -+ (void)showFeedback:(UIModalTransitionStyle)transitionStyle; - -+ (void)sendFeedback; - -+ (BOOL)feedbackIsShown; - -@end diff --git a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedbackController.h b/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedbackController.h deleted file mode 100644 index fa0de57..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedbackController.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// TKFeedbackController.h -// TryAppFeed -// -// Copyright (c) 2014 Telerik. All rights reserved. -// - -@protocol TKFeedbackDataSource; - -/** - Represents a view controller that should be placed on top of your view controller hierarchy. - This way it can detect a shake gesture and initiate the feedback process automatically. - */ -@interface TKFeedbackController : UIViewController - -/** - Initializes the feedback controller. - @param contentController The view controller that can be used as a root view controller in the application. - */ -- (id)initWithContentController:(UIViewController *)contentController; - -/** - The view controller that contain root view controller (read-only). - */ -@property (nonatomic, strong) UIViewController *contentController; - -/** - The data source used to provide the feedback service and storage. - */ -@property (nonatomic, strong) id dataSource; - -/** - Defines whether the controller’s built-in action sheet will shown on shake the device. - */ -@property (nonatomic) BOOL showOnShake; - -/** - Shows the built-in feedback action sheet ('Send Feedback', 'Your Feedback', 'Settings') - */ -- (void)showFeedback; - -/** - Takes a snapshot of the current application screen and creates a new feedback item ready to be added and sent/saved to the data source provider. - */ -- (void)sendFeedback; - -@end diff --git a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedbackDataSource.h b/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedbackDataSource.h deleted file mode 100644 index 80c946a..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedbackDataSource.h +++ /dev/null @@ -1,102 +0,0 @@ -// -// TKFeedbackRepository.h -// TelerikUI -// -// Copyright (c) 2014 Telerik. All rights reserved. -// - -#import "TKFeedbackItem.h" - -/** - The data source protocol used to provide feedback service and storage. - */ -@protocol TKFeedbackDataSource - -/** - Contains the user name. - */ -@property (nonatomic, copy) NSString *userName; - -/** - Returns async the feedback items from the data source provider. - @param handler The completion handler to call when the get operation is complete. - */ -- (void)feedbackItems:(void (^)(NSArray *items, NSError *error))handler; - -/** - Adds async the feedback item to the data source provider. - @param item The feedback item - @param handler The completion handler to call when the add operation is complete. - */ -- (void)addFeedback:(TKFeedbackItem *)item completionHandler:(void (^)(NSError *error))handler; - -/** - Adds async the specified feedback items to the data source provider. - @param feedbackItems The feedback item list - @param handler The completion handler to call when the add operation is complete. - */ -- (void)addFeedbackItems:(NSArray *)feedbackItems completionHandler:(void (^)(NSError *))handler; - -/** - Edits async the feedback item in the data source provider. - @param key The feedback item key - @param state The feedback item state - @param handler The completion handler to call when the edit operation is complete. - */ -- (void)editWithKey:(NSString *)key state:(NSString *)state completionHandler:(void (^)(NSError *error))handler; - -/** - Deletes async the feedback item from the data source provider. - @param key The feedback item key - @param handler The completion handler to call when the delete operation is complete. - */ -- (void)deleteWithKey:(NSString *)key completionHandler:(void (^)(NSError *error))handler; - -@optional - -/** - Contains the user email. - */ -@property (nonatomic, copy) NSString *userEmail; - -/** - Returns async the feedback items filtered by state. - @param state The feedback item state used to filter data - @param handler The completion handler to call when the get operation is complete. - */ -- (void)feedbackItemsByState:(NSString *)state completionHandler:(void (^)(NSArray *items, NSError *error))handler; - -/** - Returns async the feedback items filtered by state and skip number of items. - @param state The feedback item state used to filter data - @param skip The number of skipped items - @param handler The completion handler to call when the get operation is complete. - */ -- (void)feedbackItemsByState:(NSString *)state skip:(NSInteger)skip completionHandler:(void (^)(NSArray *, NSError *))handler; - -/** - Returns screenshot image of the feedback item using key. - @param key The feedback item key - @param handler The completion handler to call when the image download is complete. - */ -- (void)imageForKey:(NSString *)key completionHandler:(void (^)(UIImage *image, NSError *error))handler; - -/** - Returns async the comment feedback items using a key of item from the data source provider. - @param key The parent feedback item key - @param handler The completion handler to call when the get operation for comments is complete. - */ -- (void)subItemsForKey:(NSString *)key completionHandler:(void (^)(NSArray *items, NSError *error))handler; - -/** - Adds async the comment feedback item using a key of item to the data source provider. - @param key The parent feedback item key - @param item The comment feedback item - @param handler The completion handler to call when the add operation for comment is complete. - */ -- (void)addSubItemForKey:(NSString *)key subItem:(TKFeedbackItem *)item completionHandler:(void (^)(NSError *error))handler; - -@end - - - diff --git a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedbackItem.h b/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedbackItem.h deleted file mode 100644 index 43f0df4..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKFeedbackItem.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// TKFeedbackItem.h -// TelerikUI -// -// Copyright (c) 2014 Telerik. All rights reserved. -// - -/** - The model of feedback item used to provide feedback service and storage. - */ -@interface TKFeedbackItem : NSObject - -/** - The feedback item key. - */ -@property (nonatomic, copy) NSString *key; - -/** - The feedback item date of creation. - */ -@property (nonatomic, strong) NSDate *createdAt; - -/** - The feedback item date of modification. - */ -@property (nonatomic, strong) NSDate *modifiedAt; - -/** - The feedback item description text. - */ -@property (nonatomic, copy) NSString *text; - -/** - The feedback item author. - */ -@property (nonatomic, copy) NSString *author; - -/** - The feedback item screenshot image. - */ -@property (nonatomic, strong) UIImage *image; - -/** - The feedback item state ('Open', 'Resolved'). - */ -@property (nonatomic, copy) NSString *state; - -/** - The feedback item comments items. - */ -- (NSArray *)subItems; - -/** - Adds a comment feedback item to the subItems collection. - @param item The comment feedback item - */ -- (void)addSubItem:(TKFeedbackItem *)item; - -/** - Inserts a comment feedback in the subItems collection at the specified index. - @param item The comment feedback item - @param index The index. - */ -- (void)insertSubItem:(TKFeedbackItem *)item atIndex:(NSUInteger)index; - -@end diff --git a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKPlatformFeedbackSource.h b/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKPlatformFeedbackSource.h deleted file mode 100644 index 264dd82..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/A/Headers/TKPlatformFeedbackSource.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// TKPlatformFeedbackRepository.h -// TelerikUI -// -// Copyright (c) 2014 Telerik. All rights reserved. -// - -#import "TKFeedbackDataSource.h" - -/** - The feedback data source implementation for the Telerik Platform AppFeedback service. - */ -@interface TKPlatformFeedbackSource : NSObject - -/** - Initializes a new instnace of the object. - @param apiKey The apiKey used to connect with Telerik platform. - */ -- (id)initWithKey:(NSString *)apiKey; - -/** - Initializes a new instnace of the object. - @param apiKey The apiKey used to connect with Telerik platform. - @param uid The user id used to connect with Telerik platform. - */ -- (id)initWithKey:(NSString *)apiKey uid:(NSString *)uid; - -/* - Initializes a new instance of the object. - @param apiKey The apiKey used to connect with Telerik platform. - @param uid The user id used to connect with Telerik platform. - @param apiBaseURL The base url to use when connecting with the server. - @param parameters Key/value pairs that will be appended with every query to the server. - */ -- (id)initWithKey:(NSString *)apiKey uid:(NSString *)uid apiBaseURL:(NSString *)apiBaseUrl parameters:(NSDictionary*)parameters; - -/** - The API key created in the Telerik AppFeedback service for your application. - */ -@property (nonatomic, copy) NSString *apiKey; - -/** - The user ID used to send feedback. - */ -@property (nonatomic, copy) NSString *UID; - -/** - The base URL to use when connecting to the server - */ -@property (nonatomic, copy) NSString *baseURL; - -/** - A dictionary containing additional parameters to sent to the server with every request. - */ -@property (nonatomic, strong) NSDictionary *parameters; - -@end diff --git a/src/ios/TelerikAppFeedback.framework/Versions/A/TelerikAppFeedback b/src/ios/TelerikAppFeedback.framework/Versions/A/TelerikAppFeedback deleted file mode 100644 index 446128b..0000000 Binary files a/src/ios/TelerikAppFeedback.framework/Versions/A/TelerikAppFeedback and /dev/null differ diff --git a/src/ios/TelerikAppFeedback.framework/Versions/Current/AppFeedback.h b/src/ios/TelerikAppFeedback.framework/Versions/Current/AppFeedback.h deleted file mode 100644 index 44b9104..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/Current/AppFeedback.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// TelerikUI.h -// TelerikUI -// -// Copyright (c) 2013 Telerik. All rights reserved. -// - -@interface TelerikAppFeedback : NSObject - -+ (NSString*)versionString; - -@end - -#import "TKFeedbackController.h" -#import "TKFeedbackDataSource.h" -#import "TKPlatformFeedbackSource.h" -#import "TKFeedbackItem.h" -#import "TKFeedback.h" \ No newline at end of file diff --git a/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedback.h b/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedback.h deleted file mode 100644 index 8bd0a88..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedback.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// TKFeedback.h -// TryAppFeed -// -// Copyright (c) 2014 Telerik. All rights reserved. -// - -@protocol TKFeedbackDataSource; - -@interface TKFeedback : NSObject - -+ (id)dataSource; - -+ (void)setDataSource:(id)dataSource; - -+ (void)showFeedback; - -+ (void)showFeedback:(UIModalTransitionStyle)transitionStyle; - -+ (void)sendFeedback; - -+ (BOOL)feedbackIsShown; - -@end diff --git a/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedbackController.h b/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedbackController.h deleted file mode 100644 index fa0de57..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedbackController.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// TKFeedbackController.h -// TryAppFeed -// -// Copyright (c) 2014 Telerik. All rights reserved. -// - -@protocol TKFeedbackDataSource; - -/** - Represents a view controller that should be placed on top of your view controller hierarchy. - This way it can detect a shake gesture and initiate the feedback process automatically. - */ -@interface TKFeedbackController : UIViewController - -/** - Initializes the feedback controller. - @param contentController The view controller that can be used as a root view controller in the application. - */ -- (id)initWithContentController:(UIViewController *)contentController; - -/** - The view controller that contain root view controller (read-only). - */ -@property (nonatomic, strong) UIViewController *contentController; - -/** - The data source used to provide the feedback service and storage. - */ -@property (nonatomic, strong) id dataSource; - -/** - Defines whether the controller’s built-in action sheet will shown on shake the device. - */ -@property (nonatomic) BOOL showOnShake; - -/** - Shows the built-in feedback action sheet ('Send Feedback', 'Your Feedback', 'Settings') - */ -- (void)showFeedback; - -/** - Takes a snapshot of the current application screen and creates a new feedback item ready to be added and sent/saved to the data source provider. - */ -- (void)sendFeedback; - -@end diff --git a/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedbackDataSource.h b/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedbackDataSource.h deleted file mode 100644 index 80c946a..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedbackDataSource.h +++ /dev/null @@ -1,102 +0,0 @@ -// -// TKFeedbackRepository.h -// TelerikUI -// -// Copyright (c) 2014 Telerik. All rights reserved. -// - -#import "TKFeedbackItem.h" - -/** - The data source protocol used to provide feedback service and storage. - */ -@protocol TKFeedbackDataSource - -/** - Contains the user name. - */ -@property (nonatomic, copy) NSString *userName; - -/** - Returns async the feedback items from the data source provider. - @param handler The completion handler to call when the get operation is complete. - */ -- (void)feedbackItems:(void (^)(NSArray *items, NSError *error))handler; - -/** - Adds async the feedback item to the data source provider. - @param item The feedback item - @param handler The completion handler to call when the add operation is complete. - */ -- (void)addFeedback:(TKFeedbackItem *)item completionHandler:(void (^)(NSError *error))handler; - -/** - Adds async the specified feedback items to the data source provider. - @param feedbackItems The feedback item list - @param handler The completion handler to call when the add operation is complete. - */ -- (void)addFeedbackItems:(NSArray *)feedbackItems completionHandler:(void (^)(NSError *))handler; - -/** - Edits async the feedback item in the data source provider. - @param key The feedback item key - @param state The feedback item state - @param handler The completion handler to call when the edit operation is complete. - */ -- (void)editWithKey:(NSString *)key state:(NSString *)state completionHandler:(void (^)(NSError *error))handler; - -/** - Deletes async the feedback item from the data source provider. - @param key The feedback item key - @param handler The completion handler to call when the delete operation is complete. - */ -- (void)deleteWithKey:(NSString *)key completionHandler:(void (^)(NSError *error))handler; - -@optional - -/** - Contains the user email. - */ -@property (nonatomic, copy) NSString *userEmail; - -/** - Returns async the feedback items filtered by state. - @param state The feedback item state used to filter data - @param handler The completion handler to call when the get operation is complete. - */ -- (void)feedbackItemsByState:(NSString *)state completionHandler:(void (^)(NSArray *items, NSError *error))handler; - -/** - Returns async the feedback items filtered by state and skip number of items. - @param state The feedback item state used to filter data - @param skip The number of skipped items - @param handler The completion handler to call when the get operation is complete. - */ -- (void)feedbackItemsByState:(NSString *)state skip:(NSInteger)skip completionHandler:(void (^)(NSArray *, NSError *))handler; - -/** - Returns screenshot image of the feedback item using key. - @param key The feedback item key - @param handler The completion handler to call when the image download is complete. - */ -- (void)imageForKey:(NSString *)key completionHandler:(void (^)(UIImage *image, NSError *error))handler; - -/** - Returns async the comment feedback items using a key of item from the data source provider. - @param key The parent feedback item key - @param handler The completion handler to call when the get operation for comments is complete. - */ -- (void)subItemsForKey:(NSString *)key completionHandler:(void (^)(NSArray *items, NSError *error))handler; - -/** - Adds async the comment feedback item using a key of item to the data source provider. - @param key The parent feedback item key - @param item The comment feedback item - @param handler The completion handler to call when the add operation for comment is complete. - */ -- (void)addSubItemForKey:(NSString *)key subItem:(TKFeedbackItem *)item completionHandler:(void (^)(NSError *error))handler; - -@end - - - diff --git a/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedbackItem.h b/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedbackItem.h deleted file mode 100644 index 43f0df4..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/Current/TKFeedbackItem.h +++ /dev/null @@ -1,66 +0,0 @@ -// -// TKFeedbackItem.h -// TelerikUI -// -// Copyright (c) 2014 Telerik. All rights reserved. -// - -/** - The model of feedback item used to provide feedback service and storage. - */ -@interface TKFeedbackItem : NSObject - -/** - The feedback item key. - */ -@property (nonatomic, copy) NSString *key; - -/** - The feedback item date of creation. - */ -@property (nonatomic, strong) NSDate *createdAt; - -/** - The feedback item date of modification. - */ -@property (nonatomic, strong) NSDate *modifiedAt; - -/** - The feedback item description text. - */ -@property (nonatomic, copy) NSString *text; - -/** - The feedback item author. - */ -@property (nonatomic, copy) NSString *author; - -/** - The feedback item screenshot image. - */ -@property (nonatomic, strong) UIImage *image; - -/** - The feedback item state ('Open', 'Resolved'). - */ -@property (nonatomic, copy) NSString *state; - -/** - The feedback item comments items. - */ -- (NSArray *)subItems; - -/** - Adds a comment feedback item to the subItems collection. - @param item The comment feedback item - */ -- (void)addSubItem:(TKFeedbackItem *)item; - -/** - Inserts a comment feedback in the subItems collection at the specified index. - @param item The comment feedback item - @param index The index. - */ -- (void)insertSubItem:(TKFeedbackItem *)item atIndex:(NSUInteger)index; - -@end diff --git a/src/ios/TelerikAppFeedback.framework/Versions/Current/TKPlatformFeedbackSource.h b/src/ios/TelerikAppFeedback.framework/Versions/Current/TKPlatformFeedbackSource.h deleted file mode 100644 index 264dd82..0000000 --- a/src/ios/TelerikAppFeedback.framework/Versions/Current/TKPlatformFeedbackSource.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// TKPlatformFeedbackRepository.h -// TelerikUI -// -// Copyright (c) 2014 Telerik. All rights reserved. -// - -#import "TKFeedbackDataSource.h" - -/** - The feedback data source implementation for the Telerik Platform AppFeedback service. - */ -@interface TKPlatformFeedbackSource : NSObject - -/** - Initializes a new instnace of the object. - @param apiKey The apiKey used to connect with Telerik platform. - */ -- (id)initWithKey:(NSString *)apiKey; - -/** - Initializes a new instnace of the object. - @param apiKey The apiKey used to connect with Telerik platform. - @param uid The user id used to connect with Telerik platform. - */ -- (id)initWithKey:(NSString *)apiKey uid:(NSString *)uid; - -/* - Initializes a new instance of the object. - @param apiKey The apiKey used to connect with Telerik platform. - @param uid The user id used to connect with Telerik platform. - @param apiBaseURL The base url to use when connecting with the server. - @param parameters Key/value pairs that will be appended with every query to the server. - */ -- (id)initWithKey:(NSString *)apiKey uid:(NSString *)uid apiBaseURL:(NSString *)apiBaseUrl parameters:(NSDictionary*)parameters; - -/** - The API key created in the Telerik AppFeedback service for your application. - */ -@property (nonatomic, copy) NSString *apiKey; - -/** - The user ID used to send feedback. - */ -@property (nonatomic, copy) NSString *UID; - -/** - The base URL to use when connecting to the server - */ -@property (nonatomic, copy) NSString *baseURL; - -/** - A dictionary containing additional parameters to sent to the server with every request. - */ -@property (nonatomic, strong) NSDictionary *parameters; - -@end diff --git a/www/feedback.js b/www/feedback.js index 1eb81b7..f0a65e1 100644 --- a/www/feedback.js +++ b/www/feedback.js @@ -31,7 +31,7 @@ var cordova = require('cordova'), } }, function errorCallback(error) { //not used right now. reserved for future use - }, 'AppFeedback', 'initialize', [apiKey, apiUrl]); + }, 'AppFeedback', 'initialize', [apiKey, apiUrl, options ? options : []]); }; this.showFeedback = function () { cordova.exec(function successCallback(result) {