is it possible to get the location of a phone using USSD? - ussd

Is there any way to get the location of a cell phone (i.e. latitude/longitude) automatically when the user starts a USSD session?

On that, talk to safaricom, its possible but I believe you have to convince them why they should allow you to get the location of a cell phone. For now they just provide 4 parameters as a response in USSD responses.

Related

Swift - Check if website visited

Is there a method or way in Swift to check if a user has visited a certain webpage or website?
I know a question was asked for this already:
How can I access browser history in my iOS project?
Or, maybe, is there a way to track if the phone has made a request from a certain IP?
I just want to create a condition to see if a user has visited my website.
No.
Due to the application sandbox for third party apps, you cannot track/access previous network requests outside your app.
Learn more about app sandboxing here.
The only way I can think of doing this is to get current IP of the user:
Swift - Get device's IP Address
Then do a get request to see if it is in my server logs. But this is not very reliable as they may have visited the website on a different network.
Could request a location one the phone and on the browser then compare lat and long to see if in a radius... still, not a reliable solution.

Is it possible to send Twitter auto-reply without GPS tracking?

I want to send an auto reply to the user's tweets from his iOS application, I am able to do that if the user has allowed the iOS application to access his location, but when the access to location is denied by the user, tweeter is not allowing sending the auto reply to tweets.
I'm wondering whether it is mandatory to have access to the user's location to send an auto reply to his tweets. Or, do we have some reliable way to accomplish the specified functionality without accessing user's location?
OP, from what I understood, you want to find out a given user's location without consented access to the user's phone's location services.
A way to do this, not super reliable I'd add, is to reverse geolocate their IP Address using a server side geocode API.
Mind you, it is not super reliable but might do the trick. You might encounter problems on mobiles, especially due to the erratic nature of their IP Addresses.
Twitter themselves have an API to help on that. For example you could use GET geo/search to find out a place ID closest to a given IP Address using this:
https://dev.twitter.com/rest/reference/get/geo/search
and then you could use that place ID to find out the approximate Lat / Long of the user, using GET geo/id/:place_id:
https://dev.twitter.com/rest/reference/get/geo/id/%3Aplace_id
(there are probably straighter ways of doing this in other APIs aswell but I'm assuming you are already authenticated on twitter's API so I'm trying to give you something easier to integrate into your code)
Let me know if that helps.
I haven't implemented it yet but can guess that Twitter does so to avoid the spam or robotics tweets. So if Twitter gets multiple auto Tweets from same place so he would consider them as spam.
What you can do is after every 8-10 Tweets make new latitude longitude and send this location to Twitter while using auto tweeting.
How ?
Take a default location (lat, long) and you can find add 500m-1km in that location every 8-10 Tweets and use this new location for next time. This method is not reliable but can work in your case.
Note: Use this way only in case when you're not able to get device location.

Making a faux iPhone dialer

I want to make a joke application for a friend (not for general sale) that looks exactly like the iOS Phone application but so that whatever number is dialled into the application it appears to dial that number but actually dials a preset number in the background.
The way I figured to do it would be through the following:
User enters a number and hits the call button
Save the number entered as a contact's name and programmatically set the number of that contact as the preset number
Get the application to ring the preset number, to which it would switch over to the real iOS phone application and dial, but with it being a saved number in the contacts it will display the name, which is the number entered by the user.
Delete that contact upon re-opening the application as for it to not ask which number to dial the next time.
This is the only way that I can think of pulling this off, but it seems like it will look unconvincing; especially when it switches over to the real Phone application. Can anyone think of a better way? Such as calling from within the application?
I wouldn't usually take junk requests like this but it made me curious as to pull it off best.Thanks
If you are not going to publish this, then there is no reason why you shouldn't use private apis. See this answer (How to directly make a phone call with private API CTCallDial()?)

Passes in Passbook: location and time sensitive

As I understand for the moment, the location and time sensitive passes in Passbook only support time and/or location based notifications. So at the correct time and location, the user will get a notification for the pass.
I was wondering if these properties also can be used to change the pass. For example, if you are in some specific store, the coupon provides a 50% reduction instead of a 20% reduction. If it is not possible to do this locally on the iOS device, is it possible to send a request to the server based on location and/or date to achieve the same thing?
Sorry to be the bearer of bad news, but it's not possible to accomplish this.
Firstly, the data within the pass is fixed at any point in time. As you've said, it can be fixed to a list of locations and/or a date.
Secondly, the pass cannot communicate with a server except to request an update in response to a push notification. This means you will never know where a pass is.
The only option way to achieve something like this would be to generate passes using an app that is location aware, but I don't think this is what you're after.
You can send a push update to a Pass at a specific time. This way you can (for example) convert a 10%-off coupon to 20%-off on Fridays (and then switch it back after Friday).
After a user has initially 'Added' your Pass promotion into their Passbook you can update it at any time without requiring the user to 're-approve' your update.
Your server does not know when a Passbook user has triggered a location alert - otherwise you could track their movements via Passbook. Apple does not want their customer's security to be compromised in this way.
However, you could issue a coupon that is normally 20%-off (for most stores, or online) but that the location alert for a specific store said 'Get 50% Off at this store'. When the customer comes in to have their Pass scanned & activated, your server will then know the customer's location and can apply the 50% reduction.

User current country - based on current location of the user

I would like to check in which country the user is - I have tried a few ways but none give the requested result. My main goal is when the app launches check in which country the user is and based on this by pressing a button call a different phone number, For instance user can be in Canada use the app and by pressing the button dial an XXX number and next week with same Iphone be in the US and by pressing the same button dial a YYY number.
I have tried using CoreTelephony but this is good only for 4.0 and up i want my app to support earlier versions of iOS also tried Geocode but i do not want to display a map in my app.
Any guidance will be appreciated.
Get your current location and reverse geocode it.
Get your current location using CLLocationManager. Reverse geocoding is supported by iOS SDK 5, so if you need support versions below 5.0, you need to use external geocoding service. For example, Goolge Maps Reverse Geocoding, that is described in details here: http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding
What you need to do, just send a request like below:
http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true and you'll get back a JSON with formatted address components.

Resources