Solved

How to access Apple's advertiserIdentifier with javascript

Posted on 2013-06-24
2
2,322 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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

iPad in the Business – Quick Start Part 1 Getting Started with Active Sync Mail Many people seem to have issues connecting their iOS device to their company Exchange Server and this article covers the steps for Active Sync configuration as wel…
     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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

18 Experts available now in Live!

Get 1:1 Help Now