Skip to content

Commit

Permalink
Bump minimum version to 9.0 since Xcode 15 is required by App Store C…
Browse files Browse the repository at this point in the history
…onnect and it doesn't support iOS < 9.0

Fixed an issue with permission for photo library not being able to be granted
  • Loading branch information
fotiDim committed Jun 9, 2024
1 parent 858d1c1 commit 5606b8f
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 62 deletions.
6 changes: 3 additions & 3 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ CHECKOUT OPTIONS:
:git: https://github.com/Gkpsundar/SocketRocket.git

SPEC CHECKSUMS:
AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
AFNetworking: cb604b1c2bded0871f5f61f5d53653739e841d6b
CocoaLumberjack: db7cc9e464771f12054c22ff6947c5a58d43a0fd
FFmpeg-static: f61924a6708db56927f6ed9e744848c1697301e3
GPUImage: 733a5f0fab92df9de1c37ba9df520a833ccb406d
OpenCV: cd36a3467c21572d658c2640488fe0d5a93ca192
Romo: 4fccb6b3e8e1af1b50cae0e7d1ce22a3c50c91c4
SocketRocket: dbb1554b8fc288ef8ef370d6285aeca7361be31e

PODFILE CHECKSUM: dae751e0da5fc6282d858b88258c4a1dd421d705
PODFILE CHECKSUM: 46d3e6fb245193dcbc67c2c80e4899133c984234

COCOAPODS: 1.11.3
COCOAPODS: 1.15.2
4 changes: 2 additions & 2 deletions Romo Control/Supporting Files/RMControl-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
<key>NSMicrophoneUsageDescription</key>
<string>For two-way communication between Romo and this app</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Romo Control needs to store pictures taken with Romo</string>
<string>Allow saving photos to your library</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Allow saving photos to library</string>
<string>Allow saving photos to your library</string>
<key>UIAppFonts</key>
<array>
<string>Brandon-Bold.otf</string>
Expand Down
22 changes: 22 additions & 0 deletions Romo Control/src/Controller/RMWiFiDriveRemoteVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#import "RMControlInputMenu.h"
#import <Romo/UIView+Additions.h>
#import "RMGameController.h"
#import <Photos/Photos.h>

@interface RMWiFiDriveRemoteVC () <RMRomoteDriveExpressionsPopoverDelegate, RMJoystickDelegate, RMDpadDelegate, RMTiltControllerDelegate, RMSessionDelegate,
RMRemoteControlServiceDelegate, RMTankSliderDelegate, RMGameControllerDelegate> {
Expand Down Expand Up @@ -351,6 +352,10 @@ - (void)didTouchBackButton:(UIButton *)backButton
- (void)didTouchPhotosButton:(id)sender
{
[self dismissPopovers];

[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
[self handlePhotoAuthorizationStatus:status];
}];

RMRemotePhotoVC *photoVC = [[RMRemotePhotoVC alloc] init];
photoVC.photos = self.capturedPhotos;
Expand All @@ -359,6 +364,23 @@ - (void)didTouchPhotosButton:(id)sender
[self presentViewController:photoVC animated:YES completion:nil];
}

- (void)handlePhotoAuthorizationStatus:(PHAuthorizationStatus)status {
switch (status) {
case PHAuthorizationStatusAuthorized:
// Access has been granted.
break;
case PHAuthorizationStatusDenied:
case PHAuthorizationStatusRestricted:
// Access has been denied or restricted.
break;
case PHAuthorizationStatusNotDetermined:
// The user hasn't decided yet; we could prompt again.
break;
default:
break;
}
}

