Giter VIP home page Giter VIP logo

ios-measurement's Introduction

[DEPRECATED] Quantcast iOS SDK - Quantcast no longer supports mobile in app measurement at this time.

This implementation guide provides steps for integrating the Quantcast for Apps SDK, so you can take advantage of valuable, actionable insights:

  • Know Your Audience - Quantcast uses direct measurement and machine learning to build accurate and detailed demographic profiles.
  • Compare and Compete - Gauge user loyalty by analyzing visit frequency, retention and upgrades over time.
  • Attract Advertising – Attract advertisers by showcasing your most powerful data points using a trusted source.
  • Improve Campaign Performance – Increase your campaign performance by understanding characteristics of your best users and finding more people like them.

If you have any implementation questions, please email [email protected]. We're here to help.

Integrating Quantcast for Mobile Apps

To integrate Quantcast’s SDK into your iOS app, you must use Xcode 6 or later. The Quantcast SDK supports apps built for iOS 10.0 and later.

Download the SDK

There are two ways to get the SDK. You can download it directly from the Quantcast website, or you can use GitHub. If you download the file from our site, unzip the file before continuing to the section Set Up Your Xcode Project.

(optional) Getting the Quantcast SDK from GitHub

If you use Git for your version control, we recommend that you make the Quantcast SDK repository a submodule in your project’s Git repository. To do so, open the Terminal application in your Mac, cd into your Git repository folder, and issue the following commands:

git submodule add https://github.com/quantcast/ios-measurement.git 
git submodule update --init 
cd ios-measurement
git submodule update --init 

If you don’t want to make the Quantcast SDK repository a submodule in your repository, you can use Git to clone the Quantcast iOS SDK's Git repository and initialize all of its submodules.

git clone https://github.com/quantcast/ios-measurement.git ./quantcast-ios-sdk
cd ./quantcast-ios-sdk/
git submodule update --init

Set Up Your Xcode Project

  1. Import the Quantcast SDK code into your project. In Xcode, select your project and choose the option “Add Files to “, then select the Quantcast-iOS-Measurement folder from your download.

    Screenshot - Add Files to Project
  2. Link the following iOS frameworks and libraries to your project if they are not already. From your project properties, go to the “General” section, the scroll down to “Linked Frameworks and Libraries” and hit the “+” at the bottom left. Then use the Command key to multiselect and add the following:

    • AdSupport See Use of the AdSupport Framework.
    • CoreGraphics
    • CoreTelephony
    • Foundation
    • libsqlite3.dylib or libsqlite3.tbd
    • libz.dylib or libz.tbd
    • Security
    • SystemConfiguration
    • UIKit
    Screenshot - Add Frameworks and Libraries

Use of the AdSupport Framework

Linking to the AdSupport framework is not strictly necessary for integration with the Quantcast SDK. However, if you choose to link to the AdSupport framework in order to serve ads in your app or track installation attribution, that framework will allow Quantcast to have to access to IDFAs, which we can use to improve the quality of demographic data we provide about your users in our Measure service.

Remember, if your code or any third party code in your app utilizes the IDFA, you will need to state that in the app submission process, in response to the question “Does this app use the Advertising Identifier (IDFA)?” Thus, if you’re integrated with the Quantcast SDK and you choose to link to the Ad Support framework, you should answer that question “yes.” Additionally, in the app submission process, you will need to confirm that your app – and everyone that interfaces with your app – honors the Limit Ad Tracking setting, which the Quantcast SDK does.

If You Are Not Using Automatic Reference Counting (ARC)

If your project does not use automatic reference counting (ARC), take the following steps to set a compiler flag for Quantcast source files. Otherwise, skip to the next section.

  1. In your project configuration screen, click on the “Build Phases” section, then expand “Compile Sources”.

    Screenshot - Expand Compile Sources
  2. Multi-select every Quantcast source file by holding down the Command button and choosing every filename that begins with “Quantcast”.

    Screenshot - Multi-select Quantcast Files
  3. Hit enter to bring up a text input box, then type in “-fobjc-arc” and hit enter.

    Screenshot - Set Compile Flag

SDK Integration

