Open Feint

I have got open feint to work before but now I am unsure how I did it. I believe that I have their SDK installed, but do not know if I need to find it and run it. I tried downloading it again, but I just got a folder with a ton of file I did not need before.

Both of these line are at the top of my file and they both crash my file on the simulator (together and individually). (I have changed the numbers and letters and added symbols for security purposes.)

[code]
openfeint = require “openfeint”

openfeint.init( “Fp#JRDFFGbG##acd##bwYw”, “D7MZAIOh3##GgfdDPAfS##0SkRz6B1#6ZfF0H#ID98”, “#43#92” )
[import]uid: 4871 topic_id: 1714 reply_id: 301714[/import]

OpenFeint doesn’t work in the simulator, at the top of your code, you need to check whether you’re on the device or in the simulator, and ONLY call the openfeint lines (init, unlocking achievements, setting high scores, etc) when you’re on the DEVICE.

Here’s the code I use (Note: the code below only works on Alpha 3 of Game Edition and above):


onDevice = false

if system.getInfo( “environment” ) == “device” then
onDevice = true
else
onDevice = false
end


Then, when you need to make an OpenFeint call, use this:

if onDevice then

–> OpenFeint code goes here
openfeint.init( “Fp#JRDFFGbG##acd##bwYw”, “D7MZAIOh3##GgfdDPAfS##0SkRz6B1#6ZfF0H#ID98”, “#43#92” )

end
Likewise, when you’re unlocking achievements, etc. always start off with: if onDevice then

To test out OpenFeint stuff just build for device, install it on your device and test it out from there. On the simulator, it’ll be like OpenFeint was never included (but it will stop crashing your app in the simulator).

Hope that helps!

Oh… and the OpenFeint SDK is only for those using XCode + Objective-C … I never downloaded the OpenFeint SDK yet I still have it working perfectly in my Corona-made game :slight_smile: [import]uid: 7849 topic_id: 1714 reply_id: 5010[/import]

I came back on here to say never-mind and that it works on the device, but I did not know that I could use that if then statement. That is awesome. -thanks [import]uid: 4871 topic_id: 1714 reply_id: 5022[/import]