Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
flutter_plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林生雨
flutter_plugin
Commits
d212ac4f
Commit
d212ac4f
authored
Nov 05, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
a4dd2854
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+15
-9
No files found.
ios/Classes/GengmeiFlutterPlugin.m
View file @
d212ac4f
...
...
@@ -78,8 +78,7 @@ NSString *cacheDirectory;
else
if
(
author
==
AVAuthorizationStatusRestricted
||
authStatus
==
AVAuthorizationStatusDenied
)
{
NSLog
(
@"没给权限!!!"
);
NSString
*
errorStr
=
@"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。"
;
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
nil
message
:
errorStr
delegate
:
nil
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
];
[
alert
show
];
[
self
popWindow
:
errorStr
];
}
else
{
NSLog
(
@"HERRRRRRRR"
);
[
PHPhotoLibrary
requestAuthorization
:
^
(
PHAuthorizationStatus
status
)
{
...
...
@@ -93,8 +92,7 @@ NSString *cacheDirectory;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
// 用户点击 不允许访问
NSString
*
errorStr
=
@"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。"
;
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
nil
message
:
errorStr
delegate
:
nil
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
];
[
alert
show
];
[
self
popWindow
:
errorStr
];
NSLog
(
@"被拒绝 TODO!!"
);
});
}
...
...
@@ -113,9 +111,7 @@ NSString *cacheDirectory;
else
if
(
authStatus
==
AVAuthorizationStatusRestricted
||
authStatus
==
AVAuthorizationStatusDenied
){
NSString
*
errorStr
=
@"应用相机权限受限,请在iPhone的“设置-隐私-相机”选项中,允许好享玩访问你的相机。"
;
NSLog
(
@"相机不可用"
);
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
nil
message
:
errorStr
delegate
:
nil
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
];
[
alert
show
];
[
self
popWindow
:
errorStr
];
}
else
{
[
AVCaptureDevice
requestAccessForMediaType
:
AVMediaTypeVideo
completionHandler
:
^
(
BOOL
granted
)
{
if
(
granted
){
...
...
@@ -124,8 +120,7 @@ NSString *cacheDirectory;
});
}
else
{
NSString
*
errorStr
=
@"应用相机权限受限,请在iPhone的“设置-隐私-相册”选项中,允许好享玩访问你的相册。"
;
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
nil
message
:
errorStr
delegate
:
nil
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
];
[
alert
show
];
[
self
popWindow
:
errorStr
];
}
}];
}
...
...
@@ -925,6 +920,17 @@ CFAbsoluteTime startTime;
return
videoDurationText
;
}
-
(
void
)
popWindow
:
(
NSString
*
)
str
{
UIAlertController
*
alertController
=
[
UIAlertController
alertControllerWithTitle
:
@"提示"
message
:
str
preferredStyle
:
UIAlertControllerStyleAlert
];
UIAlertAction
*
okAction
=
[
UIAlertAction
actionWithTitle
:
@"确定"
style
:
UIAlertActionStyleDefault
handler
:^
(
UIAlertAction
*
_Nonnull
action
)
{
NSLog
(
@"确定"
);
}];
[
alertController
addAction
:
okAction
];
[
viewController
presentViewController
:
alertController
animated
:
YES
completion
:
nil
];
}
//-(void)execRealImg:(long)resultId{
// dispatch_queue_t queue = dispatch_queue_create("execRealImg", DISPATCH_QUEUE_CONCURRENT);
// self.nowSize=0;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment