Jump to content
Sign in to follow this  
Levente

Get Unique Device Identifier under iOS Delphi 12

Recommended Posts

Hi,

 

What unique identification number can be read from iPhones?

We are developing an application in Delphi 12 that requires a unique identification number from the user. This is necessary to identify the user's device when it connects to our cloud server.

 

Under Android, we solved this by reading the Android ID, which works well:

var
  AndroidID: JString;
begin
  AndroidID := TJSettings_Secure.JavaClass.getString(TAndroidHelper.ContentResolver, TJSettings_Secure.JavaClass.ANDROID_ID);
  ShowMessage(JStringToString(AndroidID));
end   

 

Thank you in advance for your help!

 

Levente

 

Share this post


Link to post
4 minutes ago, Levente said:

What unique identification number can be read from iPhones?

On iOS, it is common practice to use the identifierForVendor method of the UIDevice class. This value is guaranteed to remain the same for the life of the install (i.e. if the user uninstalls/re-installs your app, it may change). This code shows how to obtain it as a string. 

  • Thanks 1

Share this post


Link to post

Dave,

 

Thank You for a quick answer, it is working! 😀

Best regards,

 

Levente

Share this post


Link to post

Hello. 

I am having this error:

[DCC Error] uLogin.pas(220): E2003 Undeclared identifier: 'TJSettings_Secure'

I believe i need to add the correct unit in uses. What's the correct unit please.

Thank you all ..

 

Ivanilson Ribeiro

Brasil

 

Share this post


Link to post
4 hours ago, IvanilsonR said:

[DCC Error] uLogin.pas(220): E2003 Undeclared identifier: 'TJSettings_Secure'

It's declared in: Androidapi.JNI.Provider

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×