接入外部sdk
This commit is contained in:
@@ -215,7 +215,24 @@ public void startSDK(bool shouldCallback, string CallBackObjectName)
|
||||
public void setConsentData(AppsFlyerConsent appsFlyerConsent)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
_setConsentData(appsFlyerConsent.isUserSubjectToGDPR, appsFlyerConsent.hasConsentForDataUsage, appsFlyerConsent.hasConsentForAdsPersonalization);
|
||||
string isUserSubjectToGDPR = appsFlyerConsent.isUserSubjectToGDPR?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForDataUsage = appsFlyerConsent.hasConsentForDataUsage?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForAdsPersonalization = appsFlyerConsent.hasConsentForAdsPersonalization?.ToString().ToLower() ?? "null";
|
||||
string hasConsentForAdStorage = appsFlyerConsent.hasConsentForAdStorage?.ToString().ToLower() ?? "null";
|
||||
|
||||
_setConsentData(isUserSubjectToGDPR, hasConsentForDataUsage, hasConsentForAdsPersonalization, hasConsentForAdStorage);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs ad revenue data along with additional parameters if provided.
|
||||
/// </summary>
|
||||
/// <param name = "adRevenueData" >instance of AFAdRevenueData containing ad revenue information.</param>
|
||||
/// <param name = "additionalParameters" >An optional map of additional parameters to be logged with ad revenue data. This can be null if there are no additional parameters.</param>
|
||||
public void logAdRevenue(AFAdRevenueData adRevenueData, Dictionary<string, string> additionalParameters)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
_logAdRevenue(adRevenueData.monetizationNetwork, adRevenueData.mediationNetwork, adRevenueData.currencyIso4217Code, adRevenueData.eventRevenue, AFMiniJSON.Json.Serialize(additionalParameters));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -318,13 +335,14 @@ public void startSDK(bool shouldCallback, string CallBackObjectName)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To send and validate in app purchases you can call this method from the processPurchase method - please use v2.
|
||||
/// [Deprecated] To send and validate in app purchases - please use V2 with AFSDKPurchaseDetailsIOS instead.
|
||||
/// </summary>
|
||||
/// <param name="productIdentifier">The product identifier.</param>
|
||||
/// <param name="price">The product price.</param>
|
||||
/// <param name="currency">The product currency.</param>
|
||||
/// <param name="transactionId">The purchase transaction Id.</param>
|
||||
/// <param name="additionalParameters">The additional param, which you want to receive it in the raw reports.</param>
|
||||
[System.Obsolete("This method is deprecated. Use validateAndSendInAppPurchase(AFSDKPurchaseDetailsIOS details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject) instead.")]
|
||||
public void validateAndSendInAppPurchase(string productIdentifier, string price, string currency, string transactionId, Dictionary<string, string> additionalParameters, MonoBehaviour gameObject)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
@@ -333,15 +351,14 @@ public void startSDK(bool shouldCallback, string CallBackObjectName)
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// V2
|
||||
/// To send and validate in app purchases you can call this method from the processPurchase method.
|
||||
/// V2 - To send and validate in app purchases you can call this method from the processPurchase method.
|
||||
/// </summary>
|
||||
/// <param name="details">The AFSDKPurchaseDetailsIOS instance.</param>
|
||||
/// <param name="extraEventValues">The extra params, which you want to receive it in the raw reports.</param>
|
||||
public void validateAndSendInAppPurchase(AFSDKPurchaseDetailsIOS details, Dictionary<string, string> extraEventValues, MonoBehaviour gameObject)
|
||||
/// <param name="purchaseAdditionalDetails">The additional params, which you want to receive it in the raw reports.</param>
|
||||
public void validateAndSendInAppPurchase(AFSDKPurchaseDetailsIOS details, Dictionary<string, string> purchaseAdditionalDetails, MonoBehaviour gameObject)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
_validateAndSendInAppPurchaseV2(details.productId, details.price, details.currency, details.transactionId, AFMiniJSON.Json.Serialize(extraEventValues), gameObject ? gameObject.name : null);
|
||||
_validateAndSendInAppPurchaseV2(details.productId, details.transactionId, (int)details.purchaseType, AFMiniJSON.Json.Serialize(purchaseAdditionalDetails), gameObject ? gameObject.name : null);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -748,7 +765,14 @@ public void startSDK(bool shouldCallback, string CallBackObjectName)
|
||||
#elif UNITY_STANDALONE_OSX
|
||||
[DllImport("AppsFlyerBundle")]
|
||||
#endif
|
||||
private static extern void _setConsentData(bool isUserSubjectToGDPR, bool hasConsentForDataUsage, bool hasConsentForAdsPersonalization);
|
||||
private static extern void _setConsentData(string isUserSubjectToGDPR, string hasConsentForDataUsage, string hasConsentForAdsPersonalization, string hasConsentForAdStorage);
|
||||
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
#elif UNITY_STANDALONE_OSX
|
||||
[DllImport("AppsFlyerBundle")]
|
||||
#endif
|
||||
private static extern void _logAdRevenue(string monetizationNetwork, MediationNetwork mediationNetwork, string currencyIso4217Code, double eventRevenue, string additionalParameters);
|
||||
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
@@ -819,7 +843,7 @@ public void startSDK(bool shouldCallback, string CallBackObjectName)
|
||||
#elif UNITY_STANDALONE_OSX
|
||||
[DllImport("AppsFlyerBundle")]
|
||||
#endif
|
||||
private static extern void _validateAndSendInAppPurchaseV2(string product, string price, string currency, string transactionId, string extraEventValues, string objectName);
|
||||
private static extern void _validateAndSendInAppPurchaseV2(string product, string transactionId, int purchaseType, string purchaseAdditionalDetails, string objectName);
|
||||
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
|
||||
Reference in New Issue
Block a user