The recommended way to integrate the Quantcast SDK requires only a single line of code:

  1. Import QuantcastMeasurement.h into your UIApplication delegate class

    #import "QuantcastMeasurement.h"
    Screenshot - Import Header
  2. In your UIApplication delegate's application:didFinishLaunchingWithOptions: method, place the following:

    [[QuantcastMeasurement sharedInstance] setupMeasurementSessionWithAPIKey:@"<Insert your API Key Here>" userIdentifier:nil labels:nil];

    Replace "<Insert your API Key Here>" with your Quantcast API Key. The API Key can be found in the file “api-key.txt” in your Quantcast SDK folder. All your API keys can also be found on your Quantcast dashboard: https://www.quantcast.com/user/resources?listtype=apps. For more information about how and when to use the API Key, read Understanding the API Key.

    The userIdentifier: parameter accepts a string that uniquely identifies an individual user, such as an account login. Passing this information allows Quantcast to provide reports on your combined audience across all your properties: online, mobile web and mobile app. Please see the Combined Web/App Audiences section for more information.

    The labels: parameter may be nil and is used to create Audience Segments. Learn more in the Audience Labels section.

    Screenshot - SetupMeasurement

(optional) Understanding the API Key

The API key is used as the basic reporting entity for Quantcast Measure. The same API Key can be used across multiple apps (i.e. AppName Free / AppName Paid) and/or app platforms (i.e. iOS / Android). For all apps under each unique API Key, Quantcast will report the aggregate audience among them all, and also identify/report on the individual app versions.

Compile and Test

You’re now ready to test your integration. Build and run your project. Quantcast Measure will record activities and events from your iOS emulator, as long as you quit your app properly (as opposed to closing the emulator window while the app is running). After finishing an app session, you will see your session recorded in your Quantcast Measure dashboard the following day. If you don’t, you can refer to our troubleshooting guide for tips. Questions? Please email us at [email protected].

Congratulations! Now that you’ve completed basic integration, explore how you can enable powerful features to understand your audience and track usage of your app.

User Privacy

Privacy Notification

Quantcast believes in informing users of how their data is being used. We recommend that you disclose in your privacy policy that you use Quantcast to understand your audiences. You may link to Quantcast's privacy policy: https://www.quantcast.com/privacy.

User Opt-Out

You can give users the option to opt out of Quantcast Measure by providing access to the Quantcast Measure Opt-Out dialog. This should be accomplished with a button or a table view cell (if your options are based on a grouped table view) in your app's options view with the title "Measurement Options" or "Privacy". When a user taps the button you provide, call the Quantcast’s default Opt-Out dialog using the following method:

[[QuantcastMeasurement sharedInstance] displayUserPrivacyDialogOver:currentViewController withDelegate:nil];

