Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place Details Viewport changes starting with Places SDK for iOS v5.0 #293

Open
dhananjayanravi opened this issue Mar 19, 2021 · 1 comment

Comments

@dhananjayanravi
Copy link

dhananjayanravi commented Mar 19, 2021

@tolu360
I got the following email from Google related to Place SDK,

package.json:
"react-native-google-places": "^3.1.2",

What i want to do for this email.

Hello Google Maps Platform Customer,

We’re writing to let you know that the next major version of the Places SDKs for iOS will no longer support the viewport property of GMSPlace objects.

What do I need to know?
Starting with version 5.0 of the Google Maps Platform Places SDK for iOS, the viewport property of GMSPlace objects will be replaced with a property named viewportInfo of a new class type.

This will affect your code if it uses the viewport field of a GMSPlace object, e.g. when fetching Place Details including viewport information among the requested place fields.

This change will impact projects using the Places SDK for iOS starting with version 5.0, which will be released later this year.

What do I need to do?
Do not upgrade to Places SDK for iOS 5.0 or higher until you are ready to migrate code that uses the viewport field.

You may avoid unexpected build errors by following the best practice of specifying version numbers in your dependencies:

In your Podfile or Cartfile, specify version 4.2.0, which was released earlier this month. See examples of CocoaPods and Carthage dependencies for Places SDK for iOS.
Each time you build a new version of your app, run pod outdated or carthage outdated to check for new versions of your CocoaPods or Carthage dependencies. See guidance on app maintenance best practices.
For additional information, please see our new blog post on SDK dependency versions. We will also provide a migration guide once the Places SDK for iOS version 5.0 is available.

Your projects listed below are using the Places SDK for iOS and could require an update:

Google Maps Platform product: Places SDK for iOS

Please note that we are sending this message to all Places SDK for iOS customers, whether or not your application may be affected. If your application code doesn't make any use of the viewport property of GMSPlace objects, you will not need to take any action.

@AmrithVengalath
Copy link

hi it shows the error Property 'viewport' not found on object of type 'GMSPlace *' in node_modules/react-native-google-places/ios/NSMutableDictionary+GMSPlace.m and the same goes away when I change the lines

    if (place.viewport) {
        NSMutableDictionary *viewportMap = [[NSMutableDictionary alloc] init];
        viewportMap[@"latitudeNE"] = [NSNumber numberWithDouble:place.viewport.northEast.latitude];
        viewportMap[@"longitudeNE"] = [NSNumber numberWithDouble:place.viewport.northEast.longitude];
        viewportMap[@"latitudeSW"] = [NSNumber numberWithDouble:place.viewport.southWest.latitude];
        viewportMap[@"longitudeSW"] = [NSNumber numberWithDouble:place.viewport.southWest.longitude];

        placeData[@"viewport"] = viewportMap;
    }

Screenshot 2024-08-29 at 10 24 09 AM

to
Screenshot 2024-08-29 at 10 23 25 AM

  if (place.viewportInfo) {
       NSMutableDictionary *viewportMap = [[NSMutableDictionary alloc] init];
       viewportMap[@"latitudeNE"] = [NSNumber numberWithDouble:place.viewportInfo.northEast.latitude];
       viewportMap[@"longitudeNE"] = [NSNumber numberWithDouble:place.viewportInfo.northEast.longitude];
       viewportMap[@"latitudeSW"] = [NSNumber numberWithDouble:place.viewportInfo.southWest.latitude];
       viewportMap[@"longitudeSW"] = [NSNumber numberWithDouble:place.viewportInfo.southWest.longitude];

       placeData[@"viewport"] = viewportMap;
   }

is this related to this issue mentioned above?

AmrithVengalath added a commit to AmrithVengalath/react-native-google-places that referenced this issue Aug 29, 2024
[Places SDKs for iOS will no longer support the viewport property of GMSPlace objects.](tolu360#293 (comment))

Starting with version 5.0 of the Google Maps Platform Places SDK for iOS, the viewport property of GMSPlace objects will be replaced with a property named viewportInfo of a new class type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants