增加隐私协议链接、买量用户接口
This commit is contained in:
parent
8f7c307af3
commit
65e5cec021
|
@ -41,11 +41,17 @@ public class AdjustManager : D_MonoSingleton<AdjustManager>
|
|||
|
||||
ShuShuEvent.Instance.Track("adjust_init");
|
||||
FireBaseAnalyticsManager.Instance.LogEvent("adjust_init");
|
||||
Adjust.GetAdid((id)=>
|
||||
Adjust.GetAdid((id) =>
|
||||
{
|
||||
ShuShuEvent.Instance.SetSuperProperties(new Dictionary<string, object>() { { "adid", id } });
|
||||
ShuShuEvent.Instance.UserSet(new Dictionary<string, object>() { { "adid", id } });
|
||||
});
|
||||
|
||||
var network = AdjustNetwork.GetNetwork();
|
||||
if (!string.IsNullOrEmpty(network))
|
||||
{
|
||||
RushSDKManager.Instance.OnUserSourceListener?.Invoke(IsOrganic(network), network);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -128,7 +134,7 @@ public class AdjustManager : D_MonoSingleton<AdjustManager>
|
|||
campaign = attribution.Campaign;
|
||||
adgroup = attribution.Adgroup;
|
||||
creative = attribution.Creative;
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(attribution.Network))
|
||||
{
|
||||
network = attribution.Network;
|
||||
|
@ -139,7 +145,7 @@ public class AdjustManager : D_MonoSingleton<AdjustManager>
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
network = "Organic";
|
||||
}
|
||||
|
||||
|
@ -160,6 +166,8 @@ public class AdjustManager : D_MonoSingleton<AdjustManager>
|
|||
{ "adgroup", adgroup ?? "" },
|
||||
{ "creative", creative ?? "" },
|
||||
});
|
||||
|
||||
RushSDKManager.Instance.OnUserSourceListener?.Invoke(IsOrganic(network), network);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -29,10 +29,14 @@ public class AdjustNetwork : D_MonoSingleton<AdjustNetwork>
|
|||
}
|
||||
}
|
||||
|
||||
public static string GetNetwork()
|
||||
{
|
||||
return PlayerPrefs.GetString(KEY_USER_NETWORK);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否是自然量用户
|
||||
/// 默认买量用户
|
||||
/// 默认自然量用户
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool InOrganic()
|
||||
|
@ -42,7 +46,7 @@ public class AdjustNetwork : D_MonoSingleton<AdjustNetwork>
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (network.ToLower().Replace(" ", "") == "Organic".ToLower().Replace(" ", ""))
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -30,7 +30,23 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
AdsSDKManager.Instance.InitSDK(action);
|
||||
EFSdkManager.Instance.Init();
|
||||
}
|
||||
|
||||
#region 买量用户回调
|
||||
|
||||
public Action<bool, string> OnUserSourceListener;
|
||||
|
||||
/// Adjust归因回调
|
||||
/// <summary>
|
||||
/// <param name="is organic user">是否为买量用户</param>
|
||||
/// <param name="adNetwork">adjust 返回的network字段</param>
|
||||
/// </summary>
|
||||
public void SetUserSourceListener(Action<bool, string> _action)
|
||||
{
|
||||
OnUserSourceListener = _action;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ad
|
||||
|
||||
|
@ -49,15 +65,15 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
/// <returns></returns>
|
||||
public bool IsRewardedAdReady()
|
||||
{
|
||||
return AdsSDKManager.Instance.IsRewardAdReady();;
|
||||
}
|
||||
|
||||
return AdsSDKManager.Instance.IsRewardAdReady(); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 展示激励广告
|
||||
/// </summary>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="callback"></param>
|
||||
public void ShowRewardAd(string position, Action<bool,double> callback = null)
|
||||
public void ShowRewardAd(string position, Action<bool, double> callback = null)
|
||||
{
|
||||
AdsActionEvents.TrackAdPosition(AdsType.Rewarded, position);
|
||||
bool isRewardAdReady = AdsSDKManager.Instance.IsRewardAdReady();
|
||||
|
@ -83,8 +99,8 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
callback?.Invoke(false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否已缓存插屏
|
||||
|
@ -93,7 +109,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
{
|
||||
return AdsSDKManager.Instance.IsInterstitialReady();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 展示插屏广告
|
||||
/// </summary>
|
||||
|
@ -122,7 +138,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
AdsActionEvents.TrackAdFailToShow(AdsType.Interstitial, position, AdsShowFailType.NoFill);
|
||||
callback?.Invoke(-1);
|
||||
}
|
||||
|
@ -143,7 +159,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
AdsActionEvents.TrackAdFailToShow(AdsType.Interstitial, position, AdsShowFailType.NoFill);
|
||||
callback?.Invoke(-1);
|
||||
}
|
||||
|
@ -154,7 +170,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
callback?.Invoke(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ShowBanner()
|
||||
{
|
||||
AdsActionEvents.TrackAdPosition(AdsType.Banner, "");
|
||||
|
@ -163,12 +179,12 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
AdsSDKManager.Instance.ShowBanner();
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
AdsActionEvents.TrackAdFailToShow(AdsType.Banner, "", AdsShowFailType.NoFill);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void HideBanner()
|
||||
{
|
||||
AdsSDKManager.Instance.HideBanner();
|
||||
|
@ -179,7 +195,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
var adUnitId = StaticValue.AdmobFullNativeId;
|
||||
return AdsSDKManager.Instance.IsNativeAdReady(adUnitId);
|
||||
}
|
||||
|
||||
|
||||
public void ShowFullNative(RectTransform rectTransform, Camera pCom = null, string position = "")
|
||||
{
|
||||
AdsActionEvents.TrackAdPosition(AdsType.Native, position);
|
||||
|
@ -188,18 +204,18 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
AdsActionEvents.TrackAdFailToShow(AdsType.Native, position, AdsShowFailType.NoFill);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var adUnitId = StaticValue.AdmobFullNativeId;
|
||||
var nativeAdPosition = NativeAdPosition.Create(new NativeTemplateStyle
|
||||
{
|
||||
TemplateId = NativeTemplateId.Medium,
|
||||
MainBackgroundColor = Color.white
|
||||
}, rectTransform, pCom);
|
||||
|
||||
|
||||
AdsSDKManager.Instance.ShowNativeAd(position, adUnitId, nativeAdPosition);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取全屏Native广告价值
|
||||
/// </summary>
|
||||
|
@ -234,14 +250,14 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
AdsActionEvents.TrackAdFailToShow(AdsType.Native, position, AdsShowFailType.NoFill);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var adUnitId = StaticValue.AdmobNativeId;
|
||||
var nativeAdPosition = NativeAdPosition.Create(new NativeTemplateStyle
|
||||
{
|
||||
TemplateId = NativeTemplateId.Small,
|
||||
MainBackgroundColor = Color.white
|
||||
}, rectTransform, pCom);
|
||||
|
||||
|
||||
AdsSDKManager.Instance.ShowNativeAd(position, adUnitId, nativeAdPosition);
|
||||
}
|
||||
|
||||
|
@ -250,7 +266,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
var adUnitId = StaticValue.AdmobNativeId;
|
||||
AdsSDKManager.Instance.RemoveNativeAd(adUnitId);
|
||||
}
|
||||
|
||||
|
||||
public bool IsSmallNativeReady()
|
||||
{
|
||||
var adUnitId = StaticValue.AdmobSmallNativeId;
|
||||
|
@ -265,14 +281,14 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
AdsActionEvents.TrackAdFailToShow(AdsType.Native, position, AdsShowFailType.NoFill);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var adUnitId = StaticValue.AdmobSmallNativeId;
|
||||
var nativeAdPosition = NativeAdPosition.Create(new NativeTemplateStyle
|
||||
{
|
||||
TemplateId = NativeTemplateId.Small,
|
||||
MainBackgroundColor = Color.white
|
||||
}, rectTransform, pCom);
|
||||
|
||||
|
||||
AdsSDKManager.Instance.ShowNativeAd(position, adUnitId, nativeAdPosition);
|
||||
}
|
||||
|
||||
|
@ -281,7 +297,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
var adUnitId = StaticValue.AdmobSmallNativeId;
|
||||
AdsSDKManager.Instance.RemoveNativeAd(adUnitId);
|
||||
}
|
||||
|
||||
|
||||
public bool IsMinddleNativeReady()
|
||||
{
|
||||
var adUnitId = StaticValue.AdmobMinddleNativeId;
|
||||
|
@ -296,14 +312,14 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
AdsActionEvents.TrackAdFailToShow(AdsType.Native, position, AdsShowFailType.NoFill);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var adUnitId = StaticValue.AdmobMinddleNativeId;
|
||||
var nativeAdPosition = NativeAdPosition.Create(new NativeTemplateStyle
|
||||
{
|
||||
TemplateId = NativeTemplateId.Small,
|
||||
MainBackgroundColor = Color.white
|
||||
}, rectTransform, pCom);
|
||||
|
||||
|
||||
AdsSDKManager.Instance.ShowNativeAd(position, adUnitId, nativeAdPosition);
|
||||
}
|
||||
|
||||
|
@ -332,7 +348,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
{
|
||||
[key1] = value1
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void LogEvent(string eventName, Dictionary<string, object> extraInfo)
|
||||
|
@ -341,7 +357,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
FireBaseAnalyticsManager.Instance.LogEvent(eventName, extraInfo);
|
||||
AdjustTrackEvent.Instance.TrackEventName(eventName, extraInfo);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 公共事件属性
|
||||
/// </summary>
|
||||
|
@ -351,7 +367,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
ShuShuEvent.Instance.SetSuperProperties(args);
|
||||
FireBaseAnalyticsManager.Instance.SetSuperProperties(args);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户属性
|
||||
/// </summary>
|
||||
|
@ -363,7 +379,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 在线参数
|
||||
|
||||
public bool GetRemoteConfigBool(string key, bool defaultValue = false)
|
||||
|
@ -374,7 +390,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
}
|
||||
return FireBaseRemoteConfigManager.Instance.GetRemoteConfigBool(key, defaultValue);
|
||||
}
|
||||
|
||||
|
||||
public int GetRemoteConfigInt(string key, int defaultValue = 0)
|
||||
{
|
||||
if (Application.isEditor)
|
||||
|
@ -383,7 +399,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
}
|
||||
return FireBaseRemoteConfigManager.Instance.GetRemoteConfigInt(key, defaultValue);
|
||||
}
|
||||
|
||||
|
||||
public string GetRemoteConfigStr(string key, string defaultValue = "")
|
||||
{
|
||||
if (Application.isEditor)
|
||||
|
@ -392,7 +408,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
}
|
||||
return FireBaseRemoteConfigManager.Instance.GetRemoteConfigString(key, defaultValue);
|
||||
}
|
||||
|
||||
|
||||
public float GetRemoteConfigFloat(string key, float defaultValue = 0)
|
||||
{
|
||||
if (Application.isEditor)
|
||||
|
@ -455,7 +471,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
|
||||
public void CanGoback(Action<bool> canGobackAction)
|
||||
{
|
||||
EFSdk.get().CanGoback(canGobackAction);
|
||||
EFSdk.get().CanGoback(canGobackAction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -476,8 +492,8 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 设置推送开关, SDK默认关闭通知
|
||||
/// </summary>
|
||||
|
@ -588,7 +604,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
}
|
||||
int pageId = EFSdk.get().GetJumpPage();
|
||||
return pageId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -614,7 +630,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
return;
|
||||
}
|
||||
// 如果没有通知权限就尝试申请通知权限
|
||||
if(!HasNotifyPermission())
|
||||
if (!HasNotifyPermission())
|
||||
{
|
||||
EFSdk.get().ReqNotifyPermission(isgGranted =>
|
||||
{
|
||||
|
@ -654,7 +670,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
}
|
||||
EFSdk.get().UnSubscribeUnclaimed01();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
// 满足条件: 在排队中 且 当日R$1 未领取 的买量用户, 调用这个方法
|
||||
/// </summary>
|
||||
|
@ -703,7 +719,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
}
|
||||
EFSdk.get().UnSubscribeToTopic(topic);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 可覆盖广告的Toast
|
||||
/// </summary>
|
||||
|
@ -722,9 +738,9 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
/// </summary>
|
||||
public void AutoLocalPush(bool isOpen)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Webview展示成功后回调
|
||||
/// </summary>
|
||||
|
@ -733,7 +749,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
{
|
||||
EFSdkManager.Instance.SetWebviewShowSuccessAction(action);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
@ -745,7 +761,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
return AdjustNetwork.Instance.InOrganic();
|
||||
}
|
||||
|
||||
public string GetGaid()
|
||||
public string GetGaid()
|
||||
{
|
||||
if (Application.isEditor)
|
||||
{
|
||||
|
@ -829,7 +845,7 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
{
|
||||
return "GetSSDistinctId";
|
||||
}
|
||||
LoggerUtils.Debug("GetSSDistinctId:"+TDAnalytics.GetDistinctId());
|
||||
LoggerUtils.Debug("GetSSDistinctId:" + TDAnalytics.GetDistinctId());
|
||||
return TDAnalytics.GetDistinctId();
|
||||
}
|
||||
|
||||
|
@ -844,4 +860,9 @@ public class RushSDKManager : D_MonoSingleton<RushSDKManager>
|
|||
LoggerUtils.Debug("GetSSDistinctId:" + JsonMapper.ToJson(superProperties));
|
||||
return superProperties == null ? "" : superProperties.ToString();
|
||||
}
|
||||
|
||||
public void OpenPrivacy()
|
||||
{
|
||||
Application.OpenURL(StaticValue.PrivacyUrl);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue