integrating google map sdk in ios app

17
Integrate Google Map SDK iOS App

Upload: hitesh-kumar-singh

Post on 10-Jul-2015

181 views

Category:

Software


1 download

DESCRIPTION

Step by step guide to integrate google map sdk in your iOS App.

TRANSCRIPT

Page 1: Integrating Google Map SDK in iOS App

Integrate Google Map SDK

iOS App

Page 2: Integrating Google Map SDK in iOS App

• Get iOS API Key

• Integrate Google Map SDK

Page 3: Integrating Google Map SDK in iOS App

Go to this link

• https://developers.google.com/maps/documentation/ios-sdk/

Page 4: Integrating Google Map SDK in iOS App

Click on Get a Key

Page 5: Integrating Google Map SDK in iOS App

Click on Continue

Page 6: Integrating Google Map SDK in iOS App

You would be redirected to new page

Page 7: Integrating Google Map SDK in iOS App

Create your project with bundle identifier

Page 8: Integrating Google Map SDK in iOS App

You will get your API Key

Page 9: Integrating Google Map SDK in iOS App

Copy API Key

Page 10: Integrating Google Map SDK in iOS App

Getting started with Google Map SDK

• https://developers.google.com/maps/documentation/ios-sdk/start -step_1_get_the_latest_version_of_xcode

Page 11: Integrating Google Map SDK in iOS App

Install API using CocoaPods

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.1'

pod 'GoogleMaps'

Page 12: Integrating Google Map SDK in iOS App

AppDelegate.swift

• Import GoogleMaps

• In didFinishLaunchWithOptions function add this line with your API key.

GMSServices.provideAPIKey(“Your API key”)

Page 13: Integrating Google Map SDK in iOS App

ViewController.swift - add it to viewDidLoad()

let camera = GMSCameraPosition.cameraWithLatitude(-33.86, longitude: 151.20, zoom: 6)

let mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera)

mapView.myLocationEnabled = trueself.view = mapViewlet marker = GMSMarker()marker.position = CLLocationCoordinate2DMake(-33.86, 151.20)marker.title = "Sydney”marker.snippet = "Australia”marker.map = mapView

Page 14: Integrating Google Map SDK in iOS App

With iOS9 and XCode7 – add this to your info.plist file<key>LSApplicationQueriesSchemes</key><array> <string>googlechromes</string> <string>comgooglemaps</string></array>

Page 15: Integrating Google Map SDK in iOS App

Run your project

Page 16: Integrating Google Map SDK in iOS App

Reference

• https://developers.google.com/maps/documentation/ios-sdk/

• https://developers.google.com/maps/documentation/ios-sdk/start -step_1_get_the_latest_version_of_xcode

Page 17: Integrating Google Map SDK in iOS App

Reach me

• https://twitter.com/maverickhitesh

• https://in.linkedin.com/in/maverickhitesh

• https://www.facebook.com/MaverickHitesh