iOS Tutorial GoogleMaps Tutorial

Status
Not open for further replies.
The iGoogleMaps library allows you to show a map inside your app:

SS-2014-11-17_09.18.50.png


It is similar to B4A GoogleMaps library.

1. In order to use it you need to get a free api key from Google. Follow the "Obtaining an API Key" steps: https://developers.google.com/maps/documentation/ios/start#obtaining_an_api_key

2. If you are using a local Mac builder then you need to first download the SDK to your Mac computer: www.b4x.com/b4i/files/GoogleMaps.framework.zip (download it from your Mac).
And copy GoogleMaps.framework package to the Libs folder.

Start with the attached project. You will need to change the package name.

When you are ready to start a new project you need to:
3. Add these two attributes to your project (if you want to show the user location):
B4X:
#PlistExtra:<key>NSLocationWhenInUseUsageDescription</key><string>Used to display the current navigation data.</string>
#PlistExtra:<key>NSLocationUsageDescription</key><string>Used to display the current navigation data.</string>
You can change the description text.
4. Set the minimum version to 11:
B4X:
#MinVersion: 11

5. Copy the GoogleMaps.bundle folder from the example project (under Files\Special) to Files\Special in your project.

You can download the example project from: https://www.b4x.com/b4i/files/GoogleMaps.zip

Updates:

- GoogleMaps iOS SDK v6.0.1 was uploaded to the builders.
Make sure to update Files\Special\GoogleMaps.bundle from the example project.
If using a local Mac then update the Mac frameworks (see step #2 above)
Set the minimum version to 11: #MinVersion: 11
 
Last edited:

RichardHirst

Member
Licensed User
Longtime User
Having trouble sending the Map Demo to the iPad.

The other samples are working ok, but the Google Maps returns an error. Communication error: RequestCancelled.

Tried it on PC and Laptop..

Any Ideas please..

Richard
 

RichardHirst

Member
Licensed User
Longtime User
Are you using the hosted builder? Try to increase the process timeout (under Tools - IDE Options).


Yes using hosted builder.. Increased to 240.. still fails. This is the example direct from this website without modification...
 

RichardHirst

Member
Licensed User
Longtime User
Sending data to remote compiler. 86.17
Compilation completed successfully.
Make sure that B4i-Bridge is started (10.1.1.68).
Manually launch the app after installation.

Now it works.. tried all morning to get this to work.. ???
 

highflyer

Member
Licensed User
Longtime User
New versions of the Google maps SDK for iOS ( 1.10.0 May 2015) are distributed via something called "CocoaPods".
How to use it in B4i ?
 

Luiz Fernando Orlandini

Active Member
Licensed User
Longtime User
Are you using a local Mac builder? Have you tried to follow the steps here: https://developers.google.com/maps/documentation/ios/start#getting_the_google_maps_sdk_for_ios ? Eventually it should download the required files.
Hello. After migrating to B4I and update my local Mac builder, I started to get an strange error:

B4X:
Undefined symbols for architecture arm64:
  "_CBAdvertisementDataManufacturerDataKey", referenced from:
      -[GMSx_PEBeaconScanner centralManager:didDiscoverPeripheral:advertisementData:RSSI:] in GoogleMaps(PEBeaconScanner.o)
  "_CBAdvertisementDataServiceDataKey", referenced from:
      -[GMSx_PEBeaconScanner centralManager:didDiscoverPeripheral:advertisementData:RSSI:] in GoogleMaps(PEBeaconScanner.o)
  "_CBCentralManagerScanOptionAllowDuplicatesKey", referenced from:
      -[GMSx_PEBeaconScanner scanIfAppropriate] in GoogleMaps(PEBeaconScanner.o)
  "_OBJC_CLASS_$_CBCentralManager", referenced from:
      objc-class-ref in GoogleMaps(PEBeaconScanner.o)
  "_OBJC_CLASS_$_CBUUID", referenced from:
      objc-class-ref in GoogleMaps(PEBeacon.o)
      objc-class-ref in GoogleMaps(PEBeaconScanner.o)
  "_vImageBoxConvolve_Planar8", referenced from:
      (anonymous namespace)::CreateBlurredImage(CGImage*, double, double) in GoogleMaps(GLWaterGroup.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

How can I solve that issue?

An additional information, when I use the hosted server, everything works fine.
 
Last edited:

kreativa

Member
Licensed User
Longtime User
HI!
I have the same problem like luiz fernando.
I downloaded the new version of googlemap.framework but i still receive the error message:
ld: symbol(s) not found for architecture arm64

Can you help me to solve?

Tanks!
 

RVP

Active Member
Licensed User
Longtime User
the zoom level is maximum currently to 20 as I understand, which isn't enough for my app maps. Can you explain why this is limited in such a way, and when an update will be available which will allow a higher level of zoom?
Thanks


Note, try changing the Map Type. the demo uses MAP_TYPE_TERRAIN which has a limited zoom, try one of the other types
 

tufanv

Expert
Licensed User
Longtime User
Erel
I have a problem. I have created my api key for ios from my console and added my package name for the key : com.ctmobilesoft.bmi911
When i run the program , I am getting

Application_Active
ClientParametersRequest failed, 3 attempts remaining (0 vs 6). Error Domain=com.google.HTTPStatus Code=400 "(null)" UserInfo={data=<CFData 0x16e4a290 [0x3a8c03e8]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}
ClientParametersRequest failed, 2 attempts remaining (0 vs 6). Error Domain=com.google.HTTPStatus Code=400 "(null)" UserInfo={data=<CFData 0x16def400 [0x3a8c03e8]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}
ClientParametersRequest failed, 1 attempts remaining (0 vs 6). Error Domain=com.google.HTTPStatus Code=400 "(null)" UserInfo={data=<CFData 0x16de85b0 [0x3a8c03e8]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}
ClientParametersRequest failed, 0 attempts remaining (0 vs 6). Error Domain=com.google.HTTPStatus Code=400 "(null)" UserInfo={data=<CFData 0x16e79f10 [0x3a8c03e8]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}
Google Maps SDK for iOS cannot connect or validate APIKey: Error Domain=com.google.HTTPStatus Code=400 "(null)" UserInfo={data=<CFData 0x16e79f10 [0x3a8c03e8]>{length = 145, capacity = 256, bytes = 0x3c48544d4c3e0a3c484541443e0a3c54 ... 3c2f48544d4c3e0a}}
Your key may be invalid for your bundle ID: com.ctmobilesoft.bmi911

I have checked my build configurations package name is same with the one i created in my console. I am still getting the white map only with markers
 
Status
Not open for further replies.
Top