Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 16, 2024
2 parents 40d7724 + 79ba1ef commit ac2bcd8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Runtime/Scripts/IQonversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public interface IQonversion
/// Call this function to check if the fallback file is accessible.
/// </summary>
/// <param name="callback">Callback that will be called when response is received.</param>
public void IsFallbackFileAccessible(Qonversion.OnIsFallbackFileAccessibleReceived callback);
public void IsFallbackFileAccessible(Qonversion.OnFallbackFileAccessibilityResponseReceived callback);

/// <summary>
/// You can check if a user is eligible for an introductory offer, including a free trial.
Expand Down
4 changes: 2 additions & 2 deletions Runtime/Scripts/Internal/QonversionInternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal class QonversionInternal : MonoBehaviour, IQonversion
private Qonversion.OnUserPropertiesReceived UserPropertiesCallback { get; set; }
private Qonversion.OnAttachUserResponseReceived AttachUserCallback { get; set; }
private Qonversion.OnAttachUserResponseReceived DetachUserCallback { get; set; }
private Qonversion.OnIsFallbackFileAccessibleReceived FallbackFileCallback { get; set; }
private Qonversion.OnFallbackFileAccessibilityResponseReceived FallbackFileCallback { get; set; }

public event Qonversion.OnPromoPurchasesReceived PromoPurchasesReceived
{
Expand Down Expand Up @@ -207,7 +207,7 @@ public void DetachUserFromRemoteConfiguration(string remoteConfigurationId, Qonv
instance.DetachUserFromRemoteConfiguration(remoteConfigurationId, OnDetachUserMethodName);
}

public void IsFallbackFileAccessible(Qonversion.OnIsFallbackFileAccessibleReceived callback)
public void IsFallbackFileAccessible(Qonversion.OnFallbackFileAccessibilityResponseReceived callback)
{
FallbackFileCallback = callback;
IQonversionWrapper instance = GetNativeWrapper();
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Scripts/Qonversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static IQonversion Initialize(QonversionConfig config)
public delegate void OnAttachUserResponseReceived(bool success, QonversionError error);
public delegate void OnEligibilitiesReceived(Dictionary<string, Eligibility> eligibilities, QonversionError error);
public delegate void OnUserInfoReceived(User userInfo, QonversionError error);
public delegate void OnIsFallbackFileAccessibleReceived(bool success);
public delegate void OnFallbackFileAccessibilityResponseReceived(bool success);

/// <summary>
/// Delegate fires each time a promo purchase from the App Store happens.
Expand Down
18 changes: 13 additions & 5 deletions Runtime/iOS/QonversionWrapperIOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,19 @@ internal class QonversionWrapperIOS : IQonversionWrapper
public void Initialize(string gameObjectName)
{
#if UNITY_IOS
string filePath = System.IO.Path.Combine(Application.streamingAssetsPath, FallbackFileName);

if (System.IO.File.Exists(filePath)) {
string result = System.IO.File.ReadAllText(filePath);
File.WriteAllText(Application.persistentDataPath + "/" + FallbackFileName, result);
try
{
string filePath = Path.Combine(Application.streamingAssetsPath, FallbackFileName);

if (File.Exists(filePath))
{
string result = System.IO.File.ReadAllText(filePath);
File.WriteAllText(Application.persistentDataPath + "/" + FallbackFileName, result);
}
}
catch (Exception e)
{
Debug.LogWarning("Fallback file is not accessible");
}

_initialize(gameObjectName);
Expand Down

0 comments on commit ac2bcd8

Please sign in to comment.