Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to access Apple's advertiserIdentifier with javascript

Posted on 2013-06-24
2
Medium Priority
?
2,776 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

There are many out there who own an iPad but are frustrated by the lack of Flash support. This prevents many webpages from displaying their content correctly on the iPad .  In addition Flash games are not supported on the iPad either.  Regardless of…
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…
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.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

618 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