Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OnePoem
/
OnePoem-App
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
reason
2022-06-10 11:17:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
af64dd5dae3276aa198c54ed0b31e27589d9519e
af64dd5d
1 parent
9eace4e8
增加了第三方登录
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
android/app/src/main/AndroidManifest.xml
lib/login/page/login_page.dart
android/app/src/main/AndroidManifest.xml
View file @
af64dd5
...
...
@@ -23,6 +23,17 @@
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<!-- Accepts URIs that begin with "example://gizmos” -->
<!-- Registered Callback URLs in TwitterApp -->
<data
android:host=
""
android:scheme=
"parlando"
/>
<!-- host is option -->
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
...
...
@@ -40,7 +51,6 @@
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:scheme=
"pub.yiyan.parlando.Parlando.braintree"
/>
</intent-filter>
</activity>
...
...
@@ -54,9 +64,15 @@
android:name=
"com.facebook.sdk.ClientToken"
android:value=
"@string/facebook_client_token"
/>
</application>
<queries>
<provider
android:authorities=
"com.facebook.katana.provider.PlatformProvider"
/>
</queries>
<queries>
<intent>
<action
android:name=
"android.support.customtabs.action.CustomTabsService"
/>
</intent>
</queries>
<uses-permission
android:name=
"com.android.vending.BILLING"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
...
...
lib/login/page/login_page.dart
View file @
af64dd5
...
...
@@ -316,18 +316,20 @@ class _LoginPageState extends State<LoginPage>
// Registered Callback URLs in TwitterApp
// Android is a deeplink
// iOS is a URLScheme
redirectURI:
'
example
://'
,
redirectURI:
'
parlando
://'
,
);
final
authResult
=
await
twitterLogin
.
login
();
final
authResult
=
await
twitterLogin
.
login
V2
();
switch
(
authResult
.
status
)
{
case
TwitterLoginStatus
.
loggedIn
:
// success
print
(
authResult
.
authToken
);
break
;
case
TwitterLoginStatus
.
cancelledByUser
:
// cancel
print
(
"cancelledByUser"
);
break
;
case
TwitterLoginStatus
.
error
:
// error
print
(
authResult
.
errorMessage
);
break
;
default
:
break
;
...
...
Please
register
or
login
to post a comment