teliver-ios-food-delivery
Food Delivery
Live Tracking food isn’t just any other feature; it feeds the user a sense of relief – which at times feels better than the food itself. Begin implementing on your Obj-C Application.
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 food 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).

Enable the following in your build settings.

  • Always Embed Swift Standard Libraries -> Yes

  • Allow Non-Modular Includes In Framework Modules -> Yes

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.

TeliverSettings* settings = [[TeliverSettings alloc]initWithAppKey:@"TELIVER_KEY"];

[[Teliver alloc]initWithTeliverSettings:settings];

(Note: use setDebugger - YES/NO 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.

   TeliverTracker *tracker = [[TeliverTracker alloc]initForTrackingId:"trackingId" withCustomMessage:"Pop Up Title/Message"];

   [Teliver startTrackingForUser:tracker 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.

-(void) didStartedTracking:(NSString *)trackingId {

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

  }
-(void) didStoppedTracking:(NSString *)trackingId {

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

  }
  -(void) didRecieveUpdateOnTracking:(NSString *)trackingId data:(NSDictionary *)data {

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

  }
  -(void) didRecieveErrorOnTracing:(NSString *)error {

  //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.
 -(void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {

  [Teliver identifyUserForUser:@"USER_ID" withToken:deviceToken];
  }

(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

 -(void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)data {

  if([Teliver isTeliverPushWithData:data])  {
   NSString *messageJson = data[@"message"];
  // Above messageJson 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.)

SDK integrations are the modern age plug-ins for mobile applications. Live Tracking SDK’s are the need of the hour for On-Demand mobile applications and the Food Delivery sector isn’t an exception. In-fact, Live tracking in Food Delivery apps should be the most concrete of all deliveries as the one in hunger is the one that anticipates the most.

With the above Android Live Tracking SDK, businesses could integrate Real-Time tracking functionalities well within minutes. Live tracking food deliveries are no more a complication and with Teliver the possibilities are wide open.