Advertisement
Guest User

Untitled

a guest
Dec 10th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. GetSocial.GetReferralData(onSuccess: (referralData) => {
  2. if (referralData != null) {
  3. _needToShowBeingInvitedFriendWindow = true;
  4. _saveManager.Save();
  5.  
  6. var scenario = _poolManager.Create<ShowWindowScenario>(
  7. LogicAtomWindow.INVITED_FRIEND_REWARD_WINDOW, new Dictionary<TypeOfParam, object>(), true);
  8.  
  9. _scenariosQueue.AddScenario(
  10. new ExtendedScenario(
  11. scenario, new MultiplePopupCondition(
  12. new List<IScenarioCondition> {
  13. _poolManager.Create<AppLoadingFinishedCondition>(),
  14. _poolManager.Create<NoLoadingLevelCondition>(),
  15. _poolManager.Create<TopWindowCondition>(LogicAtomWindow.HUD),
  16. _poolManager.Create<NoTutorialsCondition>(),
  17. _poolManager.Create<NoScenariosLockersCondition>(),
  18. })));
  19.  
  20. Debug.Log("Got referral data!");
  21. if (referralData.LinkParams != null) {
  22. foreach (var link in referralData.LinkParams) {
  23. Debug.Log("Link: " + link.Key + " " + link.Value);
  24. }
  25. }
  26. else {
  27. Debug.Log("No link is found!");
  28. }
  29. Debug.Log("Referred user id:" + referralData.ReferrerUserId);
  30. Debug.Log("Referred token:" + referralData.Token);
  31. Debug.Log("Referred metadata:" + referralData.IsGuaranteedMatch);
  32.  
  33. Debug.Log("App started with referral data: " + referralData);
  34. }
  35. else {
  36. Debug.Log("No referral data found");
  37. }
  38. }, onFailure: (error) => Debug.LogError("Failed to retrieve referral data, error: " + error.Message));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement