chore: Follow up fix sso on android

This commit is contained in:
Christian Pauly 2022-02-20 12:30:11 +01:00
parent ace5afa093
commit 642b48f280
3 changed files with 15 additions and 33 deletions

View File

@ -51,14 +51,6 @@
<action android:name="FLUTTER_NOTIFICATION_CLICK" /> <action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </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" />
<data
android:scheme="im.fluffychat" />
</intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
@ -77,7 +69,7 @@
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="im.fluffychat" /> <data android:scheme="im.fluffychat" android:host="chat" />
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
@ -99,16 +91,23 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="video/*" /> <data android:mimeType="video/*" />
</intent-filter> </intent-filter>
</activity> </activity>
<!-- <service android:name=".FcmPushService" <activity android:name="com.linusu.flutter_web_auth.CallbackActivity" >
<intent-filter android:label="flutter_web_auth">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="im.fluffychat" android:host="login"/>
</intent-filter>
</activity>
<service android:name=".FcmPushService"
android:exported="false"> android:exported="false">
<intent-filter> <intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/> <action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter> </intent-filter>
</service> --> </service>
<receiver android:exported="true" android:enabled="true" android:name=".UnifiedPushReceiver"> <receiver android:exported="true" android:enabled="true" android:name=".UnifiedPushReceiver">
<intent-filter> <intent-filter>

View File

@ -170,7 +170,9 @@ class HomeserverPickerController extends State<HomeserverPicker> {
'${Matrix.of(context).getLoginClient().homeserver?.toString()}/_matrix/client/r0/login/sso/redirect/${Uri.encodeComponent(id)}?redirectUrl=${Uri.encodeQueryComponent(redirectUrl)}'; '${Matrix.of(context).getLoginClient().homeserver?.toString()}/_matrix/client/r0/login/sso/redirect/${Uri.encodeComponent(id)}?redirectUrl=${Uri.encodeQueryComponent(redirectUrl)}';
final urlScheme = Uri.parse(redirectUrl).scheme; final urlScheme = Uri.parse(redirectUrl).scheme;
final result = await FlutterWebAuth.authenticate( final result = await FlutterWebAuth.authenticate(
url: url, callbackUrlScheme: urlScheme); url: url,
callbackUrlScheme: urlScheme,
);
final token = Uri.parse(result).queryParameters['loginToken']; final token = Uri.parse(result).queryParameters['loginToken'];
if (token != null) _loginWithToken(token); if (token != null) _loginWithToken(token);
} }

View File

@ -26,25 +26,6 @@ index 4e018b38..eebf7582 100644
-//apply plugin: 'com.google.gms.google-services' -//apply plugin: 'com.google.gms.google-services'
+apply plugin: 'com.google.gms.google-services' +apply plugin: 'com.google.gms.google-services'
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index ee40b78d..ec7dd1a9 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -103,12 +103,12 @@
</activity>
- <!-- <service android:name=".FcmPushService"
+ <service android:name=".FcmPushService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
- </service> -->
+ </service>
<receiver android:exported="true" android:enabled="true" android:name=".UnifiedPushReceiver">
<intent-filter>
diff --git a/android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt b/android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt diff --git a/android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt b/android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt
index d9930f55..510e9845 100644 index d9930f55..510e9845 100644
--- a/android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt --- a/android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt