geo:lat,lng uri does not work in phone gap - android

Im quite new to phone gap and mobile app development.
I want to use the geo: uri format to open the google maps application but it does not work.
From what I understand I should be able to just add a line like:
test
but when I click on the "test" link nothing happens. I created an apk and loaded it onto my device and in the console I get an error 404 not found error for the link geo:38.897096,-77.036545
I found comment that there needs to be an app on the device with the uri associated to the app. the Google Maps app is definitely installed on the device.
I can't find anywhere to set the association for geo: on the phone.
In my config.xml I have an intent line as:
<allow-intent href="geo:*" />
Questions:
Is there some setup in the phone gap app for the geo: uri to work ?
Is there some place on the device to set the association for geo: to
google maps
What am I missing here ? seems so simple. Google searching
indicates people have success - but not me.
regards
gmax

Well I did not find a fix for that method but I found a really simple solution to the actual problem - opening google maps app and get turn by turn instructions.
Two lines of code
var url = "http://maps.google.com/maps?saddr=&daddr=15 south st, tuncurry"
window.open(url, '_system');
works like a charm
saddr is the start address (leave it blank for current location)
daddr is the destination address
I hope this helps someone.

Related

Deeplinking Squareup pos app is not working

The documentation link: https://developer.squareup.com/docs/pos-api/build-mobile-web#step-5-test-your-code suggest straight forward code like this:
<a href="intent:#Intent;
action=com.squareup.pos.action.CHARGE;
package=com.squareup;
S.browser_fallback_url=https://my.website.com/index.html;
S.com.squareup.pos.WEB_CALLBACK_URI=https://my.website.com/index.html;
S.com.squareup.pos.CLIENT_ID=sq0ids-yourClientId;
S.com.squareup.pos.API_VERSION=v2.0;
i.com.squareup.pos.TOTAL_AMOUNT=100;
S.com.squareup.pos.CURRENCY_CODE=USD;
S.com.squareup.pos.TENDER_TYPES=com.squareup.pos.TENDER_CARD,com.squareup.pos.TENDER_CASH;
end">Start Transaction</a>
I tested it and it does not open any link, my devide already have app installed.
When I try this code:
Take a QR code 2
It open play store app with squareup pos app information, I need to directly open the app and not play store screen of the app, is there any way?
*UPDATE:
I got transactions to work after adding S.com.squareup.pos.LOCATION_ID={{ my_location_id }}. The location ID can be found in Square Developer Portal > Locations. Also if the POS app is passcode protected, you have to open and login with passcode before sending transaction.
*END UPDATE
I've been working through this same issue. I still haven't gotten a transaction to work, but have at least gotten the app to open.
Make sure the CLIENT ID is your production application ID. NOT sandbox.
The WEB_CALLBACK_URI needs to match the Web Callback URL defined in your Square Developer Portal > Point Of Sale API.
I hope this helps. If you do figure this out and get transactions to work, please post your solution for me and others who are sure to run into this issue since the documentation is lacking.

Android Play Store market:// link is no longer working?

I've been redirecting my users for the past year from my domain:
http://example.com/get
to: market://details?id=com.example.myapp
Today I've check this on Nexus 5/LG G3/OnePlus One from the chrome browser app and it stopped working!
Now, when my users try to download the app they are redirected to a broken link.
Anyone know anything about this change in the Chrome app in Android?
from reading the chrome's version 40 release, there are some insight i d like to share
http://blog.chromium.org/2014/12/chrome-40-beta-powerful-offline-and.html
they updated to Content Security Policy Level 2, which has a stronger control over redirects.
https://w3c.github.io/webappsec/specs/content-security-policy/#changes-from-level-1
The path component of a source expression is now ignored if the resource being loaded is the result of a redirect, as described in ยง4.2.2.3 Paths and Redirects.
Redirects are blocked by default, and explicitly allowed with a new unsafe-redirect expression.
So I did some testing. if your initial action started from redirect (no matter window.location or http 302) it will show an error. but once i created a hyperlink to market:// and explicitly clicked it, it worked fine.
for now i ended up creating a webpage in between, where i ask the user to click the link to proceed.
I was testing this url on different devices with different OS/Play Store/ Play Services/ Browsers. looks like it's related to browser but not OS or Play Services.
Initially I updated Play Services and Google Play Store and my old Chrome (v18) was opening market://details?id= url fine.
Afterward I had updated my Chrome (v18) to version 40. And it's not working any more.
Meanwhile, FireFox and default "Browsers" still opens this url and redirects to Google Play Store app.
P.S. I have registered issue in Chromium bug tracker. Let's see if there will be any response:
https://code.google.com/p/chromium/issues/detail?can=2&q=market&colspec=ID%20Pri%20M%20Week%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified&id=454396&thanks=454396&ts=1422888121
UPDATE [6.05.15] : Unfortunately, they decided not to fix this issue, saying, that it's planned behaviour. As they said, user should click the link by himself. Only then re-direct to the app on devices is allowed.
So, there is only one "work-around", that I see for now: create a page, that contains text like "Click link below to go to the app", followed by link like:
Load Example App
or
<a href="intent://foo.bar#Intent;scheme=blabla;package=com.example.myapp;end" > Load App/ Activate your Profile </a>
Try the link below, replacing your.app.id with your own identifier:
https://play.app.goo.gl/?link=https://play.google.com/store/apps/details?id=your.app.id&ddl=1&pcampaignid=web_ddl_1

link to publisher in google play not working

In my native android app i have a "more apps" button which I want to link to all my apps on google play.
I'm following this link: http://developer.android.com/distribute/tools/promote/linking.html#UriSummary
As per the documentation in the link above, i used this query: market://search?q=pub:publisher_name. For publisher name i used my name without the brackets. BUT when i run the app and click on the "more apps" button, the google play store app opens and shows this message:
No results found for "pub:my_name_here"
If i remove the "pub" the url like this:market://search?q=publisher_name
then it shows all my apps. But the problem is that along with my apps, other apps are also being shown which match my surname. Not sure how to resolve this. All i want is to link to only my apps on google play.
I tried searching on Google, StackOverflow but did not find the solution. I tested this on Galaxy Note II. Not sure if it is a device specific issue. Has anyone come across something like this? Thanks!
Just to add to this, I also had this issue and found that adding quotation marks around my developer name solved it.
Instead of this:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pub:Liam Cottle"));
Change it to this:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pub:\"Liam Cottle\""));
The Google Play store app will only show results which match the quoted name exactly... Well, that's what I found anyway.
We have the same issue and the old link used to work up until now.
The workaround so far is to use
Intent marketIntent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://play.google.com/store/search?q=Vendor+Name"));
startActivity(marketIntent);
This works, but this is triggering the open with window and it also requires us to update every single app.
Edit: The provided answer by Liam does not work as this is the exact link and quotation we have been using for years, which just recently stopped working, the only working solution is using the web link above.

Pass referrer data through chrome intent to google play

So I have a mobile web that would try to open my android app, if it does not exist, it would fall back to google play.
for chrome, i use this intent:
intent://some_data_sent_to_app#Intent;scheme=app_scheme;package=package_name;end
and it works fine,
now I want to send some referrer string to google play for the INSTALL_REFERRER in an app.
I tried the following link, it has no problem of sending data to google play, but it would not try to open the app
intent://some_data_sent_to_app#Intent;scheme=app_scheme;package=package_name&referrer=referrer_string;end
I wonder what is the correct way to open the app and fall back to google play with the referrer data being passed?
Looks like it can be done by passing S.market_referrer=referrer_string
For example
intent://some_data_sent_to_app#Intent;scheme=app_scheme;package=package_name;S.market_referrer=referrer_string;end
I have not tested this, but there are some check-ins in the chromium repo for this, don't know if it is available in the current version of chrome.
https://codereview.chromium.org/2061493002
This is a known issue that I am working with the team to get fixed. Someone in the past suggested that you can use intent://some_data_sent_to_app#Intent;scheme=app_scheme;package=package_name&referrer=referrer_string;end however the logic of this has never worked specifically because the Chrome browser (and Android Browser) look for a package id that is direct copy of the string which is parsed as package_name&referrer=referrer_string.
With the new scheme, you can pass arguments as extras to the App, but you must encode the URI as follow:
Do Whatever
source

Load Google Maps With Directions From Chrome Mobile for Android

I am working on a program that lists directions for errand runners so they know where to drive. It delivers the results on their phone. Every errand runner will be using a Galaxy Samsung Tab 3 with Google Chrome browser. So it is using the mobile version of Google Chrome.
Is it possible to launch Google Maps from a link on a webpage with directions to a clients address and get it started navigating to them?
I did some research into this https://developers.google.com/chrome/mobile/docs/intents and it looks like it might be possible but I'm not sure how to do it or if it will work like I intend?
I also found this (http://developer.android.com/guide/appendix/g-app-intents.html), might help give clues to the answer.
I recently found a solution. Apparently just linking to google maps on the device will prompt if you want to open with the maps program, which will work for my purposes.
To make it work properly you will want to link to Google Maps using Coordinates.
In javascript my function looks like below
JS:
function getPosition(position){
latitude = position.coords.latitude;
longitude = position.coords.longitude;
var url = 'http://maps.google.com/maps?saddr='+latitude+','+longitude+'&daddr='+navAddress;
window.location.href = url;
}
$("body").on("click",".routemap",function(){
navAddress = $(this).attr("address");
navigator.geolocation.getCurrentPosition(getPosition);//get the current position for google maps linking purposes.
});

Categories

Resources