Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Commit

Permalink
Add custom data to Apptentive
Browse files Browse the repository at this point in the history
Fixes #779 - Add custom data to Apptentive integration

Start sending user information to the Apptentive service, but give users the ability to see what's being sent and give them the ability to opt out.

* Cocoa Lumberjack integration work
* Add a class to moderate access to PII data
* Add UI to view accessible PII data
* Start sending logs, region, and location data to Apptentive
  • Loading branch information
aaronbrethorst committed Oct 12, 2016
1 parent 693894a commit 3b83131
Show file tree
Hide file tree
Showing 69 changed files with 2,237 additions and 436 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -34,6 +34,9 @@ xcuserdata
!Carthage
!Carthage/Build
Carthage/Checkouts
Carthage/Build/Mac
Carthage/Build/tvOS
Carthage/Build/watchOS

# fastlane
#
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file modified Carthage/Build/iOS/CocoaLumberjack.framework/CocoaLumberjack
Binary file not shown.
44 changes: 44 additions & 0 deletions Carthage/Build/iOS/CocoaLumberjack.framework/Headers/CLIColor.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Carthage/Build/iOS/CocoaLumberjack.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion OBAApplicationDelegate.h
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#import <OBAKit/OBANavigationTarget.h>
@import UIKit;
@import OBAKit;

NS_ASSUME_NONNULL_BEGIN

Expand Down
18 changes: 7 additions & 11 deletions OBAApplicationDelegate.m
Expand Up @@ -39,10 +39,10 @@
static NSString *const kApptentiveKey = @"3363af9a6661c98dec30fedea451a06dd7d7bc9f70ef38378a9d5a15ac7d4926";

@interface OBAApplicationDelegate () <OBABackgroundTaskExecutor, OBARegionHelperDelegate, RegionListDelegate>
@property (nonatomic, strong) UINavigationController *regionNavigationController;
@property (nonatomic, strong) RegionListViewController *regionListViewController;
@property (nonatomic, strong) id regionObserver;
@property (nonatomic, strong) id recentStopsObserver;
@property(nonatomic,strong) UINavigationController *regionNavigationController;
@property(nonatomic,strong) RegionListViewController *regionListViewController;
@property(nonatomic,strong) id regionObserver;
@property(nonatomic,strong) id recentStopsObserver;
@property(nonatomic,strong) id<OBAApplicationUI> applicationUI;
@end

Expand All @@ -65,7 +65,8 @@ - (id)init {

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object:nil];

[[OBAApplication sharedApplication] start];
NSDictionary *appDefaults = @{ kOptOutOfTracking: @(NO) };
[[OBAApplication sharedApplication] startWithAppDefaults:appDefaults];

[OBAApplication sharedApplication].regionHelper.delegate = self;
}
Expand All @@ -77,7 +78,6 @@ - (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self.regionObserver];
[[NSNotificationCenter defaultCenter] removeObserver:self.recentStopsObserver];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kReachabilityChangedNotification object:nil];

}

- (void)navigateToTarget:(OBANavigationTarget *)navigationTarget {
Expand Down Expand Up @@ -127,11 +127,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// Configure the Apptentive feedback system
[Apptentive sharedConnection].APIKey = kApptentiveKey;

// Set up Google Analytics
NSDictionary *appDefaults = @{ kOptOutOfTracking: @(NO), kSetRegionAutomaticallyKey: @(YES), kUngroupedBookmarksOpenKey: @(YES)};
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];

// User must be able to opt out of tracking
// Set up Google Analytics. User must be able to opt out of tracking.
[GAI sharedInstance].optOut = ![[NSUserDefaults standardUserDefaults] boolForKey:kOptOutOfTracking];
[GAI sharedInstance].trackUncaughtExceptions = YES;
[GAI sharedInstance].logger.logLevel = kGAILogLevelWarning;
Expand Down
60 changes: 60 additions & 0 deletions OBAKit/Helpers/OBAConsoleLogger.h
@@ -0,0 +1,60 @@
//
// PTEConsoleLogger.h
// LumberjackConsole
//
// Created by Ernesto Rivera on 2013/05/23.
// Copyright (c) 2013-2015 PTEz.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

@import UIKit;
@import CocoaLumberjack;

/**
A DDLogger that displays log messages with a searcheable UITableView.
- Supports colors for log levels.
- Expands and collapses text.
- Can be filtered according to log levels or text.
- Can be minimized, maximized or used in any size in between.
Simply create a PTERootController
*/
@interface OBAConsoleLogger : DDAbstractLogger <DDLogFormatter,
UITableViewDelegate,
UITableViewDataSource,
UISearchBarDelegate>

@property(nonatomic,weak) UITableView *tableView;

/// @name Properties

/// Set the maximum number of messages to be displayed on the Dashboard. Default `100`.
@property (nonatomic,assign) NSUInteger maxMessages;

/// @name Log Formatters

/// An optional formatter to be used for shortened log messages.
@property (atomic, strong) id<DDLogFormatter> shortLogFormatter;

/// @name Methods

/// Clear all console messages.
- (void)clearConsole;

/// Add a marker object to the console.
- (void)addMarker;

@end

0 comments on commit 3b83131

Please sign in to comment.