Permalink
Browse files

Merge pull request #927 from OneBusAway/v1711

v17.1.1
  • Loading branch information...
2 parents e416233 + fd85dde commit b39ca50a5c16836593f3daaa5529892ee0392332 @aaronbrethorst aaronbrethorst committed on GitHub Jan 5, 2017
Showing with 168 additions and 44 deletions.
  1. +1 −0 OBAKit/Helpers/OBACommon.h
  2. +1 −0 OBAKit/Helpers/OBACommon.m
  3. +2 −2 OBAKit/Info.plist
  4. +3 −0 OBAKit/OBAApplication.h
  5. +11 −0 OBAKit/OBAApplication.m
  6. +9 −2 OneBusAway/Info.plist
  7. +5 −13 OneBusAway/OBAApplicationDelegate.m
  8. BIN OneBusAway/Resources/Full Size Raster/Heading_3x.psd
  9. BIN OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/1x.png
  10. +58 −2 OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/Contents.json
  11. BIN OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/ipp.png
  12. BIN OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/note1x.png
  13. BIN OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/note2x-1.png
  14. BIN OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/note2x.png
  15. BIN OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/note3x.png
  16. BIN OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/oba.png
  17. BIN OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/sett.png
  18. BIN OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/sett2x.png
  19. BIN OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/spot.png
  20. BIN OneBusAway/Resources/Images.xcassets/AppIcon.appiconset/spot2x.png
  21. +6 −0 OneBusAway/en.lproj/Localizable.strings
  22. +3 −0 OneBusAway/externals/AFMSlidingCell/AFMSlidingButtonContainer.h
  23. +2 −2 OneBusAway/externals/AFMSlidingCell/AFMSlidingButtonContainer.m
  24. +3 −0 OneBusAway/externals/AFMSlidingCell/AFMSlidingCell.h
  25. +10 −0 OneBusAway/externals/AFMSlidingCell/AFMSlidingCell.m
  26. +15 −1 OneBusAway/ui/info/OBASettingsViewController.m
  27. +30 −13 OneBusAway/ui/stops/OBAStopViewController.m
  28. +5 −5 OneBusAway/utilities/OBAAnalytics.h
  29. +4 −4 org.onebusaway.iphone.xcodeproj/project.pbxproj
@@ -29,6 +29,7 @@ extern NSString * const kApplicationShortcutBookmarks;
// User Defaults Keys
extern NSString * const OBAOptInToTrackingDefaultsKey;
+extern NSString * const OBAAllowReviewPromptsDefaultsKey;
/**
We report "YES" and "NO" to Google Analytics in several places. This method
@@ -25,6 +25,7 @@
NSString * const kApplicationShortcutBookmarks = @"org.onebusaway.iphone.shortcut.bookmarks";
NSString * const OBAOptInToTrackingDefaultsKey = @"OBAOptInToTrackingDefaultsKey";
+NSString * const OBAAllowReviewPromptsDefaultsKey = @"OBAAllowReviewPromptsDefaultsKey";
const NSInteger kOBAErrorDuplicateEntity = 1000;
const NSInteger kOBAErrorMissingFieldInData = 1001;
View
@@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
- <string>17.1.0</string>
+ <string>17.1.1</string>
<key>CFBundleVersion</key>
- <string>20161226.00</string>
+ <string>20170105.12</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
@@ -42,6 +42,9 @@ extern NSString *const kOBAApplicationSettingsRegionRefreshNotification;
@property (nonatomic, strong, readonly) PrivacyBroker *privacyBroker;
@property (nonatomic, strong, readonly) OBAConsoleLogger *consoleLogger;
+@property (nonatomic, copy, readonly) NSString *apptentiveAPIKey;
+@property (nonatomic, copy, readonly) NSString *googleAnalyticsID;
+
/**
* This method should always be used to get an instance of this class. This class should not be initialized directly.
*
@@ -92,6 +92,7 @@ - (void)registerAppDefaults {
defaults[kSetRegionAutomaticallyKey] = @(YES);
defaults[kUngroupedBookmarksOpenKey] = @(YES);
defaults[OBAOptInToTrackingDefaultsKey] = @(YES);
+ defaults[OBAAllowReviewPromptsDefaultsKey] = @(YES);
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
}
@@ -137,6 +138,16 @@ - (NSString*)fullAppVersionString {
return [NSString stringWithFormat:@"%@ (%@)", [self formattedAppVersion], [self formattedAppBuild]];
}
+#pragma mark - App Keys
+
+- (NSString*)apptentiveAPIKey {
+ return @"3363af9a6661c98dec30fedea451a06dd7d7bc9f70ef38378a9d5a15ac7d4926";
+}
+
+- (NSString*)googleAnalyticsID {
+ return @"UA-2423527-17";
+}
+
#pragma mark - App/Region/API State
- (void)refreshSettings {
View
@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>17.1.0</string>
+ <string>17.1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
- <string>2016126.00</string>
+ <string>20170105.12</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
@@ -171,6 +171,13 @@
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ </array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
@@ -35,9 +35,6 @@
#import "OBADrawerUI.h"
#import "EXTScope.h"
-static NSString *const kTrackingId = @"UA-2423527-17";
-static NSString *const kApptentiveKey = @"3363af9a6661c98dec30fedea451a06dd7d7bc9f70ef38378a9d5a15ac7d4926";
-
@interface OBAApplicationDelegate () <OBABackgroundTaskExecutor, OBARegionHelperDelegate, RegionListDelegate>
@property(nonatomic,strong) UINavigationController *regionNavigationController;
@property(nonatomic,strong) RegionListViewController *regionListViewController;
@@ -125,20 +122,15 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[OBAModelService addBackgroundExecutor:self];
// Configure the Apptentive feedback system
- [Apptentive sharedConnection].APIKey = kApptentiveKey;
+ [Apptentive sharedConnection].APIKey = [OBAApplication sharedApplication].apptentiveAPIKey;
// Set up Google Analytics. User must be able to opt out of tracking.
- [GAI sharedInstance].optOut = ![[NSUserDefaults standardUserDefaults] boolForKey:OBAOptInToTrackingDefaultsKey];
+ id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:[OBAApplication sharedApplication].googleAnalyticsID];
+ BOOL optOut = ![[NSUserDefaults standardUserDefaults] boolForKey:OBAOptInToTrackingDefaultsKey];
+ [GAI sharedInstance].optOut = optOut;
[GAI sharedInstance].trackUncaughtExceptions = YES;
[GAI sharedInstance].logger.logLevel = kGAILogLevelWarning;
-
- //don't report to Google Analytics when developing
-#ifdef DEBUG
- DDLogInfo(@"In DEBUG mode. Not reporting to Google Analytics.");
- [[GAI sharedInstance] setDryRun:YES];
-#endif
-
- [[GAI sharedInstance].defaultTracker set:[GAIFields customDimensionForIndex:1] value:[OBAApplication sharedApplication].modelDao.currentRegion.regionName];
+ [tracker set:[GAIFields customDimensionForIndex:1] value:[OBAApplication sharedApplication].modelDao.currentRegion.regionName];
[OBAAnalytics configureVoiceOverStatus];
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,13 +1,15 @@
{
"images" : [
{
- "idiom" : "iphone",
"size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "note2x.png",
"scale" : "2x"
},
{
- "idiom" : "iphone",
"size" : "20x20",
+ "idiom" : "iphone",
+ "filename" : "note3x.png",
"scale" : "3x"
},
{
@@ -45,6 +47,60 @@
"idiom" : "iphone",
"filename" : "AppIcon-2.png",
"scale" : "3x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "note1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "20x20",
+ "idiom" : "ipad",
+ "filename" : "note2x-1.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "sett.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "29x29",
+ "idiom" : "ipad",
+ "filename" : "sett2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "spot.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "40x40",
+ "idiom" : "ipad",
+ "filename" : "spot2x.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "1x.png",
+ "scale" : "1x"
+ },
+ {
+ "size" : "76x76",
+ "idiom" : "ipad",
+ "filename" : "oba.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "83.5x83.5",
+ "idiom" : "ipad",
+ "filename" : "ipp.png",
+ "scale" : "2x"
}
],
"info" : {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -146,6 +146,9 @@
/* A switch option's text for enabling and disabling Google Analytics */
"msg_enable_google_analytics" = "Enable Google Analytics";
+/* A switch option's text for enabling and disabling App Store review prompts*/
+"msg_allow_app_feedback" = "Prompt me for app feedback";
+
/* view.title */
"msg_error_submitting" = "Error Submitting";
@@ -465,6 +468,9 @@
/* Analytics explanation on the Settings view controller. */
"msg_explanatory_google_analytics" = "Some information about how you use this app is sent to Google Analytics in non-personally identifiable form to help us better understand how to improve the app. To learn more, please read our Privacy Policy.";
+/* App feedback explanation on the Settings view controller. */
+"msg_explanatory_allow_app_feedback" = "You can also submit feedback in the Contact Us section on the previous page";
+
/* No comment provided by engineer. */
"msg_something_went_wrong" = "Something Went Wrong";
@@ -15,6 +15,9 @@
@property (nonatomic, readonly) CGFloat bothButtonsWidth;
@property (nonatomic, weak) AFMSlidingCell *parentCell;
+@property(nonatomic,strong,readonly) UIButton *leftButton;
+@property(nonatomic,strong,readonly) UIButton *rightButton;
+
- (void)addLeftButton:(UIButton *)button withWidth:(CGFloat)width withTappedBlock:(void (^)(AFMSlidingCell *))tappedBlock;
- (void)addRightButton:(UIButton *)button withWidth:(CGFloat)width withTappedBlock:(void (^)(AFMSlidingCell *))tappedBlock;
- (void)clearButtons;
@@ -10,8 +10,8 @@
@interface AFMSlidingButtonContainer ()
-@property (nonatomic) UIButton *leftButton;
-@property (nonatomic) UIButton *rightButton;
+@property (nonatomic,strong,readwrite) UIButton *leftButton;
+@property (nonatomic,strong,readwrite) UIButton *rightButton;
@property (nonatomic) CGFloat leftButtonWidth;
@property (nonatomic) CGFloat rightButtonWidth;
@property (nonatomic, copy) void (^leftButtonTappedBlock)(AFMSlidingCell *);
@@ -21,6 +21,9 @@
@interface AFMSlidingCell : UITableViewCell
+@property(nonatomic,assign,readonly) CGRect leftButtonFrame;
+@property(nonatomic,assign,readonly) CGRect rightButtonFrame;
+
@property (nonatomic, weak) id<AFMSlidingCellDelegate> delegate;
- (void)addFirstButton:(UIButton *)button withWidth:(CGFloat)width withTappedBlock:(void (^)(AFMSlidingCell *))tappedBlock;
@@ -247,6 +247,16 @@ - (void)handleTap
[self hideButtonViewAnimated:YES];
}
+#pragma mark - Frames
+
+- (CGRect)leftButtonFrame {
+ return [self convertRect:self.buttonContainer.leftButton.frame fromView:self.buttonContainer];
+}
+
+- (CGRect)rightButtonFrame {
+ return [self convertRect:self.buttonContainer.rightButton.frame fromView:self.buttonContainer];
+}
+
#pragma mark - Showing/hiding buttons
- (void)showButtonViewAnimated:(BOOL)animated {
@@ -8,6 +8,7 @@
#import "OBASettingsViewController.h"
@import OBAKit;
+@import GoogleAnalytics;
#import "OBASwitchRow.h"
@interface OBASettingsViewController ()
@@ -40,12 +41,25 @@ - (void)loadData {
BOOL analyticsValue = [[NSUserDefaults standardUserDefaults] boolForKey:OBAOptInToTrackingDefaultsKey];
OBASwitchRow *switchRow = [[OBASwitchRow alloc] initWithTitle:NSLocalizedString(@"msg_enable_google_analytics", @"A switch option's text for enabling and disabling Google Analytics") action:^{
[[NSUserDefaults standardUserDefaults] setBool:!analyticsValue forKey:OBAOptInToTrackingDefaultsKey];
+ [GAI sharedInstance].optOut = !analyticsValue;
} switchValue:analyticsValue];
[analyticsSection addRow:switchRow];
analyticsSection.footerView = [OBAUIBuilder footerViewWithText:NSLocalizedString(@"msg_explanatory_google_analytics", @"Analytics explanation on the Settings view controller.") maximumWidth:CGRectGetWidth(self.tableView.frame)];
- self.sections = @[analyticsSection];
+ // Disable review requests - issue #854
+ OBATableSection *ratePromptSection = [[OBATableSection alloc] initWithTitle:nil];
+
+ BOOL ratePromptValue = [[NSUserDefaults standardUserDefaults] boolForKey:OBAAllowReviewPromptsDefaultsKey];
+ OBASwitchRow *ratePromptRow = [[OBASwitchRow alloc] initWithTitle:NSLocalizedString(@"msg_allow_app_feedback", @"A switch option's text for enabling and disabling App Store review prompts") action:^{
+ [[NSUserDefaults standardUserDefaults] setBool:!ratePromptValue forKey:OBAAllowReviewPromptsDefaultsKey];
+ }switchValue:ratePromptValue];
+ [ratePromptSection addRow:ratePromptRow];
+
+ // Get rid of the really annoying cell seperator
+ ratePromptSection.footerView = [OBAUIBuilder footerViewWithText:NSLocalizedString(@"msg_explanatory_allow_app_feedback", @"App feedback explanation on the Settings view controller.") maximumWidth:CGRectGetWidth(self.tableView.frame)];
+
+ self.sections = @[analyticsSection, ratePromptSection];
[self.tableView reloadData];
}
@@ -94,8 +94,11 @@ - (void)viewWillAppear:(BOOL)animated {
// to ensure that the user has the opportunity to look up their departure information without a prompt appearing
// on screen in the midst of their task. I would use -performSelector:afterDelay: or dispatch_after(), except
// that I also want to make sure that I can appropriately cancel this timer and only show prompts from this controller.
- self.apptentiveTimer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(recordUserVisit:) userInfo:nil repeats:NO];
-
+
+ // Disable review requests - issue #854
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:OBAAllowReviewPromptsDefaultsKey]) {
+ self.apptentiveTimer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(recordUserVisit:) userInfo:nil repeats:NO];
+ }
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willEnterForeground:) name:UIApplicationWillEnterForegroundNotification object:nil];
[self populateTableFromArrivalsAndDeparturesModel:self.arrivalsAndDepartures];
@@ -337,7 +340,7 @@ - (OBATableSection *)buildClassicDepartureSectionWithDeparture:(OBAArrivalsAndDe
[self toggleBookmarkActionForArrivalAndDeparture:dep];
}];
[row setShareAction:^{
- [self shareActionForArrivalAndDeparture:dep];
+ [self shareActionForArrivalAndDeparture:dep atIndexPath:[self indexPathForModel:dep]];
}];
[departureRows addObject:row];
@@ -364,9 +367,31 @@ - (void)toggleBookmarkActionForArrivalAndDeparture:(OBAArrivalAndDepartureV2*)de
}
}
-- (void)shareActionForArrivalAndDeparture:(OBAArrivalAndDepartureV2*)dep {
+- (void)shareActionForArrivalAndDeparture:(OBAArrivalAndDepartureV2*)dep atIndexPath:(NSIndexPath*)indexPath {
+ OBAGuard(dep && indexPath) else {
+ return;
+ }
+
OBATripDeepLink *deepLink = [[OBATripDeepLink alloc] initWithArrivalAndDeparture:dep region:self.modelDAO.currentRegion];
- [self shareDeepLinkURL:deepLink.deepLinkURL];
+ NSURL *URL = deepLink.deepLinkURL;
+
+ NSString *activityItem = [NSString stringWithFormat:NSLocalizedString(@"text_follow_my_trip_param", @"Sharing link activity item in the stop view controller"), URL.absoluteString];
+
+ UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:@[activityItem] applicationActivities:nil];
+
+ // Present the activity controller from a popover on iPad in order to
+ // avoid a crash. See bug #919.
+ if (self.traitCollection.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+ UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
+ CGRect rect = cell.bounds;
+ if ([cell isKindOfClass:[AFMSlidingCell class]]) {
+ rect = [(AFMSlidingCell*)cell rightButtonFrame];
+ }
+ controller.popoverPresentationController.sourceView = cell;
+ controller.popoverPresentationController.sourceRect = rect;
+ }
+
+ [self presentViewController:controller animated:YES completion:nil];
}
#pragma mark - Bookmarks
@@ -575,12 +600,4 @@ - (void)createTableHeaderView {
self.tableView.tableHeaderView = self.stopHeaderView;
}
-- (void)shareDeepLinkURL:(NSURL*)URL {
- NSString *activityItem = [NSString stringWithFormat:NSLocalizedString(@"text_follow_my_trip_param", @"Sharing link activity item in the stop view controller"), URL.absoluteString];
-
- UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:@[activityItem] applicationActivities:nil];
-
- [self presentViewController:controller animated:YES completion:nil];
-}
-
@end
Oops, something went wrong.

0 comments on commit b39ca50

Please sign in to comment.