参数以及上报
This commit is contained in:
parent
3d4726c922
commit
358a41e2ed
@ -2,6 +2,7 @@ using System.Collections;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
public partial class AdManager
|
public partial class AdManager
|
||||||
{
|
{
|
||||||
@ -9,6 +10,7 @@ public partial class AdManager
|
|||||||
|
|
||||||
private Action<int> _rewardCallback;
|
private Action<int> _rewardCallback;
|
||||||
private bool _rewardOK = false;
|
private bool _rewardOK = false;
|
||||||
|
public Action<string> luaAdRevenuePaidEventCallback;
|
||||||
|
|
||||||
public void InitializeRewardedAds()
|
public void InitializeRewardedAds()
|
||||||
{
|
{
|
||||||
@ -26,6 +28,11 @@ public partial class AdManager
|
|||||||
LoadRewardedAd();
|
LoadRewardedAd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetAdRevenuePaidEventCallback(Action<string> callback)
|
||||||
|
{
|
||||||
|
luaAdRevenuePaidEventCallback = callback;
|
||||||
|
}
|
||||||
|
|
||||||
private void LoadRewardedAd()
|
private void LoadRewardedAd()
|
||||||
{
|
{
|
||||||
MaxSdk.LoadRewardedAd(adRewardUnitId);
|
MaxSdk.LoadRewardedAd(adRewardUnitId);
|
||||||
@ -91,6 +98,29 @@ public partial class AdManager
|
|||||||
|
|
||||||
private void OnRewardedAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
private void OnRewardedAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||||
{
|
{
|
||||||
// Ad revenue paid. Use this callback to track user revenue.
|
if (luaAdRevenuePaidEventCallback == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
double revenue = adInfo.Revenue;
|
||||||
|
// Miscellaneous data
|
||||||
|
string countryCode = MaxSdk.GetSdkConfiguration().CountryCode; // "US" for the United States, etc - Note: Do not confuse this with currency code which is "USD" in most cases!
|
||||||
|
string networkName = adInfo.NetworkName; // Display name of the network that showed the ad (e.g. "AdColony")
|
||||||
|
string adUnitIdentifier = adInfo.AdUnitIdentifier; // The MAX Ad Unit ID
|
||||||
|
string placement = adInfo.Placement; // The placement this ad's postbacks are tied to
|
||||||
|
string networkPlacement = adInfo.NetworkPlacement; // The placement ID from the network that showed the ad
|
||||||
|
string adFormat = adInfo.AdFormat;
|
||||||
|
|
||||||
|
var dict = new Dictionary<string, string>();
|
||||||
|
dict.Add("revenue", revenue.ToString());
|
||||||
|
dict.Add("country_code", countryCode);
|
||||||
|
dict.Add("network_name", networkName);
|
||||||
|
dict.Add("ad_unit_Id", adUnitId);
|
||||||
|
dict.Add("ad_unit_identifier", adUnitIdentifier);
|
||||||
|
dict.Add("placement", placement);
|
||||||
|
dict.Add("network_placement", networkPlacement);
|
||||||
|
dict.Add("ad_format", adFormat);
|
||||||
|
var result = JsonConvert.SerializeObject(dict);
|
||||||
|
luaAdRevenuePaidEventCallback(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -128,5 +128,15 @@ namespace BF
|
|||||||
// BFLog.Log("PostAdjustPartnerTrackEvent");
|
// BFLog.Log("PostAdjustPartnerTrackEvent");
|
||||||
Adjust.trackEvent(adjustEvent);
|
Adjust.trackEvent(adjustEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void PostAdjustAdRevenueAppLovinMAX(double revenue, string networkName, string adUnitIdentifier, string placement)
|
||||||
|
{
|
||||||
|
var adRevenue = new AdjustAdRevenue(AdjustConfig.AdjustAdRevenueSourceAppLovinMAX);
|
||||||
|
adRevenue.setRevenue(revenue, "USD");
|
||||||
|
adRevenue.setAdRevenueNetwork(networkName);
|
||||||
|
adRevenue.setAdRevenueUnit(adUnitIdentifier);
|
||||||
|
adRevenue.setAdRevenuePlacement(placement);
|
||||||
|
Adjust.trackAdRevenue(adRevenue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ namespace XLua.CSObjectWrap
|
|||||||
{
|
{
|
||||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||||
System.Type type = typeof(AdManager);
|
System.Type type = typeof(AdManager);
|
||||||
Utils.BeginObjectRegister(type, L, translator, 0, 10, 0, 0);
|
Utils.BeginObjectRegister(type, L, translator, 0, 11, 1, 1);
|
||||||
|
|
||||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init);
|
||||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsRewardedAdReady", _m_IsRewardedAdReady);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsRewardedAdReady", _m_IsRewardedAdReady);
|
||||||
@ -33,9 +33,12 @@ namespace XLua.CSObjectWrap
|
|||||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitializeBannerAds", _m_InitializeBannerAds);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitializeBannerAds", _m_InitializeBannerAds);
|
||||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitializeInterstitialAds", _m_InitializeInterstitialAds);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitializeInterstitialAds", _m_InitializeInterstitialAds);
|
||||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitializeRewardedAds", _m_InitializeRewardedAds);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "InitializeRewardedAds", _m_InitializeRewardedAds);
|
||||||
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetAdRevenuePaidEventCallback", _m_SetAdRevenuePaidEventCallback);
|
||||||
|
|
||||||
|
|
||||||
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "luaAdRevenuePaidEventCallback", _g_get_luaAdRevenuePaidEventCallback);
|
||||||
|
|
||||||
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "luaAdRevenuePaidEventCallback", _s_set_luaAdRevenuePaidEventCallback);
|
||||||
|
|
||||||
|
|
||||||
Utils.EndObjectRegister(type, L, translator, null, null,
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
||||||
@ -381,10 +384,67 @@ namespace XLua.CSObjectWrap
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||||
|
static int _m_SetAdRevenuePaidEventCallback(RealStatePtr L)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||||
|
|
||||||
|
|
||||||
|
AdManager gen_to_be_invoked = (AdManager)translator.FastGetCSObj(L, 1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
System.Action<string> _callback = translator.GetDelegate<System.Action<string>>(L, 2);
|
||||||
|
|
||||||
|
gen_to_be_invoked.SetAdRevenuePaidEventCallback( _callback );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch(System.Exception gen_e) {
|
||||||
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||||
|
static int _g_get_luaAdRevenuePaidEventCallback(RealStatePtr L)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||||
|
|
||||||
|
AdManager gen_to_be_invoked = (AdManager)translator.FastGetCSObj(L, 1);
|
||||||
|
translator.Push(L, gen_to_be_invoked.luaAdRevenuePaidEventCallback);
|
||||||
|
} catch(System.Exception gen_e) {
|
||||||
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||||
|
static int _s_set_luaAdRevenuePaidEventCallback(RealStatePtr L)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||||
|
|
||||||
|
AdManager gen_to_be_invoked = (AdManager)translator.FastGetCSObj(L, 1);
|
||||||
|
gen_to_be_invoked.luaAdRevenuePaidEventCallback = translator.GetDelegate<System.Action<string>>(L, 2);
|
||||||
|
|
||||||
|
} catch(System.Exception gen_e) {
|
||||||
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ namespace XLua.CSObjectWrap
|
|||||||
{
|
{
|
||||||
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||||
System.Type type = typeof(BF.BFThirdReportSDKManager);
|
System.Type type = typeof(BF.BFThirdReportSDKManager);
|
||||||
Utils.BeginObjectRegister(type, L, translator, 0, 12, 0, 0);
|
Utils.BeginObjectRegister(type, L, translator, 0, 13, 0, 0);
|
||||||
|
|
||||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Init", _m_Init);
|
||||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetThinkingAnalyticsAccountId", _m_SetThinkingAnalyticsAccountId);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SetThinkingAnalyticsAccountId", _m_SetThinkingAnalyticsAccountId);
|
||||||
@ -35,6 +35,7 @@ namespace XLua.CSObjectWrap
|
|||||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostAdjustRevenueTrackEvent", _m_PostAdjustRevenueTrackEvent);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostAdjustRevenueTrackEvent", _m_PostAdjustRevenueTrackEvent);
|
||||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostAdjustCallbackTrackEvent", _m_PostAdjustCallbackTrackEvent);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostAdjustCallbackTrackEvent", _m_PostAdjustCallbackTrackEvent);
|
||||||
Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostAdjustPartnerTrackEvent", _m_PostAdjustPartnerTrackEvent);
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostAdjustPartnerTrackEvent", _m_PostAdjustPartnerTrackEvent);
|
||||||
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "PostAdjustAdRevenueAppLovinMAX", _m_PostAdjustAdRevenueAppLovinMAX);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -495,6 +496,37 @@ namespace XLua.CSObjectWrap
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
||||||
|
static int _m_PostAdjustAdRevenueAppLovinMAX(RealStatePtr L)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
||||||
|
|
||||||
|
|
||||||
|
BF.BFThirdReportSDKManager gen_to_be_invoked = (BF.BFThirdReportSDKManager)translator.FastGetCSObj(L, 1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
double _revenue = LuaAPI.lua_tonumber(L, 2);
|
||||||
|
string _networkName = LuaAPI.lua_tostring(L, 3);
|
||||||
|
string _adUnitIdentifier = LuaAPI.lua_tostring(L, 4);
|
||||||
|
string _placement = LuaAPI.lua_tostring(L, 5);
|
||||||
|
|
||||||
|
gen_to_be_invoked.PostAdjustAdRevenueAppLovinMAX( _revenue, _networkName, _adUnitIdentifier, _placement );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch(System.Exception gen_e) {
|
||||||
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -24,7 +24,7 @@ public class GoogleLogin {
|
|||||||
private static volatile GoogleLogin sInstance;
|
private static volatile GoogleLogin sInstance;
|
||||||
private GoogleSignInClient mGoogleSignInClient;
|
private GoogleSignInClient mGoogleSignInClient;
|
||||||
private static final int REQUEST_CODE_GOOGLE_SIGN_IN = 1001; /* unique request id */
|
private static final int REQUEST_CODE_GOOGLE_SIGN_IN = 1001; /* unique request id */
|
||||||
private static final String server_client_token = "607986907718-up5m04a0gmmaf8gio0k1q6a3koai198t.apps.googleusercontent.com";
|
private static final String server_client_token = "1008416471093-e47s7u8a7v31ulr2f7e9j1mdm9llepum.apps.googleusercontent.com";
|
||||||
|
|
||||||
public static GoogleLogin getInstance()
|
public static GoogleLogin getInstance()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user