Google Maps SDK doesn't work in iOS Share Extension - ios

I have an app that uses the Google Maps SDK for iOS to show an interactive map on a particular screen. It works great.
Now I've added an embedded "share extension" that uses the same components to allow the user to share content (e.g. photos from the Photos app) to my app. Everything else in the extension is showing up exactly as in the app, apart from the Google Maps component, which shows the Google logo on a blank map with no features.
The map responds to taps as I would expect (e.g. I can blindly tap the map and it will report the coordinates I've tapped on), though nothing is shown on the map, which makes me think this is a rendering problem.
The SDK is being initialized with the same API key that I use in the main app. The API key is not restricted to a particular app ID in the Google Console.
Has anyone seen this? Any workaround (apart from switching entirely over to the Apple Maps SDK)?

Related

Why is Google Maps failing to resolve the directions when opening the App with a iOS URL Schema?

I'm developing a React Native application that links out to Google Maps and Apple Maps to provide Turn by Turn navigation.
We've had some interest from Users of being able to use Google Maps on iOS due to the availability of Offline Maps.
When attempting to Link out to Google Maps (using the React Native Linking API) the Google Maps app opens fine. However, the App isn't resolving the Route, and spins forever.
If I go back to my App, leaving Google Maps open, and click the Button that Links out to Google Maps again, it opens Google Maps and resolves almost straight away. As an additional kick in the teeth, it works when Offline and using the Offline Maps feature perfectly.
Below is the link I'm trying to use, where destination is usually a latlong but can be an address.
comgooglemapsurl://maps.google.com/maps?f=d&daddr=${destination}&nav=1
Bonus points:
If you can tell me how start the navigation automagically using the non url Schema; the following does not work with nav=1 at the end:
comgooglemaps://?f=d&daddr=${destination}&nav=1

How do I allow for fallback to a Apple Maps if Google Maps isn't installed?

I have a tab controller that will show nearby stores. I know that 40% of my users have never (or can't though policy) install Google Maps.
How can I fall back to Apple maps if Google Maps isn't installed?
To make things just a little more complex, the "nearby stores" is a tab in a tabbed application.
Well, for starters, the only way you're displaying a Google Map inside your app is by including Google's library -- thereby making moot the question of "is Google Maps installed here".
If you are speaking in terms of opening the Google Maps app if it exists and falling back to the Apple Maps app, you'd use UIApplication's -canOpenURL: method, passing in the scheme for Google's Maps app, which is comgooglemaps://.
Good luck!

Display ads without leaving app

I'm looking at some ad SDKs and it's difficult for me to find a way to present them without leaving the app. I've tried a handful of them but lets say AdMob for purpose of answering this question.
Is there a way to present AdMob ads in an in-app browser once they are clicked? Or would I have to use a different SDK if I want to achieve that.
If the answer is the latter, what well known Ad SDKs would let me do that?
Opening the target page in Safari and not in an in-app browser is on purpose: Safari allows to better track the users. The reason is related to the cookie handling: Safari stores cookies globally while the UIWebView based in app-browsers have a cookie store restricted to a single app. Therefore with in-app browsers, you cannot track users across apps.
However, there is a solution to mitigate the problem provided you have a certain control about the ads (and aren't simply taking the from a network).
An ad can consist of more than just an image with a target link. It can contain interactive elements. You can take advantage of it by creating an ad that opens an overlay when tapped. The overlay shows a web page within your app. The user can then either close it or tap a link that takes her to a further web page shown in Safari.
The standard API to implement an overlay supported by most ad SDKs is MRAID. Google Mobile Ads SDK (formerly known as AdMob SDK) supports it. The Google SDK additionally supports the AdMob SDK.
Good examples for such ads can be found on a Google support page. Specifically check out "Sample Code for an expandable ad (MRAID)" and "Target window: in-app overlay window".

Google Maps API v2 on iOS always show last map view before

I am using Google Maps API v2 with PhoneGap to develop both Android and iOS application. For that purpose i am using PhoneGap plugin that implements native device Google Maps app rather then JavaScript API.
In iOS when i load/show map it first shows last visited location for half a second then it goes to place i set with setCenter or moveCamera. And if there isn't any last visited location (app is started for the first time) map starts from 0,0 coordinates.
In Android everything works fine, when i set certain location it doesn't show anything before that.
I have tried every method there is and nothing works, and i am starting to think that this is default behavior in Google Maps SDK for iOS. But its so bad and makes using maps so confusing that its hard for me to believe there isn't way around this.
Did you try to add cookies function , IOS sometimes specially when using maps dosnt allow that , except those who will allow the cookies, thia would work if its in browser but not natively. Moreover, even if you use phonegape build , it only complie files that Apache understand, meaning you wont be eligable to use ruby files or other files that only supported by the service.

IOS Map (Google Map API vs. MapKit?)

I'm trying to make an iOS app that shows my location on a map and shows some stores (as pins) around me. I want the store pins to be clickable so that below the map there will be a label showing the details for this store when user clicked/touched the pin. My question is should I use MapKit or Google Maps API?
If Mapkit, I'm building in XCode 4.2, the only framework i see is iOS 5 -> MapKit Framework, if i use it, would my app still work on phones with iOS 4?
If Google Maps API, I believe I'll have to use a web-view then load a html googlemaps page. How would I detect a click event on the store pin and send this message to my label below the webview?
MapKit.framework is the most right choice for an App.
You can set the Deployment Target to 4.0 in Xcode, then the App will run on iOS 4 correctly.
(But you can't use Storyboard for interface builder.)
Web App is significantly slower than native App right now.
Hope to help.
It is not necessary that you use a webView if you are using Google's API. You can make use of MKMapView to show stores around you. And in mapView, giving annotations to stores is quite a simple thing. Google Places API is the right place you have to reach. They provide you a request response either in Json or in XML(as you wish). All you have to do is parse it out and drop pin-annotations.

Resources