How to create a code generator in gs? How apple gives promo codes?

famekraftsfamekrafts Member, BASIC Posts: 834
Just like a serial code or promo code with text string, like what you get when you buy any software online, random, and gets generated only once.

Has anyone tried this in gs? I want to create such unique promo codes in side the game, unique for each device, maybe use random text, time, date and device id( if gs can read it) and mix them up to create a unique code, which gets showed only once.

Also can anyone enlighten me about how apple app promo codes are generated? I have not reached distribution part yet but if we can put our own promo codes when publishing, that might really help, instead of using the generator above. Is there any limit to promo code?

Comments

  • hotMagichotMagic Member, PRO Posts: 266
    Promo codes are 50 per release. So if you update the game, you get 50 more each time.

    They pretty much randomly generate unique strings. Who knows what method, but there isn't a format pattern.

    It would be easy for you to do the same using device milliseconds, but the questions is if you want to check if it's unique. In that case, you can't do that between many devices. However, you COULD do that inside one device by storing in a table.
  • famekraftsfamekrafts Member, BASIC Posts: 834
    Thanks, so how exactly I do it? I am looking for a formula. Let's skip the device part, if I take date and time of the system time and mugg it up with generic 24 alphabets to create the code, what will be the formula like?
  • EatingMyHatEatingMyHat Member Posts: 1,246
    I have a secret code aspect in Wild Surf to activate some in-game freebies or disable ads.

    1. You can have an attribute with a predefined list of codes, but these should not be your actual codes - just the "CRC", since it is very easy to extract those from the gamesalad project (even when it is on the App Store).
    2. Define your formula to construct the code from the CRC
    3. Build the reverse logic to check your code
  • famekraftsfamekrafts Member, BASIC Posts: 834
    Thanks buddy, but it went over my head. Can you give me a demo, I can figure it out, just a basic one will do.
  • famekraftsfamekrafts Member, BASIC Posts: 834
    this is what I have thought of, put 24 alphabets in a table. make a 10 digit actor each code calls for a random attribute either table or a number from system time and date, so, this way each actor out of 10 will have a random number or alphabet.

    As there is no inapp purchase for now in my games, just getting the promo code work will be good enough.

    so when we start the game we will load the promo code which will be 0 or invisible for now., make the attribute code to true

    once the code is generated and shown, it will get saved and the code will become false, so next time the game starts it will not be regenerated.

    the logic sounds fine? its just I cannot create a backtracker, the reverse logic part for this, as there is no guarantee what system time is on the player device.

    The problem is how will I check whether the promo code has been given away or not? Manually can be troublesome if there are many thousand downloads.
  • famekraftsfamekrafts Member, BASIC Posts: 834
    Bump guys any help here?
  • MobileRocketGamesMobileRocketGames Member Posts: 128
    edited November 2012
    ...The problem is how will I check whether the promo code has been given away or not? Manually can be troublesome if there are many thousand downloads.
    I had the same dilemma. Unfortunately as the URL function is one-way you can't do what you are hoping to do.

    You are just gonna have to accept that you can't verify if a code has been given away or not. In fact, because of this, if you give away codes such as "remove all ads" or "get this and this" you run the risk of any player you give the code to, giving it away or posting it online for the world to use.

    Because of this, you have to decide if that risk is worth it and/or make the promo's gifts you give away acceptable to be had for free.

    OH HOLY !@#$%!! I THOUGHT OF A WAY!! SORT OF!!
    brb, gotta code some !@#$%.

  • famekraftsfamekrafts Member, BASIC Posts: 834
    On top of that I do not have a gs pro yet. I was actually thinking of giving one app bought with another free. I have thought of a manual way, might not work that well, but let's see, how it goes. Will update if I succeed.
  • famekraftsfamekrafts Member, BASIC Posts: 834
    Promo codes are 50 per release. So if you update the game, you get 50 more each time.

    .
    So when we update the previous codes are still valid or they cannot be used again?
Sign In or Register to comment.