Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Open Feint won't log in on my game

Discussion in 'iOS and tvOS' started by disband85, Jan 31, 2011.

  1. disband85

    disband85

    Joined:
    Dec 7, 2010
    Posts:
    83
    Hi,

    When I run my game, I get the following notification:

    Unable to login to OpenFeint. Restart to try again.

    When I run:

    Code (csharp):
    1. OpenFeint.LaunchDashboard();
    I get the same error. When I run any other game that has OF, it automatically logs me on OF and I can open the dashboard from the main menu.

    Clearly my game is missing something. I have followed all of these steps:

    http://www.openfeint.com/ofdeveloper/index.php/kb/article/000025

    I have also followed the 13 steps in 'OpenFeint iOS Quick Start Guide' of the README.html.

    The README contains details of intialising OF using a ProductKey and ProductSecret, if you are doing a standard xcode project (not unity). The Unity documentation doesn't mention anything about initialising OF, it says to just run OpenFeint.LaunchDashboard() and it should work. Any idea on what I'm missing?
     
  2. disband85

    disband85

    Joined:
    Dec 7, 2010
    Posts:
    83
    I deleted the application from the iphone and ran 'Build and Run' from xcode. It reinstalled the application on the iphone and ran.

    I got an Open Feint popup covering the whole screen saying this game is open feint enabled. I clicked the button 'Enable Open Feint'. It said 'Starting...' for a few seconds, then came up with another Open Feint window covering the whole screen:

    Error
    OpenFeint failed to initialize. Restarting this application while connected to the internet, or reinstalling it, may fix this error. E-mail help@openfeint.com if you're having trouble.

    There's just one button, Skip. I press that and I'm back to getting the notification 'Unable to login to OpenFeint. Restart to try again.'

    So again I ask the question.... in a Unity project, do you need to initialise OF somehow?
     
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    did you update your open feint?

    In 2010 they introduced the basic concept of disabling outdated versions and no longer allowing them to join the service.
     
  4. disband85

    disband85

    Joined:
    Dec 7, 2010
    Posts:
    83
    I'm using OpenFeint 2.8, I downloaded it in either late December or early January, can't remember.
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    ok then thats not it.
    The code otherwise is correct? if the game mentions to be enabled already you shouldn't need to reenable it for example (unsure if its going to fail or not if you try to reenable an already enabled installation)
     
  6. disband85

    disband85

    Joined:
    Dec 7, 2010
    Posts:
    83
    The screen that comes up asking to enable OF only comes up the first time i run the application. To get it to come up again, i have to uninstall the app then do another build and run from xcode.

    The only code that I am trying to run so far is:

    OpenFeint.LaunchDashboard();

    This gets run when I click on a button on the main menu. However, OF is failing to initialize before I even get to the main menu (the notification error pops up during my splash screen). Clicking this button on the main menu just produces the notification error again:

    Unable to login to OpenFeint. Restart to try again.
     
  7. disband85

    disband85

    Joined:
    Dec 7, 2010
    Posts:
    83
    I just completed a whole new build rather than doing an append:

    - Build to a new location from Unity
    - Opened xcode
    - Dragged the OpenFeint folder into xcode, ticked the box to copy all items
    - Opened project properties
    - Added -ObjC to 'Other linker flags'
    - Added the following existing frameworks:

    Foundation
    UIKit
    CoreGraphics
    QuartzCore
    Security
    SystemConfiguration
    libsqlite3.0.dylib
    CFNetwork
    CoreLocation
    MapKit
    libz.1.2.3.dylib
    AddressBook
    AddressBookUI
    GameKit

    - In AppController+OpenFeint.mm, commented out the following line which causes a build error:

    [NSNumber numberWithBool:UOF_PROMPT_TO_POST_ACHIEVEMENT_UNLOCK], OpenFeintSettingPromptToPostAchievementUnlock,

    - Uninstalled the app from my iphone.
    - Clicked Build and Run.

    Unfortunately it results in the same. I get OF window saying the game is OF enabled, "Join millions of players and browse hundreds of games!", you can view leaderboards, achievements, etc. There's 2 buttons to choose from - 'I don't want these awesome features' or 'Enable OpenFeint'.

    I click 'Enable OpenFeint'. The next window says 'Starting OpenFeint...' for about 12 seconds, then a notification pops down saying 'Not logged in to OpenFeint.'. The window now says:

    Error
    OpenFeint failed to initialize. Restarting this application while connected to the internet, or reinstalling it, may fix this error. E-mail help@openfeint.com if you're having trouble.

    There's only one button to press - Skip. I press Skip and my splash screen shows up, and a notification pops down saying 'Unable to login to OpenFeint. Restart to try again.' My main menu comes up, and when I press my Open Feint button which has the following code attached to it - OpenFeint.LaunchDashboard(); - the same notification pops down - 'Unable to login to OpenFeint. Restart to try again.'

    Something is preventing OF from initializing. Here is my initialization call inside AppController+OpenFeint.mm:

    [OpenFeint initializeWithProductKey:UOF_PRODUCT_KEY
    andSecret:UOF_SECRET_KEY
    andDisplayName:UOF_APP_DISPLAY_NAME
    andSettings:settings
    andDelegates:delegates];

    Here are the defines in OpenFeintSettingsDefines.h:

    #define UOF_APP_DISPLAY_NAME @"Hogtide"
    #define UOF_APP_SHORT_DISPLAY_NAME @"Hogtide"
    #define UOF_CLIENT_ID @""
    #define UOF_PRODUCT_KEY @""
    #define UOF_SECRET_KEY @""
    #define UOF_INITIAL_DASHBOARD_ORIENTATION 3
    #define UOF_ALLOW_NOTIFICATIONS YES
    #define UOF_NOTIFICATION_POSITION 0
    #define UOF_ALLOW_STRONGER_ATTEMPT_FOR_CHALLENGES 0
    #define UOF_ENABLE_PUSH_NOTIFICATIONS NO
    #define UOF_DISABLE_USER_GENERATED_CONTENT NO
    #define UOF_PROMPT_TO_POST_ACHIEVEMENT_UNLOCK NO
    #define UOF_ALWAYS_ASK_FOR_APPROVAL_IN_DEBUG NO
     
    Last edited: Jan 31, 2011
  8. disband85

    disband85

    Joined:
    Dec 7, 2010
    Posts:
    83
    I finally fixed the problem... I just realised I was supposed to enter client ID, product key and secret key in the OpenFeint -> Set Application Settings for OpenFeint screen. I got these details from my OF dashboard and entered them directly into the OpenFeintSettingsDefines.h file for now, and now OF is initialising correctly =)
     
  9. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    hehe good to know about this "backfire"
     
  10. AdsySingle

    AdsySingle

    Joined:
    Jan 5, 2011
    Posts:
    116
    I am having so much trouble with this. First of all I have followed all the steps. I tried dropping the source files in like the instructions say, but I get errors to do with the Apple Mach-O linker. If I follow the instructions for importing openfeint as a framework then I get no compile errors and it builds. But I never see anything in game, never any splash screen. No notifications about failing to login, nothing happens when I press the button to open the dashboard, it's as if OF doesn't exist in the game at all. I have spent 4 days repeatedly setting this up, meticulously following the instructions and nothing. I have xcode 4 which seems to have a rather different layout to previous versions which has caused me no end of grief when trying to follow instructions. My latest problem is two fold. When I press Build and Run in Unity it just goes to xcode, it doesn't build the xcode project, which is lucky, because it adds the line '#import "OpenFeintPrefix.pch"' to iPhone_target_Prefix.pch but that gives me a compile error with the framework method and I have to add OpenFeint/ to the front of OpenFeintPrefix.pch. Then I have to build the project (I can find no Build and Run option) and then I have to open the xcode Organizer window, go to applications on my device and add an application. If I have older builds on the phone I have to replace it. I have no idea if this is installing the game (or if that has something to do with the problem) but I can't find a way around it.
     
  11. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    Do a complete new Build from UnityMenu->File->Build (no build and run) to create a brand new project.
    Then, re-do the OpenFeint secondary step to include all the things in the xcode project and you should be ready to go.
     
  12. AdsySingle

    AdsySingle

    Joined:
    Jan 5, 2011
    Posts:
    116
    I have retried this a number of times. I don't know objective c very well, but I'm trying to get my head around what is supposed to be happening. I noticed that the code that sets up OF for my app is in a function called commonInit() in AppController+OpenFeint.mm (this gets generated by the OpenFeint Unity plugin I think). I add a comment at the start of this function and it never gets called.
    Now, I can see that applicationDidFinishLaunching() gets called in AppController.mm which has just two lines, a comment and the line: [self startUnity:application];

    There is a function called applicationDidFinishLaunching() in AppController+OpenFeint.mm that has just a single line:
    [self commonInit:application];
    It seems clear that this one should be being called but it isn't. Am I supposed to delete AppController.mm and rename AppController+OpenFeint.mm to replace it? That doesn't seem right.
     
  13. AdsySingle

    AdsySingle

    Joined:
    Jan 5, 2011
    Posts:
    116
    I finally got the issue sorted and open feint worked on the 3gs we were initially testing on. However when I put the build onto the iphone 4 the game freezes up on the enable openfeint screen. It doens't finish loading, just a white screen with the thing grey borders but that's it. It just hangs there, no errors in xcode that I can see. No idea what is causing this or why the exact same build would work differently on these two phones since they have the same version of iOS on them.
     
  14. Retribution

    Retribution

    Joined:
    Jan 14, 2011
    Posts:
    20
    **EDIT**
    This issue was fixed. Turns out I didn't add the AppController+OpenFeint.mm to the Compile Source. Doing so resolved the issue and OpenFeint now prompts for a login.

    Sorry to bump this back up, but what did you do to get the game running Adsy? If you remember what you did, would you mind sharing it here? I'm in the same boat at the moment as your first post, where OpenFeint will not run, and I have both the AppController.mm and the AppController+OpenFeint.mm in my project.

    I'd like to hear how you managed to fix the issue if you remember.

    Thanks!
     
    Last edited: May 6, 2011
  15. qamarzaman

    qamarzaman

    Joined:
    Jul 1, 2010
    Posts:
    85
    Hi,



    I am having same Issue in my game. Tried every suggestion above but not got my problem solved.
     
  16. AdsySingle

    AdsySingle

    Joined:
    Jan 5, 2011
    Posts:
    116
    Sorry guys, I should have checked back here a little more regularly. It turned out that those two files, AppController+OpenFeint.mm and OpenFeintSettingsDefines.h were only being linked to, they weren't actually being copied into the file structure. So I right click on one of them, click on Reveal in Finder. Copy and paste those two files into the Classes folder in your project. Then select them both in xcode and delete them (select remove references only) then right click on the Classes folder->Add->Existing Files... and select them from the Classes folder on your hard drive. There will be an option at the top of the pop up window asking if you want to make copies of them, make sure in this case it isn't ticked and that is it.

    Alternatively you could not manually copy them into Classes and simply right click on Classes in xcode, Add->Existing Files... select them from the folder that Reveal in Finder showed you and tick the box to make copies (this will copy them into the folder instead of just adding references to them).

    Hope that wasn't too confusing.
     
  17. Harjit

    Harjit

    Joined:
    Sep 25, 2013
    Posts:
    1
    OpenFeint.LaunchDashboard();
     
  18. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,734