How do apps access your username / device name without the user explicitly providing it? (Example in description) - ios

For example, the VLC app was able to somehow get my username (or device name?) without me ever giving it this info. Here is a screenshot that shows the VLC app greeting me by name in the app switcher. How is this possible if I never gave the app this information? Which API could it be using to obtain this info?

This is possible due to UIDevice class. It doesn't require permissions in order to get some basic system information, after all it's just your name (if you were to ask for location/health data/contacts/etc that would be something else and thus user permission is mandatory).
For more information refer to official documentation here https://developer.apple.com/documentation/uikit/uidevice

That's not VLC but rather iOS.
iOS suggests apps based on time and location of your device. The name is taken from your iCloud Account. VLC is not aware of that banner.

Related

Usage description for NSCameraUsageDescription

Is a formal description of using permission enough to approve an app in the Add Store?
For example, is this option suitable:
This app requires access to the camera
... or should it be specified as follows:
This app requires access to the camera to take a picture for the profile or scan a QR code
It is rather difficult to describe in detail what this permission will be used for. For example, the camera can be used for many functions (take a picture, read a QR, record a video). At the same time, I would not want the app to be rejected due to the lack of a detailed description.
In general, they will not reject you if you keep your message like the first option. But what is written in the documentation of Apple about this is:
For each key, provide a message that explains to the user why your app
needs to capture media, so that the user can feel confident granting
permission to your app.
This message will be shown to the user and do you think the user will be happy with your explanation of why you need the camera permission.
This app requires access to the camera.
If this is not a well-known app I will reject this permission.
Much better is if you show something like this:
This app requires access to the camera to take a picture for the
profile or scan a QR code when you need it.
At the end of the day, you deciding how to build trust in your users.
It depends on the Apple reviewer's mood...
My app passed with a usage description similar to your first option, but later it was rejected, so go with the specified version.

How can I get identification string look like IMEI in IOS

My project have a case: one account user can only log on to one device ( if user log on to app in device A, user can't log on to app in device B). My Idea is: when user login, I'll get the imei Iphone (like android) and send it with request login to server. But I can't get imei. I try with UUID, but UUID will change when re install app. Keychain does not solve the problem. Please help me.
You have to use Keychain to store Unique Id , this will not change even if user delete app
You can use any wrapper Source code to do this
here is an example
https://github.com/Joe0708/KeychainUUID
At the beginning I'd like to mention that I do not know any method that directly answers your question, especially that Apple does not allow you to read IMEI and other similar stuff due to privacy concerns. This has been answered here.
The workaround might be as follows
Take a look at the UIDevice class, especially at the identifierForVendorProperty which provides you (according to documentation ) with a device specific value.
The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.
As far as i know some financial apps are secured this way to permit only one device to access the account. This however requires registering a device each time application is reinstalled.
Alternatively you can use UUID you generate within your app (first run) and then you assign it for the user online. It might take the form similar to two step verification process. Be aware however that with such restrictions user will have to be online all the time to use your app.

Is there a way to extract user’s full name from HealthKit in Swift?

I am trying to build a fitness app and I would like to build the user’s profile within the app but I would like to make it as quick and easy as possible for the user. I am able to extract the users stats such as height, body mass, birth date etc from HealthKit but is there a way for me to extract the user’s full name since the ios health app has this on it’s profile page.
I have sifted through the documentation, but so far I haven’t found anything.
no there is no api AFAIC.
you can ask for addressbook access and read the 'me' contact
Well you could go through all the contacts in the AddressBook and see if any of them are marked with the owner flag.
Just be aware that doing this will popup the "this app wants access to the address book" message. Also Apple isn't very keen on these kind of things. In the app review guide it is specified that an app can not use personal information without the user's permission.
You will get the username like this:
var username = NSUserName()!
and you can use same user name for your app.
Yeah, I don’t want to meddle with the address book and freak the user out. I’ll probably just ask them to enter their name instead.

Can I do an app like Find my iphone in iOS?

I want to create an app which has the following features.
Track friends / family members location
Locate/track the stolen device location
Lock the device, delete the device datas by using desktop or by SMS.
Most of the above features are provided by Apple's "Find my iPhone" app. But I just want to know whether is it possible to create such an app.
From my understanding, Apple wont let the developers to use private API's and they wont allow to erase datas (like Messages, Calls details) remotely.
Please suggest me some ideas.
If you create any app which directly competes with any of the apples build app will be rejected by appstore.. But most of the above things you can do with private api's and with the help of a web service..
It wasn't possible prior to iOS7. App was not able to respond to any remote calls. There is a new API which "can" be used to solve similar things: http://mobile.tutsplus.com/tutorials/iphone/ios-7-sdk-mutlitasking-enhancements/ or http://www.objc.io/issue-5/multitasking.html (Remote notifications). You may be able to track your friends or stolen device, but not to lock or erase it.
There is a way to remotely erase the iPhone without Apple's Find My iPhone - via Exchange account. There are some open source implementations of MS Exchange, so there may be a chance to make a service which would be able to wipe the device. But even when you make that service, there will be a need to add the "exchange account" into the iDevice. I am not aware of any function which can do so programmatically.
Anyway - You can do an app which is similar to Apple's apps, but it must be somehow different. It must provide some special content or functionality, otherwise it will be rejected.

iOS access phone settings programmatically

is it possible to access the phone settings of an iOS Device programmatically? I'm currently building an app and there I will provide contact possibillities, for example a direct link for calling (you just push it and then the specific contact number is called).
But I only want to show that possibility, if the user isn't calling with an unknown number.
You can access the contacts stored in the phone using the Address Book framework. If you're unfamiliar with the framework, I suggest you take a look at this quick start tutorial.
EDIT It seems you wish to read the state of the Show My Caller ID system setting, however you cannot programmatically access the system settings.
Use ABAddressBook for getting contact details in your project...
see this

Resources