Merge pull request #1247 from WhisperSystems/ios10-crash-on-attaching-media
Ios10 crash on attaching media
This commit is contained in:
commit
385126027b
|
@ -73,6 +73,10 @@
|
||||||
<string>Signal uses your contacts to find users you know. We do not store your contacts on the server.</string>
|
<string>Signal uses your contacts to find users you know. We do not store your contacts on the server.</string>
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
<string>Signal needs access to your microphone to make and receive phone calls.</string>
|
<string>Signal needs access to your microphone to make and receive phone calls.</string>
|
||||||
|
<key>NSAppleMusicUsageDescription</key>
|
||||||
|
<string>Signal will let you choose which media from your library to send.</string>
|
||||||
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
|
<string>Signal will let you choose which photos from your library to send.</string>
|
||||||
<key>UIApplicationShortcutItems</key>
|
<key>UIApplicationShortcutItems</key>
|
||||||
<array>
|
<array>
|
||||||
<dict>
|
<dict>
|
||||||
|
|
|
@ -1334,29 +1334,30 @@ typedef enum : NSUInteger {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
- (void)takePictureOrVideo {
|
- (void)takePictureOrVideo {
|
||||||
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
|
if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
|
||||||
picker.delegate = self;
|
DDLogError(@"Camera ImagePicker source not available");
|
||||||
picker.allowsEditing = NO;
|
return;
|
||||||
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
|
|
||||||
|
|
||||||
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
|
|
||||||
picker.mediaTypes = @[ (NSString *)kUTTypeImage, (NSString *)kUTTypeMovie ];
|
|
||||||
[self presentViewController:picker animated:YES completion:[UIUtil modalCompletionBlock]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
|
||||||
|
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
|
||||||
|
picker.mediaTypes = @[ (__bridge NSString *)kUTTypeImage, (__bridge NSString *)kUTTypeMovie ];
|
||||||
|
picker.allowsEditing = NO;
|
||||||
|
picker.delegate = self;
|
||||||
|
[self presentViewController:picker animated:YES completion:[UIUtil modalCompletionBlock]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)chooseFromLibrary {
|
- (void)chooseFromLibrary {
|
||||||
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
|
if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
|
||||||
picker.delegate = self;
|
DDLogError(@"PhotoLibrary ImagePicker source not available");
|
||||||
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
|
return;
|
||||||
|
|
||||||
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
|
|
||||||
NSArray *photoOrVideoTypeArray = [[NSArray alloc]
|
|
||||||
initWithObjects:(NSString *)kUTTypeImage, (NSString *)kUTTypeMovie, (NSString *)kUTTypeVideo, nil];
|
|
||||||
|
|
||||||
picker.mediaTypes = photoOrVideoTypeArray;
|
|
||||||
[self presentViewController:picker animated:YES completion:[UIUtil modalCompletionBlock]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
|
||||||
|
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
|
||||||
|
picker.delegate = self;
|
||||||
|
picker.mediaTypes = @[ (__bridge NSString *)kUTTypeImage, (__bridge NSString *)kUTTypeMovie ];
|
||||||
|
[self presentViewController:picker animated:YES completion:[UIUtil modalCompletionBlock]];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue