Search Unity

Daily Rewards

Discussion in 'Assets and Asset Store' started by nunesbarbosa, Feb 12, 2015.

  1. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    facebook.png

    Daily Rewards
    is a great way to increase retention but also helps monetization as players get a sense of the benefit of having more coins/currency within the game.

    Avoid player cheating by changing the device clock! This asset uses an anti-cheating mechanism that uses a network clock.
    • Supports multiple days (even weeks or months)
    • Time rewards feature for a single reward per seconds interval
    • Mobile ready
    • Easy to use
    • Easy to integrate
    • Portrait and Landscape versions

    Check in the asset Store:
    http://u3d.as/bgH

    Demo

    Documentation

    First 5 users replying this thread gets a Voucher!
    - Edited - The vouchers are over.

    Don't forget to rate!
     
    Last edited: Jan 5, 2017
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,442
    hey :) i could try test it on some small game later in here.
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,442
    btw. When you click "claim" the time is 00:00:00 for a 1 second, not that it matters much,
    but I guess it could be fixed (or made appear only when it passed 1s, to show correct time)
     
  4. mpiquerasdev

    mpiquerasdev

    Joined:
    Dec 4, 2014
    Posts:
    2
    It's an awesome pack, I recommend it.
     
  5. mpiquerasdev

    mpiquerasdev

    Joined:
    Dec 4, 2014
    Posts:
    2
  6. nosyrbllewe

    nosyrbllewe

    Joined:
    Oct 18, 2012
    Posts:
    182
    Cool. This could be pretty useful. Can the rewards last longer than 5 days without reseting (or keep the reward for the 5th day for every day following in a row?
     
    Last edited: Mar 1, 2015
  7. ctknoxville

    ctknoxville

    Joined:
    Oct 1, 2013
    Posts:
    32
    Looks like a great idea. Would like to try it out too on one of our games :)
     
  8. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    does it work with a back end?
     
  9. cg_destro

    cg_destro

    Joined:
    Aug 13, 2013
    Posts:
    142
    Would like to try it out too :)
     
  10. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    The asset was made to work in cycles of N days. After it reaches the last day, it goes back to the first.
    It is array based, so it works for an infinite number of days.
     
  11. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Daily Rewards works with two PlayerPrefs variables :
    - When was the reward was claimed
    - What was the last reward

    I guess you can adapt those variables to your server or database if you want some backending but the code is prepared for that.
     
    hahahpizza likes this.
  12. revocelotmoky

    revocelotmoky

    Joined:
    Mar 4, 2014
    Posts:
    11
    Hi, does it work on mobile?
     
  13. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Yes, it is mobile ready.
     
    revocelotmoky likes this.
  14. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
    @nunesbarbosa, this have notifications or push notifications for alert the user when the game/application is not ON?
     
  15. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Daily rewards does not have the mobile local notification feature.

    I recommend using assets such as https://www.assetstore.unity3d.com/en/#!/content/10825 or https://www.assetstore.unity3d.com/en/#!/content/9484 or https://www.assetstore.unity3d.com/en/#!/content/25871

    and then integrating Local Notifications into the code according to the platform.
     
  16. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
  17. dragon2777

    dragon2777

    Joined:
    Jan 28, 2016
    Posts:
    1
    does this work with Unity 5 I got a warning that it might not be compatible thank you
     
  18. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Daily Rewards is compatible with Unity versions 4.6 and up.. it is fully compatible with all 5.x versions.
     
  19. TomSantoro

    TomSantoro

    Joined:
    Oct 17, 2015
    Posts:
    9
    Hey,

    Awesome plugin.

    Is there a way I can edit the code so as to reward the player a different item on the last day?

    For example:

    "Day 1 = 100 coins
    Day 2 = 200 coins
    etc...
    Day 7 = 1 gem"

    ?

    Thanks in advance
     
  20. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    TomSantoro, the code is open to edit and this feature should be rather easy to implement. I may add this flexibility on a future release. If you have questions on how to do it please send me a message.
     
  21. TomSantoro

    TomSantoro

    Joined:
    Oct 17, 2015
    Posts:
    9
    Thanks! Have sent you a message!
     
  22. TomSantoro

    TomSantoro

    Joined:
    Oct 17, 2015
    Posts:
    9
    Great support!

    Worked a treat!

    Thanks!
     
  23. bigcatgame

    bigcatgame

    Joined:
    Mar 11, 2015
    Posts:
    2
    hi,
    Have plugin protect cheating? if changing phone time in settings.
     
  24. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    The plugin does not protect from cheating. It is possible change the script to use a server time instead of using the local time but it requires some programming skills.
     
  25. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Hey everyone!

    Sorry I took so long to update Daily Rewards. There are a lot of big changes on the new version including an anti cheating API.

    @bigcatgame
     
  26. udede

    udede

    Joined:
    Jul 26, 2011
    Posts:
    72
    hi

    how to integraiton traning video?
     
  27. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Hi udede. Please elaborate your question.
     
  28. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Do you own Followers Profile Zoomer and want to add Daily Rewards or do you want to integrate Followers Profile Zoomer to your app and want to use Daily Rewards in the backending?
     
  29. Wiremuch

    Wiremuch

    Joined:
    Jan 28, 2015
    Posts:
    104
    Hi nunesbarbosa, great asset. I have a problem with the latest version in that every time I reload the scene, the timer resets as well and the reward become available. Is there a fix to this?
     
  30. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Hi Wiremuch!

    You can check "Is Singleton" property so the clock keeps ticking when you reload the scene. Make sure you don't call PlayerPrefs.DeleteAll() between scenes as Daily Rewards uses PlayerPrefs to store last claimed data.

    Are you using Daily Rewards or Timed Rewards?
     
  31. Wiremuch

    Wiremuch

    Joined:
    Jan 28, 2015
    Posts:
    104
    Thanks for the quick reply. I'm using Timed Rewards and tested a fresh import as well on an example project. For some reason when singleton is ticked, it duplicates the timed rewards canvas every time I reload the scene. This only started happening from the latest update for me.
     
  32. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Wiremuch you've found a bug I'll fix in the next version. Meanwhile please replace the method Awake in DailyRewardsCore.cs

    from:
    Code (CSharp):
    1.         protected virtual void Awake()
    2.         {
    3.             if (isSingleton)
    4.                 DontDestroyOnLoad(this.gameObject);
    5.         }
    to:
    Code (CSharp):
    1.         protected virtual void Awake()
    2.         {
    3.             if (isSingleton)
    4.             {
    5.                 DontDestroyOnLoad(this.gameObject);
    6.  
    7.                 var instanceCount = GetInstanceCount ();
    8.  
    9.                 if (instanceCount > 1)
    10.                     Destroy(gameObject);
    11.             }
    12.         }
    13.  
    14.         // Returns the amount of instances with the same id
    15.         private int GetInstanceCount()
    16.         {
    17.             var instances = FindObjectsOfType<T>();
    18.             var count = 0;
    19.             for (int i = 0; i < instances.Length; i++)
    20.             {
    21.                 if ((instances[i]).instanceId == instanceId)
    22.                     count ++;
    23.             }
    24.             return count;
    25.         }
    Thanks for your feedback and I'm really sorry for your inconvenience!
     
  33. Wiremuch

    Wiremuch

    Joined:
    Jan 28, 2015
    Posts:
    104
    @nunesbarbosa Great! Yep this works, thanks for the quick solution.
     
  34. Wiremuch

    Wiremuch

    Joined:
    Jan 28, 2015
    Posts:
    104
    Been testing on mobile and found something else. When you leave the app (but keep it running in the background) with the timer at, for e.g 00:03:18, go away for a while and come back it goes back to around 00:03:18 (I think whatever time is shown when you first open the app is what it goes back to). However if you close the app and open it again, the correct time is shown.

    You can replicate this on a mac by playing the project in Unity with the timer running, leaving Unity (and go to Safari or something) and then coming back.

    Any idea what the solution is? Again, only discovered this on latest update. (Btw, really like the new features added to the update regardless!)
     
    Alex_theDev likes this.
  35. TauseefCVS

    TauseefCVS

    Joined:
    Mar 28, 2016
    Posts:
    15
    hello, In the daily rewarded package the rewarded according to time not working and create the error on runtime, can you guide me about this
     
  36. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Hi TauseefCVS,
    can you share the error message and Timed Rewards configuration? Thanks!
     
  37. TauseefCVS

    TauseefCVS

    Joined:
    Mar 28, 2016
    Posts:
    15
    @nunesbarbosa

    NullReferenceException: Object reference not set to an instance of an object
    NiobiumStudios.TimedRewardsInterface.InitializeAvailableRewardsUI () (at Assets/DailyRewards/Scripts/TimedRewardsInterface.cs:117)
    NiobiumStudios.TimedRewardsInterface.Start () (at Assets/DailyRewards/Scripts/TimedRewardsInterface.cs:50)
     
  38. kdeger

    kdeger

    Joined:
    Mar 4, 2018
    Posts:
    22
    hi @nunesbarbosa

    Thank you for this awesome package, it works for me well and really easy to integrate.

    Currently I have a problem, the reward system works fine without any problem. Inside Unity everything seems normal but from an android device the rewards doesn't appear on daily reward window. Could you help on this issue?
     
  39. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Hi kdeger, can you send me details, print screens and error logs in the support e-mail?

    contact@niobiumstudios.com
     
  40. shyamlondonconsolidated

    shyamlondonconsolidated

    Joined:
    Apr 1, 2018
    Posts:
    36
    Hi Guilherme,

    Just a followup email I sent you, to provide a bit of background of what I am trying to do;

    I have an endless arcade game
    • Within the main scene I have a UI_Camera game object canvas which should contain the timed reward
    • Within the UI_Camera, holds the ScoreManager script
    • On player death, a gameover splash becomes active within the UI_Camera and the player has the opportunity to get a timed reward if available.
    The steps I have done;
    1) Effectively all I have done is dropped the timedreward prefab into the UI_Camera
    2) I have modified the ScoreManager.cs script as attached to include the functions, void onEnable, void onDisable, void onClaimPrizeTimedRewards as mentioned previously.
    3) Within the timedrewards script, I have 3 rewards available; score +25, score +50, score +100
    Just to clarify, the reward "unit" should be "newTotalScore" as referenced in ScoreManager or even LifeScore (playerpref key?)

    Is there anything I am missing, I have spent a few hours last night trying to get this to work with no luck. Any help would be really appreciated!

    Kind Regards,

    Shyam
     
  41. hassonhamo3

    hassonhamo3

    Joined:
    May 25, 2018
    Posts:
    38
    hi Niobium Studios , does this asset work with inventory pro :)?
     
  42. nunesbarbosa

    nunesbarbosa

    Joined:
    Jul 17, 2012
    Posts:
    103
    Hi hassonhamo3. I'm not familiar with Inventory Pro. Daily Rewards works independently from other assets.
     
    hassonhamo3 likes this.
  43. hassonhamo3

    hassonhamo3

    Joined:
    May 25, 2018
    Posts:
    38
    I see , too bad I won't be able to use this great asset , well keep up the good work :D
     
  44. ocimpean

    ocimpean

    Joined:
    Aug 10, 2013
    Posts:
    128
    Found your youtube video

    that helps if anyone have comprehension issues like I do ;)
    -------------
    original msg.
    Could you write a step by step instruction, how to integrate the free version in another project (for begginers kind)?
    And also mention please where we need to paste IntegrationDailyRewards code.

    Also in Unity 2018, getting some error, dragging the prefabs into an empty scene:
    Thank you

    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[NiobiumStudios.DailyRewardUI].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    NiobiumStudios.DailyRewardsInterface.SnapToReward () (at Assets/DailyRewards/Examples/Scripts/DailyRewardsInterface.cs:247)
    NiobiumStudios.DailyRewardsInterface.OnInitialize (Boolean error, System.String errorMessage) (at Assets/DailyRewards/Examples/Scripts/DailyRewardsInterface.cs:314)
    NiobiumStudios.DailyRewards.InitializeTimer () (at Assets/DailyRewards/Scripts/DailyRewards.cs:60)
    NiobiumStudios.DailyRewards.Start () (at Assets/DailyRewards/Scripts/DailyRewards.cs:40)
     
    Last edited: Jan 5, 2019
  45. mahmoud93p

    mahmoud93p

    Joined:
    Feb 11, 2015
    Posts:
    66
    Hello ,
    How can i know when you gift is ready in background?
     
    Last edited: Mar 3, 2019
  46. vidard

    vidard

    Joined:
    Nov 1, 2018
    Posts:
    3
    having trouble with this on android after my samsung s8+ phone updated to android 9. while working fine on all other android phones i've tested and before the android update on my own. can't quite figure out whats going wrong though. Also started a clean project with only daily rewards and problem persists
     
  47. vidard

    vidard

    Joined:
    Nov 1, 2018
    Posts:
    3
    seems to be because android 9 requires https and worldclockapi doesnt have a valid ssl cert
     
  48. dev_2051

    dev_2051

    Joined:
    Jul 25, 2013
    Posts:
    92
    Had a similiar issue with worldclock api add the following on androidmanifest.xml to allow http. If needed you can specifically mention domain to allow http calls for that site/domain only under xml tag.

    <application android:usesCleartextTraffic="true" />
     
    vidard likes this.
  49. axiom88

    axiom88

    Joined:
    Dec 20, 2017
    Posts:
    1
    Hello.
    We are using assets well.
    There was a problem today.
    World clock is not connected.
    Below is a log of the error.
    Could you tell me how to fix it?


    Error Loading World Clock. Retrying connection 3
    Error Loading World Clock:403 Forbidden
     
    Vauxvogh likes this.
  50. Vauxvogh

    Vauxvogh

    Joined:
    Nov 29, 2017
    Posts:
    10
    Same, the worldclock is down now it seems. It has stopped working