The currentViewController argument is the current view controller. The SDK needs to know this due to how the iOS SDK presents modal dialogs (see Apple's documentation for presentViewController:animated:completion:). The delegate is an optional parameter and is explained in the QuantcastOptOutDelegate protocol header.

If you would like to provide your own custom control over the Quantcast's opt out process, it is possible to set the opt out preference by setting the isOptedOut property directly instead of using the default dialog. For example:

[QuantcastMeasurement sharedInstance].isOptedOut = YES;

When not using the default dialog we strongly recommend that you also have a button to display Quantcast's Privacy Policy. You can display this by calling:

[[QuantcastMeasurement sharedInstance] displayQuantcastPrivacyPolicy]; 

Note: when a user opts out of Quantcast Measure, the SDK immediately stops transmitting information to or from the user's device and deletes any cached information that may have retained.

Optional Code Integrations

Combined Web/App Audiences

Quantcast Measure enables you to measure your combined web and mobile app audiences, allowing you to understand the differences and similarities of your online and mobile app audiences, or even the combined audiences of your different apps. To enable this feature, you will need to provide a user identifier, which Quantcast will always anonymize with a 1-way hash before it is transmitted from the user's device. This user identifier should also be provided for your website(s); please see Quantcast's web measurement documentation for instructions.

Normally, your app user identifier would be provided in your UIApplication delegate's application:didFinishLaunchingWithOptions: method via the beginMeasurementSessionWithAPIKey:userIdentifier:labels: method as described in the Required Code Integration section above. If the app's active user identifier changes later in the app's life cycle, you can update the user identifier using the following method call:

[[QuantcastMeasurement sharedInstance] recordUserIdentifier:userIdentifierStr withLabels:nil];

The current user identifier is passed in the userIdentifierStr argument.

Note that in all cases, the Quantcast iOS SDK will immediately 1-way hash the passed app user identifier, and return the hashed value for your reference. You do not need to take any action with the hashed value.

Audience Labels

Use labels to create Audience Segments, or groups of users that share a common property or attribute. For instance, you can create an audience segment of users who purchase in your app. For each audience segment you create, Quantcast will track membership of the segment over time, and generate an audience report that includes their demographics. If you have implemented the same audience segments on your website(s), you will see a combined view of your web and app audiences for each audience segment. Learn more about how to use audience segments, including how to create segment hierarchies using the dot notation, here: https://www.quantcast.com/help/using-audience-segments.

There are two ways to assign labels. The first is via the appLabels property. Set the appLabels property to record labels related to user properties. For example, to assign two labels, “purchaser.ebook” and “sharer.onFB”, you could do this:

NSArray *myUserSegmentMembership = @[@"purchaser.ebook",@"sharer.onFB"];
[QuantcastMeasurement sharedInstance].appLabels = myUserSegmentMembership; 

Setting the appLabels property has the effect of passing these labels with every method call of the Quantcast SDK. At any time however, you can temporarily add to the labels you’ve assigned using appLabels by setting the labels: argument in your Quantcast method call.

Here is an example that adds the label “sharer.firstShare” in addition to the labels you’ve already assigned (“sharer.onFB”, “purchaser.ebook”) via the appLabels property. This example uses the logEvent:withLabels: method, which you can learn about under Tracking App Events.

NSString *newLabel = @"sharer.firstShare";
NSString *theEventStr = @"tweeted";
[[QuantcastMeasurement sharedInstance] logEvent:theEventStr withLabels:newLabel]; 

All labels that are set during the course of an app session will register a visit for that app session, but only labels set via the appLabels property will persist across sessions. A session is started when an app is launched, or when it is woken from the background after more than 30 minutes. A session is defined as ended when an app is closed or when a new session starts. In the example above, the session will register a visit on audience segments: “sharer.onFB”, “purchaser.ebook”, and “sharer.firstShare”. If the app is then suspended for more than 30 minutes, then awakened, our servers will record a new app session. If no additional calls are made to QuantcastMeasurement, only the segments assigned via the appLabels property, “sharer.onFB” and “purchaser.ebook”, will register a visit for that session.

The labels: argument of most Quantcast SDK methods is typed to be an id pointer. However, it only accepts either a NSString object representing a single label, or a NSArray object containing one or more NSString objects representing a collection of labels to be applied to the event.

While there is no specific constraint on the intended use of the label dimension, it is not recommended that you use it to indicate discrete events; in these cases, use the logEvent:withLabels: method described under Tracking App Events.

Tracking App Events

Quantcast Measure can be used to measure audiences that engage in certain activities within your app. To log the occurrence of an app event or activity, call the following method:

[[QuantcastMeasurement sharedInstance] logEvent:theEventStr withLabels:nil];

theEventStr is the string that is associated with the event you are logging. Hierarchical information can be indicated by using a left-to-right notation with a period as a separator. For example, logging one event named "button.left" and another named "button.right" will create three reportable items in Quantcast Measure: "button.left", "button.right", and "button". There is no limit on the cardinality that this hierarchal scheme can create, though low-frequency events may not have an audience report due to the lack of a statistically significant population.

Geo-Location Measurement

Quantcast no longer offers Geo Location measurement out of the box. If you are interested in this feature please send your business reason to [email protected].

Digital Magazines and Periodicals

Quantcast Measure provides measurement features specific to digital magazines and periodicals. These options allow the measurement of specific issues, articles and pages in addition to the general measurement of the app hosting the magazine. In order to take advantage of this measurement, you must at a minimum tag when a particular issue has been opened and closed and when each page in that issue has been viewed (in addition to the basic SDK integration). You may also optionally tag when a particular article has been viewed. For more information, please refer to the documentation in the Periodicals header file which can be found in the SDK source folder at Optional/QuantcastMeasurement+Periodicals.h.

Measuring Directly-Served Ad Campaigns

For apps that serve advertising and can access advertiser and campaign identifiers from their ad serving system, Quantcast can measure the audience exposed to these campaigns. If you want to additionally log the ad displays that occur within your app and have audience measurement against the exposed audience, first you must first add the optional source found in Optional/QuantcastMeasurement+Advertising.h. Then add the log ad impression methods when advertisements are shown or refreshed:

[[QuantcastMeasurement sharedInstance] logAdImpressionForCampaign:inCampaignOrNil media:inMediaOrNil placement:inPlacementOrNil withAppLabels:nil];

Where inCampaignOrNil is an NSString of the campaign identifier being displayed for the ad impression, inMediaOrNil is an NSString of the ad creative identifier being displayed, and inPlacementOrNil is a NSString of the placement identifier for the location. Note that the Campaign, Media and Placement strings are all optional, and also that any periods in their name will be treated like a label period, indicating the level of hierarchy.

You may also pass a dynamic audience label here. In this case, the label passed in the app labels argument will place the device user who saw the ad impression into the indicated audience segment. You might use this the ad impression label to categorize the type of ad product being displayed so that you can get aggregate reports on audience exposure. See Audience Labels section above for more information on Audience Segments.

SDK Customization

Logging and Debugging

You may enable logging within the Quantcast iOS SDK for debugging purposes. By default, logging is turned off. To enable logging, call the following method at any time, including prior to calling either of the beginMeasurementSession: methods:

[QuantcastMeasurement sharedInstance].enableLogging = YES;

You should not release an app with logging enabled.

Event Upload Frequency

The Quantcast iOS SDK will upload the events it collects to Quantcast's server periodically. Uploads that occur too often will drain the device's battery. Uploads that don't occur often enough will cause significant delays in Quantcast receiving the data needed for analysis and reporting. By default, these uploads occur when at least 100 events have been collected or when your application pauses (that is, it switched into the background). You can alter this default behavior by setting the uploadEventCount property. For example, if you wish to upload your app's events after 20 events have been collected, you would make the following call:

[QuantcastMeasurement sharedInstance].uploadEventCount = 20;

You may change this property multiple times throughout your app's execution.

Secure Data Uploads

As of version 1.5.0, secure downloads are turned on by default. This was changed due to Apple's new App Transport Security update The Quantcast iOS SDK can still support non-https calls if that is preferred. In order to disable secure data uploads, add following preprocessor macro definition to your project's precompiled header file (the file that ends with '.pch'):

#define QCMEASUREMENT_USE_SECURE_CONNECTIONS 0

Note that if you turn off secure connections, then you will need to set up the proper exceptions using the NSAppTransportSecurity key in you info.plist. The NSExceptionDomains key should be set to quantcount.com and included subdirectories NSIncludesSubdomains. Please read more about setting up exceptions here

Trouble Shooting

Little or No App Traffic Showing Up In App's Profile On Quantcast.com
Quantcast updates its website with your app's latest audience measurement data daily. If even after 1 day no data is showing up in your app's profile on quantcast.com, please check the following:

  • The Quantcast SDK does most of its data uploading when your app is transitioned to the background. If during your development and testing workflow in Xcode you regularly end a test run of your app by pressing "stop" within Xcode, your app has not necessarily had a chance to upload usage data. To ensure your app gets a chance to upload usage data to Quantcast while you are testing, be sure to click the Home button on the device being tested in order to put your app into the background and thus trigger a usage data upload to Quantcast.
  • If you encounter trouble with your build, please review the documentation for the project setup and SDK integration. The most common errors involve missing one of the steps outlined. If you have are still having trouble, please email [email protected].

License

This Quantcast Measurement SDK is Copyright 2012-2014 Quantcast Corp. This SDK is licensed under the Quantcast Mobile App Measurement Terms of Service, found at the Quantcast website here (the "License"). You may not use this SDK unless (1) you sign up for an account at Quantcast.com and click your agreement to the License and (2) are in compliance with the License. See the License for the specific language governing permissions and limitations under the License. Unauthorized use of this file constitutes copyright infringement and violation of law.

ios-measurement's People

Contributors

barthazer avatar quantcast-engineering avatar smithkevin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-measurement's Issues

Allow building without IDFA usage

I'm kinda surprised there hasn't been anything documented about this, but from what we can tell, this SDK uses IDFA improperly. My app just got rejected because of it. We need a way to compile out IDFA usage entirely.

Swift Package Manager Support

It would be great if a binary .xcframework with Swift Package manager support could be added. Many other projects including Quantcast's own consent management framework are now supporting SPM.

EXC_BAD_ACCESS crash within QuantcastDatabase

I'm seeing quite a few crashes come in from users running iOS 7.0+ from the Quantcast measurement SDK (version 1.4.2). It seems isolated to the QuantcastDatabase class and its use of SQLite 3.

QuantcastDatabase.m line 115
-[QuantcastDatabase executeSQL:]
Crashed: NSOperationQueue Serial Queue
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x0000000c
Thread : Crashed: NSOperationQueue Serial Queue
0  libsqlite3.dylib               0x39953e78 sqlite3_randomness + 1611
1  libsqlite3.dylib               0x3994e491 sqlite3_free_table + 29932
2  libsqlite3.dylib               0x3994e2a7 sqlite3_free_table + 29442
3  libsqlite3.dylib               0x39943d69 sqlite3_value_text + 9692
4  libsqlite3.dylib               0x3992516d sqlite3_finalize + 2048
5  libsqlite3.dylib               0x39940995 sqlite3_step + 41084
6  libsqlite3.dylib               0x39936ab1 sqlite3_step + 408
7  DIY                            0x0022e667 -[QuantcastDatabase executeSQL:] (QuantcastDatabase.m:115)
8  DIY                            0x0022d141 -[QuantcastDataManager recordEventWithoutUpload:withPolicy:] (QuantcastDataManager.m:173)
9  DIY                            0x0022cdcf -[QuantcastDataManager recordEvent:withPolicy:] (QuantcastDataManager.m:146)
10 DIY                            0x00233b8f __73-[QuantcastMeasurement internalResumeSessionWithAppLabels:networkLabels:]_block_invoke (QuantcastMeasurement.m:762)
11 Foundation                     0x2f8013c7 -[NSBlockOperation main] + 130
12 Foundation                     0x2f7f15ab -[__NSOperationInternal _start:] + 770
13 Foundation                     0x2f89576d __NSOQSchedule_f + 60
14 libdispatch.dylib              0x39b54ded _dispatch_queue_drain$VARIANT$up + 444
15 libdispatch.dylib              0x39b55297 _dispatch_queue_invoke$VARIANT$up + 38
16 libdispatch.dylib              0x39b6788d _dispatch_root_queue_drain + 76
17 libdispatch.dylib              0x39b67b21 _dispatch_worker_thread2 + 56
18 libsystem_pthread.dylib        0x39c96bd3 _pthread_wqthread + 298

Podfile doesn't autoupdate to latest point fix release

I'm on 1.4.2 and the current version is 1.4.6. However, doing pod install doesn't seem to be picking up the latest version. Is there a bug in the podspec?

Here's the relevant line in my podfile:

pod 'Quantcast-Measure', '~> 1.4'

Thanks!

CSMeasurement Crash

Fatal Exception: NSInternalInconsistencyException
info was wrong class in ReachabilityCallback

Thread : Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x2ff74f0b exceptionPreprocess + 130
1 libobjc.A.dylib 0x3a70bce7 objc_exception_throw + 38
2 CoreFoundation 0x2ff74ddd +[NSException raise:format:]
3 Foundation 0x30921e8b -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 86
4 my-app 0x00200989 ReachabilityCallback (CSReachability.m:87)
5 SystemConfiguration 0x3275cb67 reachPerform + 786
6 CoreFoundation 0x2ff3ffef __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
+ 14
7 CoreFoundation 0x2ff3f4b7 __CFRunLoopDoSources0 + 206
8 CoreFoundation 0x2ff3dca7 __CFRunLoopRun + 630
9 CoreFoundation 0x2fea8769 CFRunLoopRunSpecific + 524
10 CoreFoundation 0x2fea854b CFRunLoopRunInMode + 106
11 Foundation 0x3089b497 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 254
12 my-app 0x00497903 -QuantcastUploadJSONOperation start
13 Foundation 0x3094c745 __NSOQSchedule_f + 60
14 libdispatch.dylib 0x3abf925f _dispatch_async_redirect_invoke + 110
15 libdispatch.dylib 0x3abfa689 _dispatch_root_queue_drain + 228
16 libdispatch.dylib 0x3abfa8dd _dispatch_worker_thread2 + 56
17 libsystem_pthread.dylib 0x3ad25c17 _pthread_wqthread + 298
18 libsystem_pthread.dylib 0x3ad25adc start_wqthread + 8

Crashes on resume

I'm getting crashes when my app resumes. The offending code is in QuantcastMeasurement.m in the startReachabilityNotifier method:

myAddress.sin_addr = *(struct in_addr *) gethostbyname([url host].UTF8String)->h_addr_list[0];

startReachabilityNotifier gets called from internalResumeSessionWithAppLabels:networkLabels:

IPv6 changes

Hi,
Could you guys push a new release with the IPv6 changes commit to Cocoapods? It would really helpful.

Thanks!

Troubles on Xcode 8 with Swift 3

screenshot 2016-11-02 14 47 38

Compiler warns to replace the names of notification observers... So I had to manually add #import <UIKit/UIKit.h> on top of the file in order to recognize them
And there is also deprecated functions on

  1. "QuantcastMeasurement+InstallAttribution.m" line 47
  2. "QuantcastUtils.m" line 639

arm64 compatibility

There are a number of warnings related to NSUInteger conversions when building for arm64. It still builds, but it would be nice to fix these up. Thanks.

Doesn't compile in project in Xcode 6

I've got Quantcast in an existing project. After upgrading to Xcode 6, the Quantcast library no longer compiles. I'm getting a bunch of errors saying "Missing context for method declaration" in QuantcastUtils.m.
screen shot 2014-09-23 at 9 16 09 am

App crash

I'm currently on version 1.4.2. We just released our app to the app store yesterday and we've had five crashes so far. Do you want me to post the entire crash log/stack trace here? The line where it is crashing is:

  • [QuantcastDatabase executePreparedQuery:bindingInsertData:]
    in QuantcastDatabase.m, line 244

I've attached an image of the stack trace for a few of the crashes that should give you a better idea of what's going on.
screen shot 2014-05-07 at 9 29 49 am

Thanks for the help!

Error when using Cocoapods with use_frameworks! setting

I have incorporated the Quantcast SDK via Cocoapods with the use_frameworks! option set in my Podfile.

When compiling the app I get the following errors:

  1. Include of non-modular header inside framework module 'Quantcast_Measure.QuantcastDatabase'

This error is shown at this line:

  1. Include of non-modular header inside framework module 'Quantcast_Measure.QuantcastNetworkReachability'

This error is shown at this line:

I can get around this by setting Allow Non-modular Includes In Framework Modules to Yes in the Build Settings of my project, but I would rather not change that setting if possible.

Update for Xcode6/iOS8

In QuantcastUtils.m, I believe the line #import "zlib.h" needs to move. Try compiling your code in Xcode6 and you should see the line causes an error as-is.

UI API call from a background thread causes issues in Xcode 9

Using the latest version of Quantcast in Xcode 9, we are seeing an issue where the framework calls a UI API method (specifically UIApplication applicationState) within a background thread. This causes a runtime warning when running the application but also a crash (log below) on running unit tests.

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 30094, TID: 601744, Thread name: (none), Queue name: com.quantcast.measure.eventQueue (QOS: UNSPECTest Case 'testExample' started.
IFIED), QoS: 0
Backtrace:
4   Quantcast_Measure                   0x00000001125c2fb9 -[QuantcastMeasurement checkSessionID] + 217
5   Quantcast_Measure                   0x00000001125c50af __144-[QuantcastMeasurement internalBeginSessionWithAPIKey:attributedNetwork:userIdentifier:appLabels:networkLabels:appIsDeclaredDirectedAtChildren:]_block_invoke + 1103
6   Quantcast_Measure                   0x00000001125ca744 __48-[QuantcastMeasurement launchOnQuantcastThread:]_block_invoke + 36
7   Foundation                          0x00000001112849b7 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
8   Foundation                          0x000000011128481a -[NSBlockOperation main] + 68
9   Foundation                          0x0000000111282cd6 -[__NSOperationInternal _start:] + 778
10  libdispatch.dylib                   0x000000011b3c82b5 _dispatch_client_callout + 8
11  libdispatch.dylib                   0x000000011b3cd565 _dispatch_block_invoke_direct + 324
12  libdispatch.dylib                   0x000000011b3c82b5 _dispatch_client_callout + 8
13  libdispatch.dylib                   0x000000011b3cd565 _dispatch_block_invoke_direct + 324
14  libdispatch.dylib                   0x000000011b3cd401 dispatch_block_perform + 109
15  Foundation                          0x000000011127ece4 __NSOQSchedule_f + 342
16  libdispatch.dylib                   0x000000011b3c82b5 _dispatch_client_callout + 8
17  libdispatch.dylib                   0x000000011b3ce232 _dispatch_continuation_pop + 500
18  libdispatch.dylib                   0x000000011b3cca93 _dispatch_async_redirect_invoke + 760
19  libdispatch.dylib                   0x000000011b3d2a72 _dispatch_root_queue_drain + 568
20  libdispatch.dylib                   0x000000011b3d27dc _dispatch_worker_thread3 + 119
21  libsystem_pthread.dylib             0x000000011b8835a2 _pthread_wqthread + 1299
22  libsystem_pthread.dylib             0x000000011b88307d start_wqthread + 13
2017-09-26 15:47:26.965525-0500 BuzzFeed[30094:601744] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 30094, TID: 601744, Thread name: (none), Queue name: com.quantcast.measure.eventQueue (QOS: UNSPECIFIED), QoS: 0
Backtrace:
4   Quantcast_Measure                   0x00000001125c2fb9 -[QuantcastMeasurement checkSessionID] + 217
5   Quantcast_Measure                   0x00000001125c50af __144-[QuantcastMeasurement internalBeginSessionWithAPIKey:attributedNetwork:userIdentifier:appLabels:networkLabels:appIsDeclaredDirectedAtChildren:]_block_invoke + 1103
6   Quantcast_Measure                   0x00000001125ca744 __48-[QuantcastMeasurement launchOnQuantcastThread:]_block_invoke + 36
7   Foundation                          0x00000001112849b7 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
8   Foundation                          0x000000011128481a -[NSBlockOperation main] + 68
9   Foundation                          0x0000000111282cd6 -[__NSOperationInternal _start:] + 778
10  libdispatch.dylib                   0x000000011b3c82b5 _dispatch_client_callout + 8
11  libdispatch.dylib                   0x000000011b3cd565 _dispatch_block_invoke_direct + 324
12  libdispatch.dylib                   0x000000011b3c82b5 _dispatch_client_callout + 8
13  libdispatch.dylib                   0x000000011b3cd565 _dispatch_block_invoke_direct + 324
14  libdispatch.dylib                   0x000000011b3cd401 dispatch_block_perform + 109
15  Foundation                          0x000000011127ece4 __NSOQSchedule_f + 342
16  libdispatch.dylib                   0x000000011b3c82b5 _dispatch_client_callout + 8
17  libdispatch.dylib                   0x000000011b3ce232 _dispatch_continuation_pop + 500
18  libdispatch.dylib                   0x000000011b3cca93 _dispatch_async_redirect_invoke + 760
19  libdispatch.dylib                   0x000000011b3d2a72 _dispatch_root_queue_drain + 568
20  libdispatch.dylib                   0x000000011b3d27dc _dispatch_worker_thread3 + 119
21  libsystem_pthread.dylib             0x000000011b8835a2 _pthread_wqthread + 1299
22  libsystem_pthread.dylib             0x000000011b88307d start_wqthread + 13

Setting isOptedOut prior to starting measurement session should be supported

If one sets [QuantcastMeasurement sharedInstance].isOptedOut to NO prior to calling any methods to start measurement, I get a message in the console about No Quantcast API Key or Network p-Code being passed to the SDK. It appears as though the setting of the property attempts to start a measurement session, and subsequently fails -- but may leave some listeners hooked up.

It should be safe to set isOptedOut prior to initializing the SDK, and in that scenario there shouldn't be any attempt to start a session.

Reachability needs to be updated for IPv6 support

Soon, Apple is going to start rejecting apps that don't provide IPv6 support. Part of the documentation indicates that usage of SCNetworkReachability with the 0.0.0.0 IPv4 address is a common area that will break the IPv6 support.

See https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html for some additional information on this.

The reachability code in the Quantcast library should be updated to perform reachability checks based on a host name instead of an IP address, per the Apple documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.