- (void)handlePhotoVCDismissButtonTouch:(UIButton *)button
{
[self dismissViewControllerAnimated:YES completion:nil];
Expand Down
43 changes: 22 additions & 21 deletions Romo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -3416,7 +3416,6 @@
ORGANIZATIONNAME = Romotive;
TargetAttributes = {
7130FD2517C42BAD0025B605 = {
DevelopmentTeam = 52RU2XXUH6;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.InAppPurchase = {
Expand All @@ -3426,7 +3425,6 @@
};
AF8EF18621CD649D0025F16B = {
CreatedOnToolsVersion = 10.1;
DevelopmentTeam = 52RU2XXUH6;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -4495,8 +4493,8 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COMPRESS_PNG_FILES = NO;
CURRENT_PROJECT_VERSION = 2.3.4;
DEVELOPMENT_TEAM = 52RU2XXUH6;
CURRENT_PROJECT_VERSION = 2.3.10;
DEVELOPMENT_TEAM = QQAZR43YM7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREFIX_HEADER = "Romo Control/Supporting Files/RMControl-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -4512,7 +4510,7 @@
"\"$SRCROOT/lib/Drive/RomoAV/AVCEncoder\"",
);
INFOPLIST_FILE = "$(SRCROOT)/Romo Control/Supporting Files/RMControl-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"@executable_path/Frameworks",
"$(inherited)",
Expand Down Expand Up @@ -4549,8 +4547,8 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COMPRESS_PNG_FILES = NO;
CURRENT_PROJECT_VERSION = 2.3.4;
DEVELOPMENT_TEAM = 52RU2XXUH6;
CURRENT_PROJECT_VERSION = 2.3.10;
DEVELOPMENT_TEAM = QQAZR43YM7;
ENABLE_NS_ASSERTIONS = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREFIX_HEADER = "Romo Control/Supporting Files/RMControl-Prefix.pch";
Expand All @@ -4567,7 +4565,7 @@
"\"$SRCROOT/lib/Drive/RomoAV/AVCEncoder\"",
);
INFOPLIST_FILE = "$(SRCROOT)/Romo Control/Supporting Files/RMControl-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"@executable_path/Frameworks",
"$(inherited)",
Expand Down Expand Up @@ -4661,9 +4659,9 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2.3.4;
CURRENT_PROJECT_VERSION = 2.5.1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 52RU2XXUH6;
DEVELOPMENT_TEAM = QQAZR43YM7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREFIX_HEADER = "Supporting Files/Romo-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -4687,6 +4685,7 @@
"\"$(SRCROOT)/lib/ext/h264bitstream\"",
);
INFOPLIST_FILE = "Supporting Files/Romo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -4696,7 +4695,7 @@
"$(PROJECT_DIR)/lib/ext/libav",
"$(PROJECT_DIR)/lib/ext/mobile-ffmpeg/lib",
);
MARKETING_VERSION = 2.3;
MARKETING_VERSION = 2.5;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.navideck.romoSimulated;
Expand All @@ -4720,8 +4719,8 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COMPRESS_PNG_FILES = NO;
CURRENT_PROJECT_VERSION = 2.3.4;
DEVELOPMENT_TEAM = 52RU2XXUH6;
CURRENT_PROJECT_VERSION = 2.3.10;
DEVELOPMENT_TEAM = QQAZR43YM7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREFIX_HEADER = "Romo Control/Supporting Files/RMControl-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -4737,7 +4736,7 @@
"\"$SRCROOT/lib/Drive/RomoAV/AVCEncoder\"",
);
INFOPLIST_FILE = "$(SRCROOT)/Romo Control/Supporting Files/RMControl-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"@executable_path/Frameworks",
"$(inherited)",
Expand Down Expand Up @@ -4775,9 +4774,9 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = Romo.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2.3.4;
CURRENT_PROJECT_VERSION = 2.5.1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 52RU2XXUH6;
DEVELOPMENT_TEAM = QQAZR43YM7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREFIX_HEADER = "Supporting Files/Romo-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -4801,6 +4800,7 @@
"\"$(SRCROOT)/lib/ext/h264bitstream\"",
);
INFOPLIST_FILE = "Supporting Files/Romo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -4810,7 +4810,7 @@
"$(PROJECT_DIR)/lib/ext/libav",
"$(PROJECT_DIR)/lib/ext/mobile-ffmpeg/lib",
);
MARKETING_VERSION = 2.3;
MARKETING_VERSION = 2.5;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.romotive.romo;
Expand All @@ -4837,9 +4837,9 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2.3.4;
CURRENT_PROJECT_VERSION = 2.5.1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 52RU2XXUH6;
DEVELOPMENT_TEAM = QQAZR43YM7;
ENABLE_NS_ASSERTIONS = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PREFIX_HEADER = "Supporting Files/Romo-Prefix.pch";
Expand All @@ -4860,6 +4860,7 @@
"\"$(SRCROOT)/lib/ext/h264bitstream\"",
);
INFOPLIST_FILE = "Supporting Files/Romo-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -4869,7 +4870,7 @@
"$(PROJECT_DIR)/lib/ext/libav",
"$(PROJECT_DIR)/lib/ext/mobile-ffmpeg/lib",
);
MARKETING_VERSION = 2.3;
MARKETING_VERSION = 2.5;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.navideck.RomoX;
Expand Down
2 changes: 2 additions & 0 deletions Supporting Files/Romo-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
<string>Make your Romo discoverable on your network</string>
<key>NSMicrophoneUsageDescription</key>
<string>For two-way communication between Romo and the Romo Control App</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Allow saving photos to your library</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Allow saving photos to your library</string>
<key>UIAppFonts</key>
Expand Down
53 changes: 17 additions & 36 deletions src/Missions/Editor/Compiling/RMCompilingVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#import "RMParameter.h"
#import "RMSoundEffect.h"
#import "RMAlertView.h"
#import <Photos/Photos.h>
//#import <Photos/Photos.h>

