I have an iOS app that uses JSON to contact our server where we have a web app using HandleSpecialURL to return a yes or no to determine membership status.
It seems foreign users, at least some including Canada, the valid response never gets to them. I’m in Mexico and I turned off my vpn and it worked for me, but I had a Canadian user try it and it showed in the log as successful, however the app either didn’t get a yes response ir a corrupted one.
I send back the string of “yes” or “no”.
Does anybody have any clue as to why this is happening?
[quote=477742:@Richard Albrecht]I created a table that records the last name and the member number. It does a query to determine yes or no to the question are they a member.
The JSON string looks like this: {“ValidTo”:“01\/31\/2023”,“IsValid”:“Yes”}
The code in the iOS app reads results like this: App.gbIsMember = dtStatus.Value(“IsValid”) = “Yes”
If true it unlocks the app.
I would think if there were an exception it wouldn’t write to the table.
It’s only the last name that gets sent.[/quote]
What are you doing with that date on the client side? If you are parsing a date like 1/31/2023 could be that on non-US systems that it is being interpreted as: Day/month/year, which could lead to an exception.
You may want to use a SQL date format to remove ambiguity.
There seems to be no exception as it writes to db. Even if they server returns true they are receiving it as no according to the log.
Here’s the code on the server:
lsSql = "SELECT Now() as Today, tblmembership.MemberSince, tblPeople.MemStatus, tblmembership.ValidTo FROM tblmembership " + _
"JOIN tblpeople ON tblmembership.PersonID = tblpeople.PersonID " + _
"WHERE tblpeople.MemberNumber = " + json.Value("MembershipNumber") + _
" and tblpeople.LastName = '" + json.Value("Lastname") + "'"
rs = sesDB.SQLSelect(lsSql)
If sesDB.CheckDBError then
LogAction(json.Value("MembershipNumber"), json.Value("Lastname"), sesDB.ErrorMessage, False)
Return False
end
If (rs.Field("MemStatus").StringValue = "Active Member" or _
rs.Field("MemStatus").StringValue = "Sent To VPM 1" or rs.Field("MemStatus").StringValue = "Sent To VPM 2" or _
rs.Field("MemStatus").StringValue = "Back From VPM" ) then
if rs.Field("Today").DateValue <= rs.Field("ValidTo").DateValue Then
mdResult.Value("ValidTo") = rs.Field("ValidTo").DateValue.ShortDate
LogAction(json.Value("MembershipNumber"), json.Value("Lastname"), "", True)
mdResult.Value("IsValid") = "Yes"
else
mdResult.Value("IsValid") = "No"
LogAction(json.Value("MembershipNumber"), json.Value("Lastname"), "", False)
end
else
mdResult.Value("IsValid") = "No"
LogAction(json.Value("MembershipNumber"), json.Value("Lastname"), "", False)
end
…probably because your date definition on your computer is still the same. change the localization parameters on your computer to use Canadian English or even Canadian french. that will change the date formatting. I would suspect that you will have the error.
as others have suggested, it could well be the date that is the issue. Changing the VPN does not change local computer parameters.
I set my iPad to canada and it failed to activate. I set my mac to canada and in the iPhone simulator it activates. There are no Options in the simulator. And it must not be using the mac defaults.