User Tag List

Results 1 to 9 of 9

Thread: number of purchases counter

  1. #1
    Clicker Fusion 2.5iOS Export Module

    Join Date
    Mar 2012
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    number of purchases counter

    Hey guys,

    I want to have a counter on an app that I have created that displays number of purchases, the counter will also be displayed on the apps website.

    Does anybody have an idea on how to achieve this, would it be done through an extension like lacewing?

    Any help would be hugely appreciated!

    Cheers,
    Lachmandoo

  2. #2
    Clicker Multimedia Fusion 2iOS Export Module

    Join Date
    Apr 2009
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is a method to do this if you have an SQL database, using the GET object. If you aren't familiar with PHP or SQL, I can write you the scripts that you would use for incrementing the number of purchases and displaying the number of purchases. As for your website, if you have an SQL database with it, you can very easily just use a small segment of PHP to display the same value here.

    - Use an ini on the games startup (first frame possible, just in case they quit early into the app) and check that it is equal to 0.
    - If the ini value is set to 0 (default value if you haven't set any ini values before), just run a PHP script which will add 1 to a value in an SQL database (this requires PHP and SQL, however it should not be too hard for you to pick up how to do this).
    - Now, set the ini value to 1. This means next time the user starts up, it won't add any value.
    - On whichever frame you want to use it, you can just run another PHP script to retrieve the current value in the database and show it in your frame. You could also store this value in a global variable if you want to display it across frames without wanting to constantly execute the script.

    I have included a zip file for you in case you don't know much about PHP. It's got the script you need for the PHP side (you need to edit 7 keywords (marked out) to match your own SQL database), the extension data if you don't already have the extension and also an .mfa example to show you what to do.

    All of it's well commented. I assume you should have an SQL database if you have a web domain. So, if you need any help with setting that up, just ask. No credit required and I look forward to seeing your game in the app store. Good luck!
    Attached files Attached files

  3. #3
    Clicker Fusion 2.5iOS Export Module

    Join Date
    Mar 2012
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Woodyboy! you are a god amongst men! thank you so much for the help, when my app hits its first million sales im cutting you a slice I will have a good crack at getting it working now and let you know if I hit any problems.

    Thanks Heaps!

  4. #4
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)
    It's a nice and simple way of doing it. But if a player removes the app from his device, and downloads/installs it later, the number of purchase will be incremented one more time.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,367
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    To Avoid what Olivier mentions here, you could upload the phone's unique ID. I don't know much about the iOS runtime, but I am sure such an ID should be availible. Then you could simply count the number of uniqe ID's that has been playing the game.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Tuna's Avatar
    Join Date
    Feb 2008
    Location
    Central Texas
    Posts
    1,853
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Several of us have wondered if there is a way to get the phone's unique id... In IOS 5.0, the ability to get the device using [[UIDevice currentDevice] uniqueIdentifier] has been deprecated in favor of generating (not getting) a unique identifier... This is discussed here: http://stackoverflow.com/questions/1...or-mac-address in answsers two and three.

    Since I'm unaware of a function in MMF2 that utilizes either methodology, someone would need to create a quick little extension to pull this off.

    Generating a uniqueID pretty much ruins using the idea of storing the phone's unique id, which had been suggested above as a way of getting around each uninstall/reinstall being counted.

    Deprecated doesn't always mean "removed" but typically its an indicator that it will be gone eventually.

  7. #7
    Clicker Fusion 2.5iOS Export Module

    Join Date
    Mar 2012
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Woodboy I cant seem to get the script to work, is it cool if I email you the application to have a look at?

  8. #8
    Clicker Multimedia Fusion 2iOS Export Module

    Join Date
    Apr 2009
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah. Sure. I can take a look at it for you. Just email the .mfa and scripts to me at starburst@parallelvoltage.com and I'll take a look.

    Sorry for the late reply. I've just got back from a small weekend away. I'll test it in the simulator afterwards just to make sure before sending it back.

  9. #9
    Clicker Multimedia Fusion 2iOS Export Module

    Join Date
    Apr 2009
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah. Sure. I can take a look at it for you. Just email the .mfa and scripts to me at starburst@parallelvoltage.com and I'll take a look.

    Sorry for the late reply. I've just got back from a small weekend of working with Unity. It's probably an error on my part somewhere.

Similar Threads

  1. [bug] COUNTER (number of decimals)
    By StingRay in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 9th April 2013, 12:27 PM
  2. Large number display in Counter Objects?
    By Benicle in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 7th December 2012, 09:46 AM
  3. In-game purchases, NOT in-app purchases.
    By XStar in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 4th September 2012, 08:44 PM
  4. Counter not displaying proper number
    By jellytot in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 22nd January 2009, 09:11 AM
  5. [Bug?] Counter and fixed number of digits = 0
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 23rd December 2007, 11:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •