Skip to main content

Feedback Kit

Introduction​

Feedback Kit for IOS is a wrapper SDK for Mappls's feedback API. It allows developers to integrate feedback module in their application. Using feedback module user can submit location related feedback to Mappls's server.

Note: Sample for UI view controllers with source code is also provided by Mappls which user can directly use to show feedback screen. Information about how to use UI sample is also provided in this documentation.

If you don't want to implement own logic and use sample from Mappls Jump to Sample UI Kit section.

Setup your Project​

Using CocoaPods​

To install the MapplsFeedbackKit using CocoaPods:

Create a Podfile with the following specification:

pod 'MapplsFeedbackKit', '1.0.0'

Run pod repo update && pod install and open the resulting Xcode workspace.

Authorization​

MapplsAPICore​

It is required to set Mappls keys to use any MAPPL's SDK. Please refer the documenatation here

Usage​

Steps to submit feedback:

  1. An authoraization key i.e moduleId (provided by Mappls) against which feedback will be submitted wiil be required to use this SDK .

  2. List of categories need to be fetched first under which feedback will be submitted. For more informatatio see here.

    Notes:

    • Fetched report categories can be saved for offline use or to prevent fetching report categories multiple times.

    • It will require to separate out them on basis of parentId i.e Separate as Parent and Child Categories, where if parent Id is null means they are parent categories otherwise child of some parent category. Note: ParentId of a child category is reportId of parent category.

  3. On basis of parent and child categories, different User Interfaces or scenarios can be designed as per requirements.

  4. User must pass have location oordinate for which feedback will be submitted.

  5. After selecting of parent and child category user must take some input as a text for feedback.

  6. After Collection all values i.e Module Id, Location Coordinates, Parent Category, Child Category and Feedback Text, feedback can be submitted using functions available in this SDK. See here.

Get Report Categories​

Categories for reporting can be fetched using getReportCategories method of MapplsFeedBackKitManager class by using shared instance. In response you will receive an error or an array of MapplsReportCategories. Yo will find below useful properties in reportCategories object which is an array of ParentCategories:

  • ParentCategories

  • ChildCategories

  • SubChildCategories

Swift​
MapplsFeedBackKitManager.shared.getReportCategories { (reportCategories, error)  in
if let error = error {
print(error.localizedDescription)
self.dismiss(animated: true, completion: nil)
} else {
let categories = reportCategories ?? [ParentCategories]()
if categories.count > 0 {
self.allReportCategories = categories
print(self.allReportCategories.first?.id)
self.currentStep = 1
} else {
print("No report categories found")
self.dismiss(animated: true, completion: nil)
}
}

Submit Feedback​

To submit feedback to Mappls's server you can use saveUserData function of MapplsSaveUserDataAPIManager class by using shared instance.

saveUserData function will accept an object of MapplsSaveUserDataOptions class.

To create instance of MapplsSaveUserDataOptions user provide following parameters.

Mandatory Parameters​

  1. location(String) : It can be either Mappls Pin (The 6-digit alphanumeric code for any location) or coordinate (latitude, longitude) in string format.
  2. parentCategory(Integer) : Parent category of the report.
  3. childCategory (Integer) : Child category of the report.

Optional Parameters​

  1. placeName(string) : Name of the place where the event is taking place. It should be derived on the basis of Mappls Pin and coordinates.
  2. desription(String) : A description about your event. Min length 10 characters and Max length 250 characters.
  3. subChildCategory(Integer)(Internal) : Sub Child category of the report.
  4. flag(Integer) : If navroute is active then 1 else 0.
  5. speed(Integer) : User's speed in kilometers.
  6. alt(Integer) : Altitude of the user’s location, in meters.
  7. quality(Integer) : Quality of user's location.
  8. bearing(Integer) : Bearing of the user’s location, in degrees.
  9. accuracy(Integer) : Accuracy of user's location.
  10. utc(Long) : Date time in unix timestamp format.
  11. expiry(Long) : Date time in unix timestamp format to set expiry for the report.
  12. zeroId(String) : to be used only incase of NAVIMAPS .
  13. pushEvent(Boolean)(internal) : to be used only when traffic events are to be pushed back to the traffic event editor. Allowed values: a) true b) false
  14. appVersion(String) : Version of the app
  15. osVersionoptional(String) : Version of the os
  16. deviceName(String) : Name of the device
Swift​
let saveOptions = MapplsSaveUserDataOptions(location: "MMI000", parentCategory: parentCategory.id ?? 0, childCategory: childCategory.id ?? 0, description: "This is descriptions", subChildCategory: self.selectedSubChildCategories?.id, accuracy: 3)

MapplsSaveUserDataAPIManager.shared.saveUserData(saveOptions, { (isSucess, error) in

if let error = error {
print(error.localizedDescription)
} else if isSucess {
print("feedback submited successfully")
self.dismiss(animated: true, completion: nil)
} else {
print("No results")
}
})

Mappls Feedback UI Kit​

A UI control MapplsFeedbackUIKit is available to use SDK MapplsFeedbackKit. To know more about it see here.