-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from qonversion/release/3.6.0
Release 3.6.0
- Loading branch information
Showing
32 changed files
with
502 additions
and
1,518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<dependencies> | ||
<androidPackages> | ||
<androidPackage spec="io.qonversion.android.sdk:sdk:3.3.0" /> | ||
<androidPackage spec="io.qonversion.sandwich:sandwich:0.1.0" /> | ||
<androidPackage spec="com.fasterxml.jackson.core:jackson-databind:2.11.1" /> | ||
<androidPackage spec="org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.61" /> | ||
</androidPackages> | ||
<iosPods> | ||
<iosPod name="Qonversion" version="2.20.0" /> | ||
<iosPod name="QonversionSandwich" version="0.1.0" /> | ||
</iosPods> | ||
</dependencies> |
73 changes: 0 additions & 73 deletions
73
Runtime/Android/Plugins/com/qonversion/unitywrapper/AutomationsDelegate.java
This file was deleted.
Oops, something went wrong.
75 changes: 75 additions & 0 deletions
75
Runtime/Android/Plugins/com/qonversion/unitywrapper/AutomationsWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package com.qonversion.unitywrapper; | ||
|
||
import android.util.Log; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import io.qonversion.sandwich.AutomationsEventListener; | ||
import io.qonversion.sandwich.AutomationsSandwich; | ||
|
||
public class AutomationsWrapper implements AutomationsEventListener { | ||
private static final String EVENT_SCREEN_SHOWN = "OnAutomationsScreenShown"; | ||
private static final String EVENT_ACTION_STARTED = "OnAutomationsActionStarted"; | ||
private static final String EVENT_ACTION_FAILED = "OnAutomationsActionFailed"; | ||
private static final String EVENT_ACTION_FINISHED = "OnAutomationsActionFinished"; | ||
private static final String EVENT_AUTOMATIONS_FINISHED = "OnAutomationsFinished"; | ||
|
||
public static String TAG = "AutomationsDelegate"; | ||
private final MessageSender messageSender; | ||
private final AutomationsSandwich automationsSandwich; | ||
|
||
public AutomationsWrapper(MessageSender messageSender) { | ||
this.messageSender = messageSender; | ||
automationsSandwich = new AutomationsSandwich(); | ||
} | ||
|
||
public void subscribe() { | ||
automationsSandwich.subscribe(this); | ||
} | ||
|
||
@Override | ||
public void onAutomationEvent(@NonNull Event event, @Nullable Map<String, ?> data) { | ||
String methodName = ""; | ||
switch (event) { | ||
case ScreenShown: | ||
methodName = EVENT_SCREEN_SHOWN; | ||
break; | ||
case ActionStarted: | ||
methodName = EVENT_ACTION_STARTED; | ||
break; | ||
case ActionFinished: | ||
methodName = EVENT_ACTION_FINISHED; | ||
break; | ||
case ActionFailed: | ||
methodName = EVENT_ACTION_FAILED; | ||
break; | ||
case AutomationsFinished: | ||
methodName = EVENT_AUTOMATIONS_FINISHED; | ||
break; | ||
default: | ||
return; | ||
} | ||
|
||
sendMessageToUnity(data == null ? new HashMap<>() : data, methodName); | ||
} | ||
|
||
private void sendMessageToUnity(@NotNull Object objectToConvert, @NotNull String methodName) { | ||
try { | ||
messageSender.sendMessageToUnity(objectToConvert, methodName); | ||
} catch (JsonProcessingException e) { | ||
handleException(e); | ||
} | ||
} | ||
|
||
private void handleException(Exception e) { | ||
Log.e(TAG, "An error occurred while processing automations flow: " + e.getLocalizedMessage()); | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.