teliver-grocery-ios
Grocery Delivery
The queue at a departmental store is almost never ending and grocery Apps is the solution : But where is the delivery? Teliver Answers!
ADDING TELIVER SDK TO YOUR CUSTOMER APP

The Existing SDK supports only customer tracking on iOS, This is how it’s gonna get easier, to add 'LiveTracking' in your grocery delivery iOS Application, just Integrate Teliver SDK with the following simple steps.

  • Teliver SDK is hosted in CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command.

  • To integrate Teliver SDK into your Xcode project using CocoaPods, specify it in your Podfile:

pod ‘teliver’

  • Then Install the pods using 'pod install', Once Installing, open your project in Xcode from the .xcworkspace file (not the usual project file).

We request users location on Our SDK to send customers location to driver, to allow SDK to proceed further, select info.plist

  • Add `Privacy` - Location When In Use Usage Description’s

INITIALIZE TELIVER SDK IN YOUR APP

Congratulations! If you successfully completed the previous step of integration. Now lets proceed to the next step of initializing.

To initialize you need a "TELIVER KEY". Which is a unique key needed for identifying your application and to get the core of Teliver to work.

To get the key,

  • Login/Register to Teliver , you can find 'TELIVER KEY' under android integration tab.

integration-teliver-key
  • Initiate the Teliver SDK by adding the following code in your App Delegate's didFinishLaunchingWithOptions method.

let teliver = TeliverSettings.init(withAppKey: "TELIVER_KEY")

Teliver.init(withTeliverSettings: teliver)

(Note: use debugging - true/false for SDK in your TeliverSettings object to enable logging during Development.)

START TRACKING

Once the customer is notified that the trip is started by driver, you can start tracking the driver by using the following piece of code.

   let trackingUser = TeliverTracker.init(forTrackingId:"trackingId" withCustomMessage:"Pop Up Title/Message")

   Teliver.startTrackingFor(user: trackingUser, withNavigationTitle: "Navigation Bar Title")

you can start tracking the driver with delegates also, Implement the delegate ‘TeliverTrackingDelegate’ on your view controller and you will get the following methods for usage.With this you can build your own Map.

public func didStartedTracking(_ trackingId: String?) {

  //This method is called when the consumer initiates the trip by startTracking method.

  }
public func didStoppedTracking(_ trackingId: String?){

  //This method is called when tracking has stopped by calling the method stopTracking.

  }
public func didRecieveUpdateOnTracking(_ trackingId: String?, data: [String : Any]){

  //This method is called when there is a updates in the location.

  }
public func didRecieveErrorOnTracking(_ error: String?){

  //This method is called when there is error on tracking.

   }

(Note: The trackingId is the same trackingId that you used to start the trip on driver side, the trackingId is the spotting key to identify your driver.)

ENABLE PUSH NOTIFICATION

Teliver sdk provides you the way to notify your customers about the events that can occur within the Operator and Consumer. You can use this link how to setup Push notification in your iOS Project & Teliver dashboard.

Identifying Users

  • To send/recieve a notification to users, the device must be first identified to do so use the following method.



  //Called when APNs has assigned the device a unique token.
 func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {

  let deviceTokenString = deviceToken.reduce("", {$0 + String(format: "%02X", $1)})

  Teliver.identifyUser(forUser: "USER_ID", withToken: deviceTokenString)
  }

(Note: USER_ID here can be your user’s unique identifier in your system for identification, this will reflect under Users on dashboard. Also you can use the method available without device token.)

Handling Push/Events

 func application(_ application: UIApplication, didReceiveRemoteNotification data: [AnyHashable : Any]) {

  if Teliver.isTeliverPush(data: data) {
  // Above data params has your message, command & tracking_id in Json.
  //Commands are of two types:
    //teliver_start_trip -> This command will be issued when a trip has been started. You need to start the trip here using start tracking.
    //teliver_event_push -> This Command will be issued when a custom event push is triggered.

  }else {
   //The push is not for us, You can handle it.
}

(Note: Don’t forget to identify Consumer to receive push.)

Mobile Application SDKs are on the rise and the adoption of these kits is widely encouraged by developers, as they drastically minimize the coding requirement to improvise the app. Grocery delivery, similar to all deliver applications are bound to find a remedy for the consumer woes.

Live Tracking being the most talked about issue as of now, Teiver responds to it with kind for business sizes of all types. The above iOS integration will enable a wide possibility of opportunities for a Grocery Delivery business App in recognizing the customer reactions and developments rendered. Most of all, the satisfaction factor is what that counts for a business to flourish and Teliver makes sure that the solution offered provides the best of what a business requires.