I have implemented push notification in my iPhone app and for device registration i used following code in the app.
[[[UIDevice currentDevice] identifierForVendor] UUIDString];
Above code works fine in the most of the devices. However, recently in some iPhone 5s devices with iOS 7.1 it returns null and due to this app crashes.
An alphanumeric string that uniquely identifies a device to the app's vendor.
The identifierForVendor is an unique identifier that stays the same for every app of a single vendor on a single device, unless all of the vendor's apps are deleted from this device. See Apple's documentation about when this UUID changes.
Delete all apps from the vendor then reinstall an app from the same vendor and a new "IDFV" will be generated. And the same app on two different devices will give two different "IDFV" values.
Quoting the documentation;
If the value is nil, wait and get the value again later. This happens, for example, after the device has been restarted but before the user has unlocked the device.
This can happen for instance with a VoIP app that starts by the system on restart to allow the app to listen for incoming calls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With