Skip to content

Commit d6772b6

Browse files
fix: crash when IL2CCP option is enabled (#28)
* fix: crash when IL2CCP option is enabled
1 parent fb408b1 commit d6772b6

11 files changed

+20
-5
lines changed

Assets/Plugins/iOS/mParticleUnity.m

369 KB
Binary file not shown.

Assets/mParticle/MParticleAndroid.cs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace mParticleAndroid
1010
{
11+
#if UNITY_ANDROID || UNITY_EDITOR
1112
public sealed class MParticleAndroid : IMParticleSDK
1213
{
1314
private AndroidJavaObject mp;
@@ -454,4 +455,5 @@ public IMParticleTask<IdentityApiResult> AddFailureListener(OnFailure listener)
454455
}
455456

456457
}
458+
#endif
457459
}

Assets/mParticle/MParticleiOS.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace mParticleiOs
1111
{
12+
#if UNITY_IOS || UNITY_EDITOR
1213
public class MParticleiOS : IMParticleSDK
1314
{
1415
/*
@@ -637,6 +638,6 @@ internal void setFailed(IdentityHttpResponse onFailure)
637638
listener.Invoke(_failure);
638639
}
639640
}
640-
641641
}
642+
#endif
642643
}

Assets/mParticle/android/ToAndroidUtils.cs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace mParticle.android
88
{
9+
#if UNITY_ANDROID || UNITY_EDITOR
910
internal class ToAndroidUtils
1011
{
1112
internal AndroidJavaClass identityTypeClass;
@@ -257,4 +258,5 @@ internal AndroidJavaObject ConvertToMpOptions(MParticleOptions options, object c
257258
return nativeMpOptions.Call<AndroidJavaObject>("build");
258259
}
259260
}
261+
#endif
260262
}

Assets/mParticle/android/ToCSUtils.cs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace mParticle.android
55
{
6+
#if UNITY_ANDROID || UNITY_EDITOR
67
internal class ToCSUtils
78
{
89
public ToCSUtils()
@@ -19,4 +20,5 @@ internal static mParticle.Environment ConvertToCSharpEnvironment(AndroidJavaObje
1920
return (mParticle.Environment)Enum.Parse(typeof(Environment), value.Call<string>("name"));
2021
}
2122
}
23+
#endif
2224
}

Assets/mParticle/android/nativeproxies/AndroidOnFailureListener.cs

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace mParticle.android
77
{
8+
#if UNITY_ANDROID || UNITY_EDITOR
89
internal class AndroidOnFailureListener : AndroidJavaProxy
910
{
1011
OnFailure listener;
@@ -45,4 +46,5 @@ void onFailure(AndroidJavaObject response)
4546
}
4647

4748
}
49+
#endif
4850
}

Assets/mParticle/android/nativeproxies/AndroidOnSuccessListener.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace mParticle.android
77
{
8+
#if UNITY_ANDROID || UNITY_EDITOR
89
public class AndroidOnSuccessListener : AndroidJavaProxy
910
{
1011
OnSuccess listener;
@@ -30,6 +31,6 @@ void onSuccess(AndroidJavaObject result)
3031
});
3132
}
3233
}
33-
3434
}
35+
#endif
3536
}

Assets/mParticle/android/nativeproxies/AndroidOnUserIdentified.cs

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace mParticle.android
77
{
8+
#if UNITY_ANDROID || UNITY_EDITOR
89
class AndroidOnUserIdentified : AndroidJavaProxy
910
{
1011
OnUserIdentified onUserIdentifiedHandler;
@@ -20,4 +21,5 @@ void onUserIdentified(AndroidJavaObject user)
2021
onUserIdentifiedHandler.Invoke(new MParticleUserImpl(user));
2122
}
2223
}
24+
#endif
2325
}

Assets/mParticle/android/nativeproxies/AndroidUserAliasHandler.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace mParticle.android
77
{
8+
#if UNITY_ANDROID || UNITY_EDITOR
89
class AndroidUserAliasHandler : AndroidJavaProxy
910
{
1011
OnUserAlias userAliasHandler;
@@ -20,7 +21,5 @@ public void onUserAlias(AndroidJavaObject previousUser, AndroidJavaObject newUse
2021
userAliasHandler.Invoke(new MParticleUserImpl(previousUser), new MParticleUserImpl(newUser));
2122
}
2223
}
23-
24-
25-
24+
#endif
2625
}

Assets/mParticle/ios/ToCSUtils.cs

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace mParticle.ios
99
{
10+
#if UNITY_IOS || UNITY_EDITOR
1011
public class ToCSUtils
1112
{
1213
public ToCSUtils()
@@ -172,6 +173,7 @@ private static string[] popDictionaryStringFromString(string valueRaw)
172173
return new string[]{ valueRaw, "" };
173174
}
174175
}
176+
#endif
175177
}
176178

177179
// Sample = "AssertAttribute1":"value101","AssertAttribute3":"value303","AssertAttribute2":"value202"

Assets/mParticle/ios/ToiOSUtils.cs

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
namespace mParticle.ios
77
{
8+
#if UNITY_IOS || UNITY_EDITOR
89
internal class ToiOSUtils
910
{
1011
public ToiOSUtils()
@@ -68,5 +69,6 @@ internal bool ParseBoolean(string result, bool fallback)
6869
}
6970
}
7071
}
72+
#endif
7173
}
7274

0 commit comments

Comments
 (0)