Get the current phones number with contact framework api ios - swift

Is it possible to get the current phone's number from contacts permission in Swift?

It's not possible anymore
"For security reasons, iPhone OS restricts an application (including
its preferences and data) to a unique location in the file system.
This restriction is part of the security feature known as the
application's "sandbox." The sandbox is a set of fine-grained controls
limiting an application's access to files, preferences, network
resources, hardware, and so on."
The device's phone number is not available within your application's
container. You will need to revise your application to read only
within your directory container and resubmit your binary to iTunes
Connect in order for your application to be reconsidered for the App
Store

Related

Can PWA access contacts, gps or use the phone camera?

Can PWA access contacts, gps or use the phone camera?
Is this possible in any system (ios, android) ?
Is there any plan in development to implement any of these features ?
There are some restrictions that cannot be overcome with a PWA:
- you cannot access the contacts list on a phone. - On the other hand, you can take photos and use GPS location.
On whatwebcando.today web site you can have a list of APIs available via browser compared to native apps. If you click on one feature, you can see a sample snippet showing how you can implement it and also details about the browsers support.
UPDATE 30.09.2019
From Chrome v77 there is a new experimental API available: Contact Picker
The Contact Picker API is an on-demand API that allows users to select entries from their contact list and share limited details of the selected entries with a website. It allows users to share only what they want, when they want.
For example, a web-based email client could use the Contact Picker API to select the recipient(s) of an email. A voice-over-IP app could look up which phone number to call.
Hence it might be that the the remaining PWA restrictions will be solved in a near future.
It depends on the device the PWA is running on.
Camera and audio seem to be universally supported. Contacts, on the other hand, seem to be inaccessible regardless of platform.
Other features, such as GPS and geolocation may vary from device to device.
A good way to find out what your browser is capable of (and thus your PWA - it runs in a web browser) is to go to https://whatwebcando.today with the browser you want to support. Try visiting it with an iPhone, Android or other device for a list of enabled features.
This list changes as browser and OS developers increase access to native features, so there's a good change that if it isn't available now, it will be in the future. However, it's important to be aware that some features such as access to the wider file system and hardware configuration are likely to remain sandboxed for security reasons.

Specific Country restriction Appstore

I have made application only visible to Germany, Now Apple informed to include Monitoring Shape-Based Regions for if the user move away after installing from Germany? How to monitor the region to restrict the application if exceed Germany area?
I have tried with following links
1) Core Location region monitoring
2) Apple: Location Awareness Programming Guide
My doubt is how to restrict application only available to Germany. Should I try with latitude, longitude. And how to monitor the regions/territory exception.
I uploaded it to the app store, but they reject with the following reason :
22.1: Apps must comply with all legal requirements in any location where they are made available to users. It is the developer's
obligation to understand and conform to all local laws.Please see
Monitoring Shape-Based
Regions
for information on how to apply Geo restriction.
My doubt is how to restrict Geo location.
By default, the app will be available in all countries the App Store currently supports, unless you specifically select individual countries/stores. You can choose individual countries.
log into iTunesConnect and click Manage Your Apps. Select your app and click the Rights and Pricing button. You can select the stores you want from this page. For More you can
review the page 48
Update
As Updated
Easiest way to solve this topic would probably is to decide which countries you want to make your app available in ? and as i have search something like review countries local laws to see if any thing is illegal related to the app. And this relate to your Questions
What if I make my app available on other countries than usa?
If your application relies on location services to function properly,
you should include the UIRequiredDeviceCapabilities key in the app’s Info.plist file.
You can use this key to specify the location services that must be present in order to execute your application. The App Store uses the information in this key from preventing users from downloading apps to devices that do not contain the listed features.
http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html
this link contains all the information you need.

asking for permission from the user to autodetect SIM phone number - xCode

