Skip to content
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

fix: remove currentRoute parameter in in-app event listener #159

Merged
merged 1 commit into from
Jan 20, 2023
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
2 changes: 1 addition & 1 deletion messaginginapp/api/messaginginapp.api
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public final class io/customer/messaginginapp/ModuleMessagingInApp : io/customer

public abstract interface class io/customer/messaginginapp/type/InAppEventListener {
public abstract fun errorWithMessage (Lio/customer/messaginginapp/type/InAppMessage;)V
public abstract fun messageActionTaken (Lio/customer/messaginginapp/type/InAppMessage;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
public abstract fun messageActionTaken (Lio/customer/messaginginapp/type/InAppMessage;Ljava/lang/String;Ljava/lang/String;)V
public abstract fun messageDismissed (Lio/customer/messaginginapp/type/InAppMessage;)V
public abstract fun messageShown (Lio/customer/messaginginapp/type/InAppMessage;)V
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ internal class GistInAppMessagesProvider(private val provider: GistApi) :
override fun embedMessage(message: Message, elementId: String) {}

override fun onAction(message: Message, currentRoute: String, action: String, name: String) {
listener?.messageActionTaken(InAppMessage.getFromGistMessage(message), currentRoute = currentRoute, action = action, name = name)
listener?.messageActionTaken(InAppMessage.getFromGistMessage(message), action = action, name = name)
}

override fun onError(message: Message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ interface InAppEventListener {
fun messageShown(message: InAppMessage)
fun messageDismissed(message: InAppMessage)
fun errorWithMessage(message: InAppMessage)
fun messageActionTaken(message: InAppMessage, currentRoute: String, action: String, name: String)
fun messageActionTaken(message: InAppMessage, action: String, name: String)
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ internal class InAppMessagesProviderTest : BaseTest() {
val givenAction = String.random
val givenName = String.random
gistInAppMessagesProvider.onAction(givenMessage, givenCurrentRoute, givenAction, givenName)
verify(eventListenerMock).messageActionTaken(expectedInAppMessage, currentRoute = givenCurrentRoute, action = givenAction, name = givenName)
verify(eventListenerMock).messageActionTaken(expectedInAppMessage, action = givenAction, name = givenName)
}

@Test
Expand Down