#define compileStepCount 3
#define kNumCompilingSounds 8
Expand Down Expand Up @@ -94,15 +94,6 @@ - (void)compile
case 1: {
self.progress = 0.55 + (float)(arc4random() % 15)/100.0;
self.titleLabel.text = NSLocalizedString(@"Compile-Stage-2", @"Compiling...");

if (self.missionNeedsToSavePhotos) {
if (!self.hasPermissionToSavePhotos) {
[[[RMAlertView alloc] initWithTitle:NSLocalizedString(@"Compile-PhotoPerms-Alert-Title", @"Photo Permission Needed")
message:NSLocalizedString(@"Compile-PhotoPerms-Alert-Message", @"For Romo to take photos and videos, allow access to your Photo Library.\n\nOpen the Settings app > Privacy > Photos.\n\nThen enable access for Romo.")
delegate:self] show];
return;
}
}
break;
}

Expand Down Expand Up @@ -148,22 +139,22 @@ - (void)alertViewDidDismiss:(RMAlertView *)alertView
[self.delegate compilingVCDidFailToCompile:self];
}

#pragma mark - Private Properties

- (BOOL)missionNeedsToSavePhotos
{
__block BOOL hasCameraAction = NO;
[self.mission.inputScripts enumerateObjectsUsingBlock:^(NSArray *script, NSUInteger idx, BOOL *stop) {
[script enumerateObjectsUsingBlock:^(RMAction *action, NSUInteger idx, BOOL *scriptStop) {
if ([action.library isEqualToString:@"Camera"]) {
hasCameraAction = YES;
*stop = YES;
*scriptStop = YES;
}
}];
}];
return hasCameraAction;
}
//#pragma mark - Private Properties

//- (BOOL)missionNeedsToSavePhotos
//{
// __block BOOL hasCameraAction = NO;
// [self.mission.inputScripts enumerateObjectsUsingBlock:^(NSArray *script, NSUInteger idx, BOOL *stop) {
// [script enumerateObjectsUsingBlock:^(RMAction *action, NSUInteger idx, BOOL *scriptStop) {
// if ([action.library isEqualToString:@"Camera"]) {
// hasCameraAction = YES;
// *stop = YES;
// *scriptStop = YES;
// }
// }];
// }];
// return hasCameraAction;
//}

- (BOOL)missionNeedsMicrophone
{
Expand All @@ -177,16 +168,6 @@ - (BOOL)missionNeedsMicrophone
return hasLoudSoundEvent;
}

- (BOOL)hasPermissionToSavePhotos
{
if (@available(iOS 8, *)) {
return [PHPhotoLibrary authorizationStatus] == PHAuthorizationStatusAuthorized;
} else {
return [ALAssetsLibrary authorizationStatus] == ALAuthorizationStatusAuthorized;
}

}

- (BOOL)hasMicrophonePermission
{
// Older versions of iOS don't require permission to access the microphone
Expand Down

0 comments on commit 5606b8f

Please sign in to comment.