Updated huawei file and tested notifications

pull/1685/head
ThomasSession 6 months ago
parent 02a8d6d7bf
commit eea61da38d

@ -54,8 +54,8 @@
"channel_id":""
},
"edukit":{
"edu_url":"edukit.edu.cloud.huawei.com.cn",
"dh_url":"edukit.edu.cloud.huawei.com.cn"
"edu_url":"edukit.cloud.huawei.com.cn",
"dh_url":"edukit.cloud.huawei.com.cn"
},
"search":{
"url":"https://search-dre.cloud.huawei.com"

@ -33,13 +33,20 @@ private const val TAG = "PushHandler"
class PushReceiver @Inject constructor(@ApplicationContext val context: Context) {
private val json = Json { ignoreUnknownKeys = true }
/**
* Both push services should hit this method once they receive notification data
* As long as it is properly formatted
*/
fun onPushDataReceived(dataMap: Map<String, String>?) {
addMessageReceiveJob(dataMap?.asPushData())
}
/**
* This is a fallback method in case the Huawei data is malformated,
* but it shouldn't happen. Old code used to send different data so this is kept as a safety
*/
fun onPushDataReceived(data: ByteArray?) {
addMessageReceiveJob(PushData(data = data, metadata = null))
//todo DELETION verify this once I can get notifications on debug huawei builds
}
private fun addMessageReceiveJob(pushData: PushData?){

Loading…
Cancel
Save