There's a forbidden function by apple for getting a user's phone number because this may be intrusive and so on.
this is the code as far as I know
NSString *num = [[NSUserDefaults standardUserDefaults] stringForKey:#"SBFormattedPhoneNumber"];
I was wondering... what about before doing that the app should be displaying in a UIAlertView the approval of the user for such action, is that a valid solution???
thanks in advance folks!
The thing with undocumented functions is that they can't be relied upon. Any version update could break them. That said, the bigger issue is if Apple will approve an app that uses such a call. If not (consensus seems to be that they are not in favor of using SBFormattedPhoneNumber) then simply asking the user for permission before doing it will probably not buy you any points in the approval process. My suggestion would be to avoid this and simply ask the user for their phone number if you need it.
Your app will be rejected by the review team if it uses any forbidden API at all. Alert view or no alert view.
SBFormattedPhoneNumber is not present anymore after ios4 version. Basically there is no way to do it. Trying to access the number by some undocumented way would risk your app getting rejected.
Here is Apple response about this functionality
"For security reasons, iPhone OS restricts an application (including its preferences and data) to a unique location in the file system. This restriction is part of the security feature known as the application's "sandbox." The sandbox is a set of fine-grained controls limiting an application's access to files, preferences, network resources, hardware, and so on."
The device's phone number is not available within your application's container. You will need to revise your application to read only within your directory container and resubmit your binary to iTunes Connect in order for your application to be reconsidered for the App Store.

What folders and files gets backed up through iTunes?

Everytime I get a call my old wallpaper shows even though I have a new one. I'm trying to find it on my iOS but I cannot seem to figure out where. So I'm trying to track down what folders gets backed up when i backup my iPhone since I have restored it and it's still there.
(I'm using a jailbroken device)
I know this isn't the actual folder names and etc but it will give you an idea what it's backing up though. Good Luck.
With iOS 1.1 and later
Safari bookmarks, cookies, history,
and currently open pages
Map bookmarks, recent searches, and
the current location displayed in
Maps
Application settings, preferences,
and data
Address Book and Address Book
favorites
Calendar accounts
Wallpapers
Notes
Call history
Mail accounts
YouTube bookmarks
SMS messages
Saved suggestion corrections (these
are saved automatically as you reject
suggested corrections)
Camera Roll (photos and screenshots
taken by the iPhone)
Voicemail token (This is not the
Voicemail password, but is used for
validation when connecting. This is
only restored to a phone with the
same phone number on the SIM card.)
Web clips
Network settings (saved Wi-Fi
hotspots, VPN settings, network
preferences)
Paired Bluetooth devices (which can
only be used if restored to the same
phone that created the backup)
Keychain (this includes email account
passwords, Wi-Fi passwords, and
passwords you enter into websites and
some other applications. The keychain
can only be restored from backup to
the same iPhone or iPod touch. If you
are restoring to a new device, you
will need to fill in these passwords
again.)
With iOS 2.0 and later (in addition to the above)
Managed Configurations/Profiles
List of External Sync Sources (Mobile Me, Exchange ActiveSync)
Microsoft Exchange account configurations
Nike + iPod saved workouts and settings
App Store application data (except the application itself, its tmp and caches folder).
With iOS 3.0 and later (in addition to the above)
Videos in Camera Roll
Per app preferences allowing use of location services
Offline web application cache/database
Voice Memos
Autofill for webpages
Trusted hosts having certificates that cannot be verified
Websites approved to get the location of the device
In-app purchases
New with iOS 3.1: Videos in the Camera Roll that are 2 GB or larger are not backed up (iOS 4 and later will back up videos 2 GB and larger)
All user documents and settings get backed up, Application settings as well as system settings.
Applications each have a Documents folder that user data can be saved to, so thats pretty much what gets backed up for applications, including app preferences.
These are the Wallpaper locations:
/private/var/mobile/Library/SpringBoard/HomeBackground.jpg
/private/var/mobile/Library/SpringBoard/HomeBackgroundPortrait.jpg
/private/var/mobile/Library/SpringBoard/LockBackground.jpg
/private/var/mobile/Library/SpringBoard/LockBackgroundPortrait.jpg
I have manually managed to find out what gets backed up and managed to solve the problem :)
I downloaded the trial of iphone packup extractor http://www.iphonebackupextractor.com/ and found what I was looking for.
Also it seems like I just had to change the lockscreen in the iPhone since the file called LockScreen.jpg was the picture I was looking for but since I had another lockscreen using winterboard I didnt think of this.
Good luck to anyone else who has problems similar to this.

App data security on jailbroken iPhones

If I'm not mistaken (and if I am mistaken, here or in what I say below, please correct me), non-jailbroken iPhones provide two broad areas of storage space:
for apps (and data that comes bundled with apps);
for user-managed files.
I understand that the former is protected storage, meaning that data bundled with an app and stored in that area is not accessible to the user except via the app.
On a jailbroken iPhone, does this protected area still exist? If so, what protections remain; i.e. is data stored within it still inaccessible to the user?
On a jailbroken iPhone the user has full access to all resources. The user will have more control over the device than any developer. There is no place to hide secrets on the device, even memory is accessible.
Even on a non-Jailbroken phone it's easy to extract the user data from the backups that iTunes creates when the user syncs (unless the user specifically enables the "encrypt backups" option).
The apps themselves are nominally encrypted using iTunes DRM, but since you can download apps in iTunes on a desktop and (AIUI) easily remove the DRM, again, even users without jailbroken devices can access your resources.
You have it backwards:
Third-party apps are sandboxed so they cannot access "protected" data, including some system data and other apps' data.
System apps tend to not be sandboxed and have extra privileges (they might all do). For example, App Store has to be able to upgrade other apps, and exploiting holes through Safari was one way to root a phone (suggesting Safari runs as root).
Nowhere is app data protected from the user. Instead, Apple apps do not expose the filesystem (and third-party apps can only expose a small portion of it).
Additionally, the "two areas of storage" are actually / (more or less the firmware image) and /var/mobile (more or less the user data partition). AIUI, upgrading the OS overwrites / but leaves /var/mobile intact; this is how a normal upgrade manages to preserve all your data without a long backup/restore process. IIRC, system apps are in /Applications and third-party apps are installed to /var/mobile/Applications.
I'm not sure what category Apple apps distributed on the App Store fall under (iBooks, Remote, Pages/Numbers/etc).