Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import cloud.mindbox.mobile_sdk.logger.MindboxLogger
import cloud.mindbox.mobile_sdk.pushes.MindboxPushService
import cloud.mindbox.mobile_sdk.pushes.PushServiceHandler
import cloud.mindbox.mobile_sdk.utils.ExceptionHandler

/**
* An object to use when choosing push provider in Mindbox.initPushServices or Mindbox.init.
* Represents FCM
* */
object MindboxFirebase : MindboxPushService {

override val tag: String = "FCM"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import cloud.mindbox.mobile_sdk.logger.MindboxLogger
import cloud.mindbox.mobile_sdk.pushes.MindboxPushService
import cloud.mindbox.mobile_sdk.pushes.PushServiceHandler
import cloud.mindbox.mobile_sdk.utils.ExceptionHandler

/**
* An object to use when choosing push provider in Mindbox.initPushServices or Mindbox.init.
* Represents HCM
* */
object MindboxHuawei : MindboxPushService {

override val tag: String = "HCM"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package cloud.mindbox.mobile_sdk

/**
* An error thrown during initialization in case validation of initialization fails
* */
class InitializeMindboxException(message: String) : Exception(message)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package cloud.mindbox.mobile_sdk.abtests

interface CustomerAbMixer {
internal interface CustomerAbMixer {
fun stringModulusHash(identifier: String, salt: String): Int
}
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import cloud.mindbox.mobile_sdk.monitoring.domain.interfaces.MonitoringRepositor
import com.android.volley.VolleyLog
import kotlinx.coroutines.*
import org.threeten.bp.Instant

/**
* An interface for internal sdk work only. Do not implement or use it.
* */
interface MindboxLogger {

fun i(parent: Any, message: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ package cloud.mindbox.mobile_sdk.models

import com.google.gson.Gson
import com.google.gson.annotations.JsonAdapter

/**
* A class for representing Mindbox error.
* Used in operations.
* */
sealed class MindboxError(open val statusCode: Int?) {

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.google.gson.stream.JsonReader
import com.google.gson.stream.JsonToken
import com.google.gson.stream.JsonWriter

class MindboxErrorAdapter : TypeAdapter<MindboxError?>() {
internal class MindboxErrorAdapter : TypeAdapter<MindboxError?>() {

private val gson by lazy { Gson() }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package cloud.mindbox.mobile_sdk.models

import com.google.gson.annotations.SerializedName

/**
* A class to hold validation message if validation error occurs
* */
data class ValidationMessage(
@SerializedName("message") val message: String? = null,
@SerializedName("location") val location: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package cloud.mindbox.mobile_sdk.pushes

import cloud.mindbox.mobile_sdk.logger.MindboxLogger
import cloud.mindbox.mobile_sdk.utils.ExceptionHandler

/**
* An interface for internal sdk work only. Do not implement it
* */
interface MindboxPushService {

val tag: String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package cloud.mindbox.mobile_sdk.pushes

import com.google.gson.annotations.SerializedName

/**
* A class representing mindbox push action in [RemoteMessage]
* * You can use it as a model to store data from mindbox
* * with your custom push notification implementation.
* */
data class PushAction(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а почему это публичное?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

потому что цепочка зависимостей ведет к интерфейсу MindboxImageFailureHandler, который должен быть публичным

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тогда согласен

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А нет Do not implement it. Data класс все равно нельзя наследовать. Путь имплементируют, если захотят свою реализацию пушей

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если они захотят свою реализацию пушей, пусть пишут свою реализацию пушей? Зачем им наши модельки? Просто чтобы свои не создавать по необходимости?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пусть наши используют. Так мы гарантируем, что они будут парсить наши пуши правильно, так же как мы

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправил комменты

@SerializedName("uniqueKey") val uniqueKey: String?,
@SerializedName("text") val text: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import android.content.Context
import cloud.mindbox.mobile_sdk.logger.MindboxLoggerImpl
import cloud.mindbox.mobile_sdk.utils.LoggingExceptionHandler
import java.util.UUID

/**
* A class for internal sdk work only. Do not extend or use it
* */
abstract class PushServiceHandler {

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package cloud.mindbox.mobile_sdk.pushes

/**
* A class representing mindbox remote message
* You can use it as a model to store data from mindbox
* with your custom push notification implementation.
* */
data class RemoteMessage(
val uniqueKey: String,
val title: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package cloud.mindbox.mobile_sdk.utils

/**
* A class for internal sdk work only. Do not extend or use it
* */
abstract class ExceptionHandler {

fun <T> runCatching(block: () -> T) {
Expand Down