Solved

How to access Apple's advertiserIdentifier with javascript

Posted on 2013-06-24
2
2,365 Views
Last Modified: 2013-07-03
Is it possible to access the advertisingIdentifier (IDFA) in iOS 6 using javascript from within an App?
0
Comment
Question by:Rossamino
  • 2
2 Comments
 
LVL 7

Expert Comment

by:pegasys
ID: 39294176
You can't get that IDFA via javascript. What you need to do is pull that from the app itself and push the ID to the script from the app.

[[ASIdentifierManager sharedManager] advertisingIdentifier]

Open in new window


Is what pulls the IDFA. What I'd do is get that, and the page which has the JScript on it, I'd have a querystring like this:

https://api.mysite.com/api/theJSPage.php?DeviceIDFA=123123123123

There's no other way to do it.
0
 
LVL 7

Accepted Solution

by:
pegasys earned 500 total points
ID: 39294187
something to the effect of:

    NSString *myIDFA = [[ASIdentifierManager sharedManager] advertisingIdentifier];
    NSString *urlString = [NSString stringWithFormat:@"https://api.mysite.com/api/theJSPage.php?DeviceIDFA=%@",myIDFA] 
    NSURL *websiteUrl = [NSURL URLWithString:urlString];
    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:websiteUrl];
    [myWebView loadRequest:urlRequest];

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I recently went through the process of creating an installable image of an iPhone mobile app (an .ipa file) that beta testers could load onto their test devices. The process involved quite a few steps, but both Appcelerator and Diawi.org had decent …
What's a UDID? If you're involved in developing, testing, or even reviewing an iOS application that's in beta, then at some point you may need to know the UDID for any iOS devices that you'll be testing on. What's the UDID? It stands for Unique Dev…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now