Search code examples
cocos2d-iphonenextpeer

Nextpeer Remove welcome banner : Delegate method not fired


I tried to remove nextpeer welcome notification at game start.

Here is my code in .h

@interface AppDelegate : NSObject <UIApplicationDelegate,NextpeerDelegate,NPTournamentDelegate,NPNotificationDelegate,..>

//in AppDelegate.m

- (void)initializeNextpeer
{
    NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:

                              // This game has no retina support - therefore we have to let the platform know
                              [NSNumber numberWithBool:TRUE], NextpeerSettingGameSupportsRetina,
                              // Support orientation change for the dashboard notifications
                              [NSNumber numberWithBool:FALSE], NextpeerSettingSupportsDashboardRotation,
                              // Support orientation change for the in game notifications
                              [NSNumber numberWithBool:TRUE], NextpeerSettingObserveNotificationOrientationChange,
                              //  Place the in game notifications on the bottom screen (so the current score will be visible)
                              [NSNumber numberWithInt:NPNotificationPosition_BOTTOM], NextpeerSettingNotificationPosition,
                              nil];



    [Nextpeer initializeWithProductKey:@"HERE ADDED GAME KEY" andSettings:settings andDelegates:
     [NPDelegatesContainer containerWithNextpeerDelegate:self notificationDelegate:[NPCocosNotifications sharedManager] tournamentDelegate:self]];


}
- (BOOL)nextpeerShouldShowWelcomeBanner {
    return NO; // Do not Show banner
}

Nextpeer working great. Only this function is not fired. What's wrong?


Solution

  • nextpeerShouldShowWelcomeBanner is a method on the NPNotificationDelegate, not on NextpeerDelegate. In your code sample, the notification delegate is [NPCocosNotifications sharedManager]. So you should move the method to that object, or set a different notification delegate.