I have an app that lets users dial a call. Basically it has number input that user enters and then it dials the number using this code.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
{
//its iphone
NSString *tmpStr1 = [NSString stringWithFormat:#"tel://%#", labelStr.text];
NSLog(#"tmpStr1: %# ...", tmpStr1);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:tmpStr1]];
}
tmpStr1: tel://8003310500 ...
Recently I submitted an app update to Apple and I keep getting rejections from the Apple reviewer saying that nothing happens when the call button is pushed.
I tested this on my actual device, iPhone 6 running iOS 8 and it works just fine. My question is, did Apple change something in iOS 8.4 to disable this feature? Is there some sort of user permission needed before doing that? Unfortunately I cannot upgrade my device to iOS 8.4 at this time. (there are some personal reasons)
Related
Looking for your help
I am facing a problem while getting Device Identifier. Actually I am using a UIDevice+IdentifierAddition.h, NSString+MD5Addition.h classes to get Identifier, but its return same identifier for all my devices i.e. iPhone 4s (iOS 7.1) & iPhone 5 (iOS 7.1.1).
Can any one have any solution for this problem. because I want a something unique for device specific. its my app requirement.
Important: I want to submit this app on app store, So please, answer must be as per the guidelines
Since iOS 7 it is no longer possible to get any unique device identifiers.
Your options are:
create your own unique ID and save it in the keychain.
use the vendor ID, which will be reset if all the app by the same vendor are removed from the device.
Now it's possible in iOS 11.0+, Apple has introduced a new API called DeviceCheck API with which developers can uniquely identify a device.
As mentioned in the documentation:
Using the DeviceCheck APIs, in combination with server-to-server APIs,
you can set and query two bits of data per device, while maintaining
user privacy. You might use this data to identify devices that have
already taken advantage of a promotional offer that you provide, or to
flag a device that you have determined to be fraudulent. The
DeviceCheck APIs also let you verify that the token you receive comes
from an authentic Apple device that includes your app.
Also, check out the following WWDC17 video starting at 24 min:
https://developer.apple.com/videos/play/wwdc2017/702/
EDIT:
A thoroughly detailed tutorial on this Device Check topic can be found here.
In Objective c
NSString *uniqueIdentifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
In Swift
var uniqueId=UIDevice.currentDevice().identifierForVendor.UUIDString as String
println("Your device identifires =>\(uniqueId)")
Unfortunately identifierForVendor changes when you uninstall your application so to guarantee that the it will not change save it in the keychain
I used pod 'SSKeychain' Homepage: https://github.com/soffes/sskeychain
Here is the code
+ (NSString *)getDeviceId {
NSString *appName=[[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey];
NSString *strApplicationUUID = [SSKeychain passwordForService:appName account:#"MY_KEY"];
if (strApplicationUUID == nil) {
strApplicationUUID = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
[SSKeychain setPassword:strApplicationUUID forService:appName account:#"MY_KEY"];
}
return strApplicationUUID;
}
[UIDevice uniqueIdentifier]; is deprecated in ios 5 and above.
You can get identifier for vendor using this
NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];
and store this in keychain and use later on.
Also you can check for
1) NSUUID
2)CFUUID
you will get detail description here Unique device identification in ios
If you're trying to identify a device only once i.e., to estimating the number of unique users then I suggest using "advertisingIdentifier" of ASIdentifierManager.
Apple Doc
I am a bit confused... I have researched about URLs to use for sending users to the review page on the app store
I have tried:
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=842516162&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8
and also:
itms-apps://itunes.apple.com/app/id842516162
I have an iPad (4th gen) and latest iPod, on the iPad it works correctly, on the iPod it comes up with a blank page.
Both are running 7.1.1
What do I need to do to get it to work on the ipod touch?
Try this
NSString *str = #"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=842516162";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
This question already has answers here:
UIDevice uniqueIdentifier deprecated - What to do now?
(32 answers)
Closed 9 years ago.
Our iOS application is for specific users. So, we used device unique identifier for user identification. This approach works fine till iOS 6, because we are getting same value every time.
NSString *strUniqueIdentifier = [[UIDevice currentDevice] uniqueIdentifier];
In iOS 7, above method is retuning different values and we are getting issues in user identification. iOS 7 apis provide following alternate.
NSUUID *oNSUUID = [[UIDevice currentDevice] identifierForVendor];
[strApplicationUUID setString:[oNSUUID UUIDString]];
I replaced "uniqueIdentifier" with "identifierForVendor", and created Ad hoc build. Installed build on both iOS 7 and iOS 6 devices. In iOS 7, so far, i am getting same value every time, but iOS 6 gives different values every time, when we delete and reinstall app.
Currently application is not available on App store. So i am not sure how this api works for App store build.
Questions:
1) For appstore app, is "identifierForVendor" return same value for iOS 7 every time? or it may change when user delete and reinstall app in future?
2) Is any other alternative available for "unique identifier" in iOS 7 apis, which return same values for both iOS 6 and 7?
3) Any other suggestions...
As you can see in the documentation here:
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.
The value of this property may be nil if the app is running in the
background, before the user has unlocked the device the first time
after the device has been restarted. If the value is nil, wait and get
the value again later.
The value in this property remains the same while the app (or another
app from the same vendor) is installed on the iOS device. The value
changes when the user deletes all of that vendor’s apps from the
device and subsequently reinstalls one or more of them. Therefore, if
your app stores the value of this property anywhere, you should
gracefully handle situations where the identifier changes.
In short, the identifier for a particular vendor will remain the same if at least one app by that vendor remains on the device. Once there are no more apps left (or in the case of a single app, it is reinstalled), the identifier can and will change. As far as I know, there should not be a difference on iOS 6 vs iOS 7, so any difference you are seeing is coincidental.
3) Any other suggestions...
You should consider strategies for identifying and authorizing the user instead of the device. Depending on a device-specific identifier prevents authorized users from switching devices without some sort of administrator interaction, and allows non-authorized users access if they happen to find/steal/borrow an authorized device. You can avoid these problems by relying on user credentials instead of device identifiers.
Is there is a alternative for UDID. My app will not be going to App Store as i'm using enterprise distribution. So is there any replacement. I tied advertising identifier, open udid, UIID and secure UDID. But if the phone is reset then i will get a new UDID. Any help would be appreciated.
For above 6.0 iOS you can use identifierForVendor Or CFUUIDRef.
-(NSString*)uniqID
{
NSString* uniqueIdentifier = nil;
if( [UIDevice instancesRespondToSelector:#selector(identifierForVendor)] ) {
// iOS 6+
uniqueIdentifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
} else {
// before iOS 6, so just generate an identifier and store it
uniqueIdentifier = [[NSUserDefaults standardUserDefaults] objectForKey:#"identifierForVendor"];
if( !uniqueIdentifier ) {
CFUUIDRef uuid = CFUUIDCreate(NULL);
uniqueIdentifier = ( NSString*)CFUUIDCreateString(NULL, uuid);
CFRelease(uuid);
[[NSUserDefaults standardUserDefaults] setObject:uniqueIdentifier forKey:#"identifierForVendor"];
}
}
return uniqueIdentifier;
}//
UPDATE
As Leon Lucardie comment he is right
identifierForVendor will change after app uninstall/reinstall. See here The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them.
You have to create vendor id then save it using keychain and get it back once you reset your phone using date time
check this link UUID and UDID for iOS7
After trying all possible replacements. Advertising identifier is the best way to go. It remains same even after phone reset when i tested. If the user turn it off in the settings then we get a null value. Except for this hitch, this is the best replacement so far. Will update if i find any other better replacements.
Easy, Just use this code:
-(NSString *)getUID{
if ([[UIDevice currentDevice] respondsToSelector:#selector(identifierForVendor)]) {
// This is will run if it is iOS6 and above
return [[[UIDevice currentDevice] identifierForVendor] UUIDString];
} else {
// This is will run before iOS6 and you can use openUDID or other
// method to generate an identifier
return [OpenUDID value];
}
}
As you can understand, if you plan to support iOS 5 then you should use OpenUDID (Apple restrict reading the UDID even on iOS 5). With some answers here you would simply get rejected by Apple (my code has been approved in several apps of mine).
Pay attention that identifierForVendor would change if your user would remove the app (or all vendor apps if there are several) and reinstall.
I use the combination APNS token and vendorId. Both are checked to verify cellphone identity and I update them accordingly in cellphone and server when one of those change.
It´s still possible that both change, when the app is uninstalled and/or reset and stored for a few months, then both values would change.
This will cause that next time the cellphone gets the app installed, it will be identified as a new one.
Additional to this I run a process in server that marks as deleted any device which hadn't connected to the server for two months.
In that case user authentication is required and cellphone is added again to the customer's pool of devices.
I have only one app yet, but once I have the second one I might include advertisingId.
These blog posts by Ole should be helpful:
iOS 5: http://oleb.net/blog/2011/09/how-to-replace-the-udid/
iOS 6+: http://oleb.net/blog/2012/09/udid-apis-in-ios-6/
You can use after ios 6+ with Swift 2.2 version.
var uniqueIdentifier: NSString!
uniqueIdentifier = UIDevice.currentDevice().identifierForVendor?.UUIDString
I have an iPhone app that is available on app store, free of cost. Now I want to make the same app to be paid. No problem til then. But the challenge before me is to release the trial version of the same app with few of features disabled or not shown at all. What I want is to put a button on the trial app that will took the user to app store for the paid version.
How to do this?
- (IBAction) openPremierVersionAppStore {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"itms://itunes.apple.com/us/app/shaifgupta/app_id"]];
}