Git Product home page Git Product logo

gms-imessage-samples's Introduction

GMS-iMessage-Samples

Two example apps used for product support with Google's iOS Map SDK

How to run

  1. Download and install XCode
  2. Install cocoapods on MacOS using sudo gem install cocoapods if you don't already have it
  3. From the base directory do both cd ../GMS\ Normal\ App and cd ../GMS\ iMessage\ App and follow the steps below for both the iMessage and Normal directories
  4. pod install
  5. open the .xcworkspace file in either directory
  6. Change the bundle identifier and development team to your own in .xcodeproj > Targets > General
  7. Ensure that your Maps API key is permitted to run the declared bundles
  8. For the Normal app, go to "GMS Normal App > ViewController.swift" and include your Maps-enabled API key as the apiKey variable. For the iMessage app, go to "GMS iMessage App MessagesExtension > MessagesViewController.swift" and include your Maps-enabled API key as the apiKey variable
  9. Run either application on a connected mobile device (untested on simulator)

Expected results

When running the normal app, the view should look as expected: a Google map focused on Sydney Australia with a marker

image

When running the iMessage app, the view fails to load the map and simply shows the google icon upon a grey map.

image

Steps taken to create both samples

  1. Create two new XCode projects directly in Xcode, specifying an "App" for the normal app and an "iMessage extension" for the iMessage app
  2. Add pod files specifying the installation of GoogleMaps, pod install, and open the generated .xcworkspace files
  3. Specifically for the iMessage app, go to ".xcodeproj > Targets > GMS iMessage App MessagesExtension > Build Settings > Other Linker Flags" and add -framework "GoogleMaps" -framework "GoogleMapsBase" -framework "GoogleMapsCore". This step is necessary as pod install doesn't link the google maps frameworks to Message Extension targets.
  4. Add code from https://developers.google.com/maps/documentation/ios-sdk/map-with-marker?authuser=2 to the view controllers. Note that although the tutorial specifies that the api key should be provided in the AppDelegate file, I have provided the API key in the viewDidLoad of the sole view controllers since Message Apps lack an AppDelegate file.
  5. Include your API key in the apiKey variable on each view controller. Then, check to ensure the api key is declared to work for both bundle identifiers and run.

gms-imessage-samples's People

Contributors

lbakshi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.