Solved

How to access Apple's advertiserIdentifier with javascript

Posted on 2013-06-24
2
2,397 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Ever wanted to watch videos in your computer from the bed without the need of standing up and shutting down the computer?  Is your computers operating system Windows XP, Windows Vista or Windows 7?  Do you own a iOS device? If all the answers were y…
     Intro      In this article, I will show you how to parse a JSON in Swift using an open source library called SwiftyJSON (https://github.com/SwiftyJSON/SwiftyJSON). If you haven't heard of a JSON before, it stands for JavaScript Object Notation…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

813 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

13 Experts available now in Live!

Get 1:1 Help Now