UnifiedPush WIP
This commit is contained in:
parent
8f565edb0a
commit
287fca5438
33 changed files with 376 additions and 215 deletions
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2023 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 io.element.android.libraries.push.providers.api
|
||||
|
||||
data class Distributor(
|
||||
val value: String,
|
||||
val name: String,
|
||||
)
|
||||
|
|
@ -26,8 +26,23 @@ interface PushProvider {
|
|||
* Allow to sort provider, from lower index to higher index
|
||||
*/
|
||||
val index: Int
|
||||
fun getDistributorNames(): List<String>
|
||||
suspend fun registerWith(matrixClient: MatrixClient, distributorName: String)
|
||||
|
||||
/**
|
||||
* User friendly name.
|
||||
*/
|
||||
val name: String
|
||||
|
||||
fun getDistributors(): List<Distributor>
|
||||
|
||||
/**
|
||||
* Register the pusher to the homeserver
|
||||
*/
|
||||
suspend fun registerWith(matrixClient: MatrixClient, distributor: Distributor, clientSecret: String)
|
||||
|
||||
/**
|
||||
* Unregister the pusher
|
||||
*/
|
||||
suspend fun unregister(matrixClient: MatrixClient)
|
||||
|
||||
/**
|
||||
* Attempt to troubleshoot the push provider
|
||||
|
|
|
|||
|
|
@ -20,4 +20,5 @@ import io.element.android.libraries.matrix.api.MatrixClient
|
|||
|
||||
interface PusherSubscriber {
|
||||
suspend fun registerPusher(matrixClient: MatrixClient, pushKey: String, gateway: String)
|
||||
suspend fun unregisterPusher(matrixClient: MatrixClient, pushKey: String, gateway: String)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue