How to integrate vanillaNAV in native iOS apps


VanillaNAV Framework for iOS

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

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

pod ‘VanillaNavFramework’, :git => "http://gitlab.rosoftlab.net/d.danilov/vanillanav-ios.git”,  :branch => “framework”

Then, run the following command:

$ pod install

Requirements

iOS 9.0 or later, written in Swift3.

Usage

Import the library in all files where you use it:

import VanillaNavFramework

Calling VanillaNav navigation

    // Unique id of the venue generated by www.vanillanav.com 
    let venueId: UInt64 = 
    let destinationId: UInt64 = 15875


    let nav = NavigationVC(venueId: venueId, destinationId: destinationId)
    self.navigationController?.pushViewController(nav, animated: true)

Save location

    let nav = SaveDestinationVC(venueId: venueId)
    self.navigationController?.pushViewController(nav, animated: true)

SaveDestination view controller automatically dismiss when he saved destination id in memory.

Get saved location id

    let id: UInt64? =  SaveDestinationManager.getSavedMarkerId(forVenue: venueId)

Return nil when no location saved.

Delete saved location

    SaveDestinationManager.deleteSavedMarkerId(forVenue: venueId)

Retrieving the list of destinations

        _ = PublicApi.loadVenue(withId: venueId)
        .subscribe(onNext: { (venue) in
            let destinations: [Destination] = venue.destinations
        }, onError: nil , onCompleted: nil, onDisposed: nil)

Retrieving the list of events

       _ = PublicApi.loadVenuesList().subscribe(onNext: {
                (venues: [VenueCompact]) -> Void in
                //use de list of destinations
        }, onError: nil
Tags: API, framework, SDK
Last update:
2017-08-03 14:59
Author:
Marlene Lange
Revision:
1.4
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.