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
35 changes: 34 additions & 1 deletion Docs/Migration-V7.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Update to Leanplum-Unity-SDK 7.0.0
## Android Setup
Leanplum SDK 7.0.0 has structural changes to its Android project setup, which enable more flexible ways of integrating the SDK and improve the integration with the CleverTap Unity SDK. Namely the leanplum-wrapper is now included as a module in the android project generated by Unity, instead of it being supplied as an .aar library. Due to some limitations of how Unity packages are distributed, there are a few manual changes that need to be made when updating from a previous version of the SDK:
Leanplum SDK 7.0.0 has structural changes to its Android project setup, which enable more flexible ways of integrating the SDK and improve the integration with the CleverTap Unity SDK. Namely the leanplum-wrapper is now included as a module in the android project generated by Unity, instead of it being supplied as an .aar library. Due to some limitations of how Unity packages are distributed, there are a few manual changes that need to be made when updating from a previous version of the SDK:
### Leanplum Update

1. Import the updated Leanplum Unity package to your project.
Expand Down Expand Up @@ -102,3 +102,36 @@ Leanplum SDK 7.0.0 has structural changes to its Android project setup, which e
```
3. Do not use CleverTapSettings from the Unity editor and do not add CleverTap account data in the AndroidManifest.xml file, Leanplum will apply the correct values automatically.
4. See how to enable the optional CleverTap features [here](CleverTap-Optional-Features.md)

## iOS Setup
Leanplum SDK 7.0.0 has iOS integration changes. The Leanplum iOS SDK and its dependencies CleverTap iOS SDK and SDWebImage are no longer included as xcframeworks in the Plugins/iOS folder. The dependencies are now resolved using the External Dependency Manager for Unity.

### Leanplum Update
1. Dependencies
Delete the xcframeworks from Plugins/iOS folder if they exist.
The required dependencies are installed using CocoaPods and the [EDM4U](https://github.com/googlesamples/unity-jar-resolver) plugin. Set up EDM4U plugin to install CocoaPods automatically. Go to Assets > External Dependency Manager > iOS Resolver > Settings. Check Podfile generate and choose Cocoapods Integration - Add Cocoapods to the Xcode workspace.
Alternatively, manually install pods by running pod install in the exported XCode project. Ensure to start .xcworkspace to build the app with dependencies.

2. `LeanplumUnityAppController`
Leanplum adds a subclass of the `UnityAppController`. It sets up `UNUserNotificationCenter`. It is primarily used for CleverTap Unity migration.
If you use your own `UnityAppController` override, inherit from the `CleverTapUnityAppController` or call the CleverTap methods. If you use your own one, you can disable the `LeanplumUnityAppController` by setting `LP_NO_APP_CONTROLLER_SUBCLASS` preprocessor macro.

3. Post Process Build Script
Ensure the `LeanplumApplePostProcessor` script is updated when you update the SDK and import the assets. The build script _no_ longer adds the xcframeworks. It updates `GCC_PREPROCESSOR_DEFINITIONS` macros.

4. Do _not_ use CleverTapSettings from the Unity editor and do not add CleverTap account data in the Info.plist file, Leanplum will apply the correct values automatically.

## CleverTap Usage
It is _no_ longer required to have a "CleverTapUnity" `GameObject`. Remove the object since the CleverTap SDK will create the required game objects automatically.
You should now use the `CleverTap` static interface (_not_ `CleverTapBinding`). CleverTap callbacks can be registered from any object now (_no_ longer required to be in CleverTapUnity.cs).

If you want to do any CleverTap configurations or call CleverTap SDK directly, you need to do that inside the `CleverTapReady` callback. This ensures CleverTap is initialized and ready:

```c-sharp
Leanplum.CleverTapInstanceReady += () =>
{
// Record basic event with no properties
CleverTap.RecordEvent("testEvent");
};
```

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace LeanplumSDK
/// </summary>
public class Constants
{
public const string SDK_VERSION = "6.1.0";
public const string SDK_VERSION = "7.0.0";

internal const string CLIENT_PREFIX = "unity";
internal const string EVENT_EXCEPTION = "__exception";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<dependencies>
<iosPods>
<iosPod name="Leanplum-iOS-SDK" version="6.6.0" minTargetSdk="9.0" />
<iosPod name="Leanplum-iOS-SDK" version="6.6.1" minTargetSdk="9.0" />
</iosPods>
</dependencies>
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ANDROID_SDK_VERSION?=7.6.3

UNITY_VERSION?=6.1.0
UNITY_VERSION?=7.0.0

UNITY_EDITOR_VERSION?=2022.3.50f1

Expand Down