SocialOverlayContext
Objective-C
@interface SocialOverlayContext : NSObject
Swift
class SocialOverlayContext : NSObject
This class encapsulates social overlay context information.
-
Returns the social reports overlay info.
Declaration
Objective-C
- (nullable SocialReportsOverlayInfoObject *)getReportsOverlayInfo;
Swift
func getReportsOverlayInfo() -> SocialReportsOverlayInfoObject?
-
Returns the overlay categories list.
Declaration
Objective-C
- (nonnull NSArray<SocialReportsOverlayCategoryObject *> *) getCategoriesWithIsoCode:(nonnull NSString *)isoCode;
Swift
func getCategoriesWithIsoCode(_ isoCode: String) -> [SocialReportsOverlayCategoryObject]
Parameters
isoCode
The country ISO code for which the list is retrieved. Use empty String() for generic country.
-
Returns the overlay category by id.
Declaration
Objective-C
- (nullable SocialReportsOverlayCategoryObject *) getCategoryWithIdentifier:(int)categoryId isoCode:(nonnull NSString *)isoCode;
Swift
func getCategoryWithIdentifier(_ categoryId: Int32, isoCode: String) -> SocialReportsOverlayCategoryObject?
Parameters
categoryId
The category id
isoCode
The country ISO code for which the list is retrieved. Use empty String() for generic country.
-
Prepare reporting.
Declaration
Objective-C
- (int)prepareReportingWithLocation:(nonnull CoordinatesObject *)location categoryId:(int)categId;
Swift
func prepareReporting(withLocation location: CoordinatesObject, categoryId categId: Int32) -> Int32
Parameters
location
Report coordinates.
categId
Report category id, default = 0. If != 0, a dry run test is performed to check if the given category id can be reported.
Return Value
If in preparing mode ( category id = 0 ): @details KSuspended - Reports rate limit exceeded. @details value > 0 - The prepared operation id.
-
Prepare reporting.
Declaration
Objective-C
- (int)prepareReportingWithDataSourceContext: (nonnull DataSourceContext *)context categoryId:(int)categId;
Swift
func prepareReporting(with context: DataSourceContext, categoryId categId: Int32) -> Int32
Parameters
context
The data source context.
categId
Report category id, default = 0. If != 0, a dry run test is performed to check if the given category id can be reported.
Return Value
If in preparing mode ( category id = 0 ): @details KSuspended - Reports rate limit exceeded. @details KNotFound - Invalid data source position for reporting @details value > 0 - The prepared operation id.
-
Report an social event
Declaration
Objective-C
- (int)report:(int)prepareId categoryId:(int)categId description:(nullable NSString *)description snapshot:(nullable UIImage *)snapshot completionHandler:(nonnull void (^)(SDKErrorCode))handler;
Swift
func report(_ prepareId: Int32, categoryId categId: Int32, description: String?, snapshot: UIImage?, completionHandler handler: @escaping (SDKErrorCode) -> Void) -> Int32
Parameters
prepareId
Prepare operation id ( returned by a call to prepareReporting ).
description
The report description text ( optional ).
snapshot
The report snapshot ( optional ). The supported formats are: PNG.
Return Value
The operation error code. @details KInvalidInput - categId is not a valid social report category id / params are ill-formed / snapshot is an invalid image. @details KSuspended - reports rate limit exceeded. @details KExpired - prepared report id not found or is expired ( too old ). @details KNotFound - no accurate sense data source position to complete. @details KScheduled - operation will proceed later, when internet connection is available. Not an error.
-
Confirm an existing report as in effect.
Declaration
Objective-C
- (int)confirmReport:(nonnull OverlayItemObject *)item completionHandler:(nonnull void (^)(SDKErrorCode))handler;
Swift
func confirmReport(_ item: OverlayItemObject, completionHandler handler: @escaping (SDKErrorCode) -> Void) -> Int32
Parameters
item
The report overlay item.
handler
The completion handler with the result code. @details SDKErrorCode KAccessDenied - Already confirmed or denied. @details SDKErrorCode KScheduled - Operation will proceed later, when internet connection is available.
-
Denied an existing report as not in effect anymore.
Declaration
Objective-C
- (int)denyReport:(nonnull OverlayItemObject *)item completionHandler:(nonnull void (^)(SDKErrorCode))handler;
Swift
func denyReport(_ item: OverlayItemObject, completionHandler handler: @escaping (SDKErrorCode) -> Void) -> Int32
Parameters
item
The report overlay item.
handler
The completion handler with the result code.
Return Value
The operation error code. @details KInvalidInput - Invalid item ( not a social report overlay item ) or item is not a result of alarm notification. @details KAccessDenied - Already confirmed or denied. @details KScheduled - Operation will proceed later, when internet connection is available. Not an error.
-
Update an existing report parameters.
Declaration
Objective-C
- (int)updateReport:(nonnull OverlayItemObject *)item completionHandler:(nonnull void (^)(SDKErrorCode))handler;
Swift
func updateReport(_ item: OverlayItemObject, completionHandler handler: @escaping (SDKErrorCode) -> Void) -> Int32
Parameters
item
The report overlay item.
handler
The completion handler with the result code.
Return Value
The operation error code. @details KInvalidInput - Invalid item ( not a social report overlay item ). @details KScheduled - Operation will proceed later, when internet connection is available. Not an error.
-
Delete an owned report.
Declaration
Objective-C
- (int)deleteReport:(nonnull OverlayItemObject *)item completionHandler:(nonnull void (^)(SDKErrorCode))handler;
Swift
func deleteReport(_ item: OverlayItemObject, completionHandler handler: @escaping (SDKErrorCode) -> Void) -> Int32
Parameters
item
The report overlay item.
handler
The completion handler with the result code.
Return Value
The operation error code. @details KInvalidInput - Invalid item ( not a social report overlay item ). @details KAccessDenied - Not an owned report. @details KScheduled - Operation will proceed later, when internet connection is available. Not an error.
-
Add a comment to report.
Declaration
Objective-C
- (int)addComment:(nonnull OverlayItemObject *)item comment:(nonnull NSString *)string completionHandler:(nonnull void (^)(SDKErrorCode))handler;
Swift
func addComment(_ item: OverlayItemObject, comment string: String, completionHandler handler: @escaping (SDKErrorCode) -> Void) -> Int32
Parameters
item
The report overlay item.
handler
The completion handler with the result code.
Return Value
The operation error code. @details KInvalidInput - Invalid item ( not a social report overlay item ). @details KConnectionRequired - No internet connection available. @details KBusy - Another add comment operation is in progress.
-
Get report snapshot.
Declaration
Objective-C
- (int)getReportSnapshot:(nonnull OverlayItemObject *)item completionHandler:(nonnull void (^)(UIImage *_Nullable))handler;
Swift
func getReportSnapshot(_ item: OverlayItemObject, completionHandler handler: @escaping (UIImage?) -> Void) -> Int32
Parameters
item
The report overlay item.
handler
The completion handler with the image.
Return Value
The operation error code. @details KInvalidInput - Invalid item ( not a social report overlay item ). @details KConnectionRequired - No internet connection available.
-
Get data transfer statistics for this service.
Declaration
Objective-C
- (nonnull TransferStatisticsContext *)getTransferStatistics;
Swift
func getTransferStatistics() -> TransferStatisticsContext