-
Notifications
You must be signed in to change notification settings - Fork 741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unifiedpush #3448
Unifiedpush #3448
Changes from all commits
87f1e05
da66d28
7d7c0ac
61b2dbd
97d13e3
8b46a22
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Use UnifiedPush and allows user to have push without FCM. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2022 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.vector.app.fdroid.receiver | ||
|
||
import android.content.BroadcastReceiver | ||
import android.content.Context | ||
import android.content.Intent | ||
|
||
/** | ||
* UnifiedPush lib tracks an action to check installed and uninstalled distributors. | ||
* We declare it to keep the background sync as an internal unifiedpush distributor. | ||
* This class is used to declare this action. | ||
*/ | ||
class KeepInternalDistributor : BroadcastReceiver() { | ||
override fun onReceive(p0: Context?, p1: Intent?) { | ||
return | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,17 @@ | |
android:name="firebase_analytics_collection_deactivated" | ||
android:value="true" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it still the case in UnifiedPush android-embedded_fcm_distributor ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This metadata is used to disable the collection but it should be useless in our case since we have excluded the firebase-analytics module |
||
|
||
<service | ||
android:name=".gplay.push.fcm.VectorFirebaseMessagingService" | ||
<receiver | ||
android:enabled="true" | ||
android:name=".push.fcm.EmbeddedFCMDistributor" | ||
android:exported="false"> | ||
|
||
<intent-filter> | ||
<action android:name="com.google.firebase.MESSAGING_EVENT" /> | ||
<action android:name="org.unifiedpush.android.distributor.REGISTER"/> | ||
<action android:name="org.unifiedpush.android.distributor.UNREGISTER"/> | ||
</intent-filter> | ||
</service> | ||
|
||
</receiver> | ||
|
||
</application> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) 2022 New Vector Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package im.vector.app.push.fcm | ||
|
||
import android.content.Context | ||
import org.unifiedpush.android.embedded_fcm_distributor.EmbeddedDistributorReceiver | ||
|
||
class EmbeddedFCMDistributor : EmbeddedDistributorReceiver() { | ||
override fun getEndpoint(context: Context, token: String, instance: String): String { | ||
// Here token is the FCM Token, used by the gateway (sygnal) | ||
return token | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird that we have to exclude those modules again, since it's already done here: https://github.com/UnifiedPush/android-embedded_fcm_distributor/blob/main/lib/build.gradle#L44
Anyway, the CI is happy now, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's very weird. And when the lib is a module of the project it isn't necessary. That's probably because of jitpack then