Windows phone Development

websss
websss used Ask the Experts™
on
Hi all am trying to work on app(Windows phone ),part of it should get an IMEI number of a device,however its giving the DeviceUnique ID instead.
My requirement is that i should get the device IMEI not the DeviceUniqueId,Is there a way i should get the IMEI on windows phone devices?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
PawełI Design & Develop Software

Commented:
https://msdn.microsoft.com/en-us/library/windows/apps/ff769508(v=vs.105).aspx

are you trying to unlock it for development, win 8.1 phone?
websssCEO

Author

Commented:
I've developed an app with xamarin
The app is working fine

Within the app, I need to reveal the IMEI number to the user, so they can type this number into a webpage to register onto a separate system

However, I can't seem to get the IMEI number
I know you can type *06#* on the phone and call it, but it needs to be done within the app
PawełI Design & Develop Software

Commented:
I really don't think that's possible, because there'd be nothing preventing your application from getting this information and posting it to a database somewhere.
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

websssCEO

Author

Commented:
That's kinda the point
It's meant for a GPS tracking app, and the unique identifier is the IMEI
:(
PawełI Design & Develop Software

Commented:
yes, but from what i understand if i had that number i could track your phone, and hence stalk you, so i think that's why MS doesn't allow your app to get it.

if your'e trying to track the phone, have you tried creating a background task that would periodically post it's GPS location to a service?
websssCEO

Author

Commented:
No, you cant track a phone with an imei number

I have this background task pointing to a service already, but if 1000 phones are on your account you'll not know which one is yours
PawełI Design & Develop Software

Commented:
so i'm not following why you cant use the DeviceUnique ID like you mentioned at first?
websssCEO

Author

Commented:
because the software that accepts the data requires imei as the unique identifier (15 digit number)
DeviceUniqueId is an alphanumeric string
PawełI Design & Develop Software

Commented:
well my friend I wish you luck, if you ever figure it out please let me know how. Sorry i couldn't be of more help.
websssCEO

Author

Commented:
thanks for you help
Billing Engineer
Most Valuable Expert 2014
Top Expert 2009
Commented:
Would this suggestion work out for you?
I found that on another site...
Provided as is:

add a head file "CoreTelephony.h" to your project

CoreTelephony.h

struct CTServerConnection
{
    int a;
    int b;
    CFMachPortRef myport;
    int c;
    int d;
    int e;
    int f;
    int g;
    int h;
    int i;
};

struct CTResult
{
    int flag;
    int a;
};

struct CTServerConnection * _CTServerConnectionCreate(CFAllocatorRef, void *, int *);

void _CTServerConnectionCopyMobileIdentity(struct CTResult *, struct CTServerConnection *, NSString **);
add the following code to your class

#import "CoreTelephony.h"

struct CTServerConnection *sc=NULL;
struct CTResult result;
void callback() { }
now, you can get imei easily

    NSString *imei;
_CTServerConnectionCopyMobileIdentity

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial