how can i use bing maps to draw a route line between two points. i can do that by calling url like:
http://www.bing.com/maps/default.aspx?v=2&lvl=10&dir=0&sty=r&rtp=pos.16.955542_54.73933~pos.17.002046_54.049973
but those urls are not accessible from iphone uiwebview. bing is showing its main page instead.
i tried the bing ios sdk but could not find the way to do this.
If you're still going down the webview route - I'd suggest trying it again, as support for redirecting desktop URLs to mobile equivalents might have been added since.
As long as the right user agent is associated with the request to identify the device as an iPhone, the URL above should get rewritten to something like:
http://m.bing.com/maps/default.aspx?v=2&lvl=10&dir=0&sty=r&rtp=pos.16.955542_54.73933~pos.17.002046_54.049973&mid=10006
and load the mobile directions experience.
Alternatively, go to m.bing.com and follow the directions link and retrieve the mobile-specific URL pattern you're interested in, which doesn't rely on redirecting desktop URLs ... example:
http://m.bing.com/directions#/Maps?w=a.seattle~a.san%20francisco&ul=47.60336588,-122.02145731&mode=1
Related
My app has an several shareable route map links that are formatted as follows and no longer work - meaning they won't natively open in the browser. Instead, both iPhone and Android see the link and are trying to open in Google Maps APP - which breaks the links:
var link = https://www.google.com/maps/d/viewer?mid=14DdJfOLp26RFilzX0tp2hs_M7gBBNFkk&ll=27.931760141489143%2C-82.47564270000004&z=16
window.open(link,'_system','location=yes') ;
I found similar issues from users talking about the problem, but the fix (if it works) requires the user to tweak some settings on their phone. (issue: https://support.google.com/maps/thread/8806737?hl=en ) which for app developers is not a solution.
Previously when opening the links it would natively open in the phones/system default browser (ie: chrome/safari) and everything worked fine. Recently this behavior has changed. Both iPhone and Android phones now seem to recognize the url google.com/maps causing the system to ask the user to open this link in their Maps app....or in the system browser. On iPhone, it doesn't even ask, it just defaults to using the map app. If the user chooses to open in the map app (or on iPhone it simply defaults to it), the above shareable route map won't load - saying map can't be found (or some other error).
On Android, since it at least asks the user: Maps or Chrome - if the user chooses Chrome then the link will work.
This new default behavior is causing shareable route maps to break on iPhone...and on Android where users choose Maps over Chrome.
On Android, I found a way to force these types of maps to use Chrome by using a url scheme. Forcing the map to chrome would look like:
window.open("googlechrome://" +link,'_system','location=yes') ;
However, a url scheme does not exist for Safari on iPhone...causing even this kind of work around to still break on iPad and iPhones.
Either google needs to allow shareable maps back on the default Map app....and/or iPhone needs to create a specific url scheme for Safari....preferably both.
OR....does anyone else have a fix/work around for this on iPhone - or in general?
I'm trying to use the callback functionality of the URL schemes for Google Maps on iOS.
The way how to do that is documented here.
However, I did not manage to get this to work. There is no additional symbol showing up as described in the documentation.
Is this actually still possible or has this feature been removed?
Independent of my application, I also tested this by pasting the URL scheme in the Safari browser, but it doesn't work there either.
It simply starts the Google Maps app but apparently ignores the callback parameters.
Edit:
This is the URL from the example of the documentation:
comgooglemaps-x-callback://?center=40.765819,-73.975866&zoom=14
&x-success=sourceapp://?resume=true
&x-source=SourceApp
The only difference would be that the success parameter gets the URL of the app you want to open when the user clicks on the callback button.
Check if your application's url scheme has been implemented correctly and that you're specifying a valid callback url (that directs back to your app).
Some links that might be useful:
https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html
http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
I implemented Universal Links in our iOS 9 app and they work by calling a method in AppDelegate.swift, in which I get an NSUserActvity with an URL attached to it.
Is there a way to get the (HTTP-) referer? I need to know on which website the user has tapped the link that opened the app.
You should be able to use NSUserActivity > referrerURL instance property. See https://developer.apple.com/documentation/foundation/nsuseractivity/2875762-referrerurl.
No, there is no way to get the referrer.
An Apple employee made that pretty clear on the developer forums: https://forums.developer.apple.com/thread/65423
They say that the only way to get some kind of referrer would be to append it to the URL. Maybe take a look Google's campaign tracking URLs (utm_...).
I found another interesting solution if you need to support iOS 9 and 10 - https://appmetrica.yandex.com/blog/referrer-based-tracking-dlya-ios-tochnaya-atributsiya-dlya-lyubogo-istochnika-trafika.
Since iOS 11 I guess can be used NSUserActivity > referrerURL.
In short:
SFSafariViewController uses the same cookies as Safari app.
You can open invisible SFSafariViewController inside your app.
If your site contains some cookie - use Universal Link to pass it back to the app.
Though it requires to implement something like tracking link on your site.
I'm a newbie iOS programmer and I'm having problems using google's Api "directions" for (multipath/multiroute) on iOS (8.x):
when i ask to draw a route between two location (origin/destination) there aren't any problems but if i add even one more location, the request to web service return a json with no elements.
My url (for the request) is something like this:
https://maps.googleapis.com/maps/api/directions/json?origin=40.853900,14.246600&destination=45.120000,12.535900&waypoints=optimize:true%7C41.910000,12.535900&mode=driving&key=API_KEY
I have already enabled the API's (directions, static maps, google maps for iOS). The api key has been generated today and seems ok.
what am i doing wrong?
Your URL request works for me. I'm getting zero results because your destination coordinate is middle of the ocean.
Make sure your API key iOS key when testing on iOS device and browser key when testing on your browser.
I know that Facebook's custom URL scheme for iOS goes pretty deep, but I'm not sure if it would be possible to link directly to the post review page for a business.
I can launch to the business page with this URL:
fb://profile/323276694418242
But I'd like to launch directly to this page:
I have been attempting to find an answer to this for 2 years now, and the closest I've come is linking to the Reviews "screen" of the app by using the mobile web URL and not even the fb:// URL scheme. For example, https://m.facebook.com/pg/PAGE_NAME/reviews/ If the person has the app installed on their phone, this works. From there the user must tap the stars to leave their review.
Has anyone discovered a better solution, closer to what novicePrgrmr was asking originally?
Some URL schemes are listed here http://wiki.akosma.com/IPhone_URL_Schemes#Facebook. There's nothing about URL schemes in official documentation, so it may be unreliable.
fb://page/(fbid) will work to open to a specific page.
In Reviews documentation we have the following format https://graph.facebook.com/2345053339/reviews.
Try to derive URL scheme from this: fb://page/(fbid)/reviews or something similar.