Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Mobile App
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
Mobile App
Commits
c69d2f2e
Commit
c69d2f2e
authored
5 years ago
by
igorwork
Committed by
Markin Igor
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implement OAuth2 for third-party apps in iOS.
parent
74572636
No related branches found
No related tags found
1 merge request
!1
Mobile app initial implementation.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ios/Runner/Info.plist
+10
-1
10 additions, 1 deletion
ios/Runner/Info.plist
lib/app.dart
+9
-2
9 additions, 2 deletions
lib/app.dart
lib/screens/home.dart
+4
-8
4 additions, 8 deletions
lib/screens/home.dart
with
23 additions
and
11 deletions
ios/Runner/Info.plist
+
10
−
1
View file @
c69d2f2e
...
...
@@ -28,9 +28,18 @@
<key>
CFBundleURLSchemes
</key>
<array>
<string>
app://com.vereign.app/oauth2
</string>
<string>
vereign://app.vereign.com
</string>
</array>
</dict>
<dict>
<key>
CFBundleTypeRole
</key>
<string>
Editor
</string>
<key>
CFBundleURLName
</key>
<string>
com.vereign.app/auhtorize
</string>
<key>
CFBundleURLSchemes
</key>
<array>
<string>
app
</string>
</array>
</dict>
</array>
<key>
CFBundleVersion
</key>
<string>
$(FLUTTER_BUILD_NUMBER)
</string>
...
...
This diff is collapsed.
Click to expand it.
lib/app.dart
+
9
−
2
View file @
c69d2f2e
...
...
@@ -54,7 +54,7 @@ class _AppState extends State<App> {
updateAppMode
(
Uri
uri
)
{
log
(
"Uri
$uri
"
);
if
(
uri
?.
path
==
"/
o
au
th2
"
)
{
if
(
uri
?.
path
==
"/au
htorize
"
)
{
setState
(()
{
_appMode
=
"oauth"
;
_invokerURL
=
uri
.
queryParameters
[
"invokerUrl"
];
...
...
@@ -66,6 +66,12 @@ class _AppState extends State<App> {
}
}
setMode
(
String
mode
)
{
setState
(()
{
_appMode
=
mode
;
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
...
...
@@ -80,7 +86,8 @@ class _AppState extends State<App> {
appBar:
new
AppBar
(),
body:
Home
(
mode:
_appMode
,
invokerURL:
_invokerURL
invokerURL:
_invokerURL
,
setMode:
setMode
)
),
);
...
...
This diff is collapsed.
Click to expand it.
lib/screens/home.dart
+
4
−
8
View file @
c69d2f2e
...
...
@@ -6,9 +6,10 @@ import 'dart:developer';
import
'dart:convert'
;
class
Home
extends
StatefulWidget
{
Home
({
@required
this
.
mode
,
@required
this
.
invokerURL
});
Home
({
@required
this
.
mode
,
@required
this
.
invokerURL
,
@required
this
.
setMode
});
final
String
mode
;
final
String
invokerURL
;
final
void
Function
(
String
)
setMode
;
@override
_HomeState
createState
()
=
>
_HomeState
();
...
...
@@ -46,13 +47,8 @@ class _HomeState extends State<Home> {
child:
Text
(
'Go back'
),
onPressed:
()
async
{
Navigator
.
of
(
context
)
.
pop
();
log
(
'Try launch
${widget.invokerURL}
'
);
if
(
await
canLaunch
(
widget
.
invokerURL
))
{
await
launch
(
"
${widget.invokerURL}
?token=
$token
"
);
}
else
{
log
(
'Could not launch
${widget.invokerURL}
'
);
}
widget
.
setMode
(
""
);
await
launch
(
"
${widget.invokerURL}
?token=
$token
"
);
},
),
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment