Need to verify address of a user in iphone - iphone

I need to verify the address entered by user in my app .What basically i need is how to veriry the address entered by the user suppose user enters the address like 7 Breezeland Road, Carpentersville, IL - 60110 now this is the correct address for which i can get lat lon from the following google api http://maps.google.com/maps/api/geocode/json?sensor=false&address=7 Breezeland Road, Carpentersville, IL - 60110 .
But suppose say user enters 7 asdfasdf Breezeland Road, Carpentersville, IL - 60110 then i need to verify this type of address, means is there any api for the same which i can prompt user that this is probably wrong address and ask him was he looking for this 7 Breezeland Road, Carpentersville, IL - 60110.
If someone can add their inputs or suggestions or any related API it would be a great help .

You're probably going to be excited about the Google Geocoding API: http://code.google.com/apis/maps/documentation/geocoding/

Jordan's on the right track with the Google API, but note that Google does address approximation, not address verification. For actual (USA) address validation, you'll need to access a CASS-Certified vendor (one who has been approved by the USPS) to supply official information.
I used to work in the address verification field, at SmartyStreets. For example, they have a service called LiveAddress - it's free like the Google API, but will only return correct results and suggestions, among many other things. So look into that... remember, you probably are wanting to determine if an address is actually deliverable. That comes from official USPS data. Google will show you a pretty map and make a best guess, but often the addresses don't actually exist.

Related

Can I get street address, phone, gender from Google ID token?

I am working on Google Action for Google Assistant. Our custom Action relies on user's phone number to get additional information from external server.
According to the official guide you can use Account linking with Google Sign-In to get some user information from Google ID token:
name
given_name
family_name
profile_picture
email
locale
I know that you can fill out optional contact fields in Google account like address and phone number.
Does anyone know if Google ID token contains this optional information or no?
The answer depends.
Some basic personal metadata is available through Google Sign-In. With regards to the other fields:
Address
This information is not easily accessible. You can use an in-dialog permission to access the current location, but not the home address necessarily.
If your Action uses physical transactions, then you can get their address in order to ship items. But you shouldn't use this as a way to get the address if you're not shipping items, and such an attempt would be detected during review.
Phone Number
No, this is not something you can readily access. For general things like notifications, Google Sign-In gives you an email address. You also shouldn't ask it in your Action. The review team won't be happy with that, and the voice transcription doesn't work very well for long numerical sequences.
Gender
No, this is not something that is part of the Google Sign-In, and there's no helpers. With regards to asking it yourself, I don't think the review team would have a problem, although you may want to consider whether it's necessary for a good voice design.
No. Address, phone, and gender are not available fields/claims in Google's ID Token (JWT).
See: https://developers.google.com/identity/protocols/oauth2/openid-connect#an-id-tokens-payload

Flutter: How to get the users address from contacts

I've guessed the Users Address from their GPS, looking up their location using Google's Places, but the output of that is pretty variable (no locality oftentimes, outside cities a consistent locality field would be helpful to my app). The thing is I do NEED the users home address for my app to work, but they may not be at home when they download the app.
I'd prefer to get their address from contacts. I've looked at a couple of Flutter plugins for accessing the address book, flutter_contacts, etc., but I can't see how you simply get the users details. So how do I request the Users HOME address, HOME email, MOBILE phone, whatever I can get from the device? Age might actually be beneficial too, so I could pivot the app to the needs of those who are using it.
I feel this is such a commonly useful thing it should have its own special permission, rather than the blunt one of exposing their entire contacts address book. So is there a better way of doing it? Less invasive so the user can more easily consent?
There's a special contact called "Profile" that contains the user's details if they bothered to add them on their phones, but in most cases it'll be empty, and anyway, accessing the user's profile requires the "Read Contacts" permission.
It'll be strange to ask the user for the "Read contacts" permission without they understanding why on earth would your app require such a permission "to guess your address" is not a very good reason.
And I suppose might cause some users to uninstall and/or flag your app as potential spyware.
If you app relies on having the user's address, you should instead simply pop a dialog with a question to the user to fill out their address manually.

iOS user authentication (restrict to specific domain name)

I'm developing my first iPhone app to make what is effectively an app version of a fantasy league I created for work colleagues.
I am using Parse for the backend of the app. I only want people to be able to register with their work email address ie only if their e-mail address is _#mycompany.com
I'm sure this would be quite easy to someone who knew what htey were doing but I'm kind of new to this so any advice would be much appreciated.
Thanks
You could do this in a number of ways. The easiest way would be to have the validation happen on-device - just check the e-mail address the user has put into the app, and only allow the registration to happen if it matches the domain you want to limit it to.
However, although this is very easy it's also open to abuse and it's not very flexible (if you want to add additional domains, you have to update the app).
Fortunately, Parse offers cloud code, which lets you validate data server-side. Cloud code is written in JavaScript, and you then upload it to Parse. There is full documentation on Parse's website, including examples for validating data.

Country Restrictions - How does Facebook determine a user's location when filtering gated content?

How is a location determined when showing restricted posts from a page's wall?
Here is the configuration option I am talking about (on a page's settings page)
My scenario is: I have a sever based in the UK which is using the user's auth token to show posts which are gated. Obviously I would like US based users to see these posts.
Will it take into account
My server's IP address?
The location the user has specified on their profile?
The IP the user used to sign up with? --- or something else?
To clarify I have set my location in my profile to be a place in the US, but don't see the posts (when calling the API, or when just viewing the page)
Also, when I log into my UK based account from the US, I still don't see the posts (from API, or from just viewing the page)
Oddly enough, when logged in from the US server, Facebook asks me to validate my account and suggests a UK based mobile number (+44) - could be related to the fact I signed up from the UK?
I have no way of creating an account that is US based because I don't have a US based mobile I can verify with.
I've been doing some testing on this.
I'm in Spain but wanted to see a page I'd restricted to UK only.
I set my current location and home town to London: Did not work
I verified my UK phone (roaming): Did not work
Used a VPN service (hidemyass) to give me a UK IP: Did not work
With the account set like that, no other changes. I called a mate and got him to login to the account in the UK and the page became visible.
So can assume that settings of the account do not affect, and that FB are detecting VPN based traffic - maybe from database list of datacentre IP addresses.
And that it uses a (non-datacentre) IP address detection to determine if you are in this country. Also follows that if you travel abroad you won't be able to see content even if you do "live" in that country. I'm guess if you 'like' the page, then travel you would still be able to see it.

How Would You Redirect a Mobile Webpage based on Carrier?

I'm having some difficulty Googling the answer for this.
Basically I have a page, then I want to redirect them based on Carrier (for example, Sprint, Verizon, Tmobile, etc). So if they are Verizon, they get sent to a Verizon specific-page.
The only information I would have is the IP, hostname, etc. I wouldn't be asking for any information such as their phone number.
By the looks of it, would this be done with hostname? Is there a list available of all mobile carrier hostnames?
Servers have hostnames, clients usually do not. Do you know yours?
The only thing you can do is a reverse IP lookup. This could give the name of ISP that is hosting the client IP, from where the request is comming. See this: http://whatismyipaddress.com/
The only limitation is that user has to be on carriers network. So most non-carrier wifi networks will not get you correct info.
The best way to do this is to use the TelephonyManager. Create a list of carriers then and compare also make sure to have a default case as there maybe cases where the carrier name has changed or you didn't add something to your list.
TelephonyManager tManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String name = telephonyManager.getNetworkOperatorName();
You can use Handset Detection with the Javascript mobile detection method.
If you setup a site profile with no detection rules you can write
custom javascript to access HandsetDetection.isp then redirect them
where ever you like.
Hope that helps. (Disclaimer: I work there).