iOS
Android
Unity
REST Api
BDArenaConnector

Availability : ver 1.0 and later

Declared in : BDArenaConnector.h

Sample code : -

Overview

The BDArenaConnector class is the main interface for accessing the Arena Daemon multiplayer, chat, advertising and user's authentication features.

 

BDArenaConnector declares methods for performing actions and for retrieving user's status and information.

The BDArenaConnector class has two properties :

 

playConnector (class BDArenaPlayConnector)
chatConnector (class BDArenaChatConnector

 

through which developer can implement the multiplayer and chat functionalities provided by the SDK.

 

The BDArenaConnector object is a singleton and has only one instance in the application.

 

In order to initialize the BDArenaConnector object, the developer must call the class method

initializeWithAppKey:runInSandboxEnvironment: in application:didFinishLaunchingWithOptions:

 

- (BOOL)application:(UIApplication *)application 

        didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

    // Override point for customization after application launch. 

    [BDArenaConnector initializeWithAppKey:@"YOUR_APP_KEY" runInSandboxEnvironment:YES]; 

    [[BDArenaConnector getInstance] registerEventsObserver:self];

    [[BDArenaConnector getInstance] requestAuth];

    ...

    [self.window makeKeyAndVisible];

    return YES;

Properties

taskInProgress

 

Specifies the task in progress during the management of a user profile.

 

@property (readonly, assign) ARENA_TASK taskInProgress;

 

Discussion

taskInProgress is set to :

 

ARENA_TASK_IDLE if no activity is in progress.

ARENA_TASK_AUTH if authentication routine is in progress.

ARENA_TASK_UPDATE if user's profile information update is in progress.

ARENA_TASK_REGISTER if user's profile registration is in progress.

ARENA_TASK_LOGOUT if user performs logout.

ARENA_TASK_LOGIN if user performs login.

ARENA_TASK_GET_PLAYER_INFO if getDataForPlayerWithAuid: is called.

ARENA_TASK_GET_PLAYERS_INFO if getDataForPlayersWithAuids: is called.

 

Refer to ARENA_TASK for type definition.

 
Availability

available in SDK ver 1.0 and later.

 

 

 

appKey

 

Stores the appKey parameter.

 

@property (readonly, assign) NSString* appKey;

 

Discussion

The appKey is set through the class method initializeWithAppKey:runInSandboxEnvironment: and cannot be modified at runtime. This parameter is uniquely associated with an application.

The AppKey must be generated through Arena Daemon web panel by creating a new application.

 

Availability

available in SDK ver 1.0 an later.

 

 

 

isOffline

 

Informs about the Internet connection status.

 

@property (readonly, assign) BOOL isOffline;

 

Discussion

If this property is YES, the application runs in offline mode. The local player, anyway, is recognized as authenticated and/or logged in but any action of profile management is disabled.

 

Availability

available in SDK ver 1.0 and later.

 

 

 

runInSandbox

 

Specifies if the application is running in sandbox environment or not.

 

@property (nonatomicreadonlyBOOL runInSandbox;

 

Discussion

If this property is YES, the application runs in a parallel and specular environment intended for development purposes.

No action about earning points or achievements is actually registered though every call to leaderboards and achievements methods will return success.

 

Availability

available in SDK ver 1.0 and later.

 

 

 

forceAutoretryIfAuthFails

 

Tells the SDK to retry authentication in background until the user will be successfully authenticated.

 

@property (nonatomicassignBOOL forceAutoretryIfAuthFails;

 

Discussion

After the SDK initialization, the devolper should immediately call requestAuth class method in order to authenticate local user to Arena Daemon platform. None of the multiplayer, chat or advertising features will be enabled until the local user authentication.

 

Availability

available in SDK ver 1.0 and later.

 

 

 

showNotificationPanel

 

Specifies if the notification panel needs to be shown or not.

 

@property (nonatomic, assign) BOOL showNotificationPanel;

 

Discussion

The notification panel

 

notification_panel.jpg 

 

notifies events triggered by the SDK after user successful authentication, profile management, achievements earned and such other similar activities.

Setting this property to NO, the developer disables the native notification behaviour of the SDK, achieving the possibility to implement his custom way for events notification.

 

 

 

playConnector

 

Is the main, unique instance of the multiplayer connector module.

 

@property (nonatomic, readonly) BDArenaPlayConnector* playConnector;

 

Discussion

The playConnector object is a singleton initialized by BDArenaConnector class and lets developer access all the multiplayer features provided by the SDK.

 

Availability

available in SDK ver 1.0 and later.

 

 

 

chatConnector

 

Is the main, unique instance of the chat connector module.

 

@property (nonatomic, readonly) BDArenaChatConnector* chatConnector;

 

Discussion

The chatConnector object is a singleton initialized by BDArenaConnector class and lets developer access all the chat features provided by the SDK.

 

Availability

available in SDK ver 1.0 and later.

 

 

 

leaderboardsConnector

 

Is the main, unique instance of the leaderboards connector module.

 

@property (nonatomic, readonly) BDArenaLeaderboards* leaderboardsConnector;

 

Discussion

The leaderboardsConnector object is initialized by BDArenaConnector class and lets developer access all the leaderboards features provided by the SDK.

 

Availability

available in SDK ver 1.0 and later.

 

 

 

achievementsConnector

 

Is the main, unique instance of the achievements connector module.

 

@property (nonatomic, readonly) BDArenaAchievements* achievementsConnector;

 

Discussion

The achievementsConnector object is initialized by BDArenaConnector class and lets developer access all the achievements features provided by the SDK.

 

Availability

available in SDK ver 1.0 and later.

Methods

Class methods

+ getInstance

+ hasInstance

+ initializeWithAppKey:runInSandboxEnvironment:

 

Events observation

- registerEventsObserver:

- unregisterEventsObserver:

 

Actions on local player

requestAuth

- isLocalPlayerAuthenticated

- isLocalPlayerRegistered

- getAccessToken

- getLocalPlayerData

- getDataForPlayerWithAuid:

- getDataForPlayersWithAuids:

 

Advertising module management

- advBannerStartRotation

- advBannerStopRotation

- advEnableRotationForBannerFormat:

- advDisableRotationForBannerFormat:

- advIsBannerRotationActive

- advGetBannerViewForAdFormat:

- advGetFullscreenSmartphoneBannerView

- advGetFullscreenTabletBannerView

- advRequestBannerWithFormat:

- advRequestBannerInView:withFormat:

- advRequestSmartphoneFullscreenBanner

- advRequestTabletFullscreenBanner

- advRequestAdClipInView:withPresentingController:

- advRequestAdClipInView:withPresentingController:withConfiguration:

- advPlayAdClipInView:

- advRequestGhostOverAd

- advPlayGhostOverAd

 

Push Notifications

- registerDeviceForPushNotifications:

 

 


  

 

 

getInstance

 

Returns the unique instance of BDArenaConnector object

 

+ (BDArenaConnector*) getInstance;

 

Return value

The unique BDArenaConnector instance.

 

Discussion

Before calling getInstance, the developer needs to call initializeWithAppKey:runInSandbox in order to create the unique instance of the BDArenaConnector object. If getInstance is called before the initialization, it will return nil.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaConnector.h

 

 

 

hasInstance

 

Checks the existence of a BDArenaConnector object instance.

 

+ (BOOL) hasInstance;

 

Return value

YES if a valid instance of BDArenaConnector exists or NO if it does not. 

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaConnector.h

 

 

 

initializeWithAppKey:runInSandboxEnvironment

 

The initialization method of BDArenaConnector class.

 

+ (BDArenaConnector*) initializeWithAppKey:(NSString*)_appKey

        runInSandboxEnvironment:(BOOL)_runInSandbox;

 

Return value

The unique instance of the BDArenaConnector object.

 

Discussion

The runInSandboxEnvironment: specifies if the application needs to be executed

in the development environment. If developer is working on a new version of his application,

this parameter should be set to YES in order to access the specular environment avoiding

data sharing with the live version of the same application.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaConnector.h

 

 

 

registerEventsObserver:

 

Registers observer as receiver of events notification.

 

- (void) registerEventsObserver:(id)observer;

 

Parameters

observer

    the object that will receive events notification.

 

Discussion

The SDK can register more than one observer. An observer could be a UIViewController, a UIView,

NSObject subclass or any other object that implements BDArenaConnectorDelegate protocol.

If an object is erroneously registered more than once, the SDK takes care to exclude multiple

registrations storing only the first registration request.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaConnector.h  

 

 

 

unregisterEventsObserver:

 

Unregisters observer as receiver of events notification.

 

- (void) unregisterEventsObserver:(id)observer;

 

Parameters

observer

    Object to remove from the notification events table.

 

Availability

available in SDK ver 1.0 and later

 

Declared in 

BDArenaConnector.h 

 

 

 

requestAuth:

 

Requests for local player authentication.

 

- (void) requestAuth;

 

Discussion

In order to access multiplayer, chat and advertising features, the local player

needs to be authenticated first. The developer MUST perform player authentication

BEFORE trying to connect to other services otherwise any other call will fail.

After calling requestAuth, arenaConnector:authReceivedForLocalPlayerWithData:alreadyMet:isOffline: and arenaConnector:authFailedForLocalPlayerWithError: of BDArenaConnectorDelegate,

it will inform about operation results.

 

Availability

available in SDK ver 1.0 and later

 

Declared in 

BDArenaConnector.h

 

 

 

isLocalPlayerAuthenticated

 

Returns the local player authentication status.

 

- (BOOL) isLocalPlayerAuthenticated;

 

Return value

YES if local player is authenticated. NO otherwise.

 

Availability

available in SDK ver 1.0 and later

 

Declared in 

BDArenaConnector.h 

 

 

 

isLocalPlayerRegistered

 

Returns the local player authentication status.

 

- (BOOL) isLocalPlayerRegistered;

 

Return value

YES if local player is a registered player. NO if local player is Guest.

 

Discussion

An authenticated player can be registered (if personal information such as nickname,

age and gender had been provided) or Guest. The SDK puts no limitation in both cases :

every feature of Arena Daemon is accessible by everyone. Anyway, the developer is free

to implement his own application logic in order to lock some functionality for Guest players.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in 

BDArenaConnector.h

 

 

 

getAccessToken

 

Returns the local player's access token.

 

- (NSString*) getAccessToken;

 

Return value

The access token associated with the local player after a successful authentication.

If local player is not authenticated yet, it returns nil.

 

Discussion

After a successfully user authentication in Arena Daemon through the requestAuth call,

a unique access token is returned to the application getting developer peforming other services calls.

The access token is stored and used internally by the SDK for subsequent requests performing.

The developer can retrieve the access token any time using this method without any concern.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in 

BDArenaConnector.h 

 

 

 

getLocalPlayerData

 

Returns the local player's information. 

 

- (BDArenaPlayerData*) getLocalPlayerData;

 

Return value 

A BDArenaPlayerData object filled with local player's information.  

 

Availability 

available in SDK ver 1.0 and later 

 

Declared in 

BDArenaConnector.h

 

 

 

getDataForPlayerWithAuid

 

Requests for information about a specific player.

 

- (void) getDataForPlayerWithAuid:(NSInteger)auid;

 

Parameters

auid

    The Arena daemon Unique Id (auid) of the requested player.

 

Discussion

The results of this operation can be handled implementing arenaConnector:getPlayerDataFailedWithError: and arenaConnector:getPlayerDataSuccessfullyCompleted: protocol methods of BDArenaConnectorDelegate.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in

BDArenaConnector.h

 

 

 

getDataForPlayersWithAuids

 

Requests for information about a group of players.

 

- (void) getDataForPlayersWithAuids:(NSArray*)auids; 

 

Parameters

auids 

    An array with Arena daemon Unique Ids (auid) of the requested players.

 

Discussion 

The results of this operation can be handled implementing arenaConnector:getPlayersDataFailedWithError: 

and arenaConnector:getPlayersDataSuccessfullyCompletedWithArray: 

protocol methods of BDArenaConnectorDelegate.

 

Availability 

available in SDK ver 1.0 and later 

 

Declared in 

BDArenaConnector.h

 

 

 

advBannerStartRotation

 

Enables automatic banner refresh.

 

- (void) advBannerStartRotation;

 

Discussion

This method enables automatic refresh of banners provided by the SDK.

Banner are available in the following formats : 320x53, 300x250, 468x60, 728x90.

When developer enables banner rotation, banner format has also to be specified.

This can be achieved through the advEnableRotationForBannerFormat: 

and advDisableRotationForBannerFormat: methods.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in 

BDArenaConnector.h

 

 

 

advBannerStopRotation

 

Disables automatic banner refresh.

 

- (void) advBannerStopRotation; 

 

Availability 

available in SDK ver 1.0 and later 

 

Declared in

BDArenaConnector.h

 

 

 

advIsBannerRotationActive

 

Requests for automatic banner refresh status.

 

- (BOOL) advIsBannerRotationActive;

 

Return value

YES if automatic banner refresh is enabled. NO otherwise.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in

BDArenaConnector.h

 

 

 

advEnableRotationForBannerFormat:

 

Sets a specific banner format for automatic refresh.

 

- (void) advEnableRotationForBannerFormat:(BDArenaAdvBannerFormat)bannerformat;

 

Parameters

bannerFormat

    One of the available banner formats.

    Refer to Constants and types for the complete banner formats list.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in

BDArenaConnector.h

 

 

  

advDisableRotationForBannerFormat:

 

Removes a specific banner format from automatic refresh.

 

- (void) advDisableRotationForBannerFormat:(BDArenaAdvBannerFormat)bannerformat;

 

Parameters

bannerFormat

    One of the available banner formats.

    Refer to Constants and types for the complete banner formats list.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in

BDArenaConnector.h

 

 

 

advGetBannerViewForAdFormat:

 

Gets banner's container view for a specific banner format.

 

- (UIView*) advGetBannerViewForAdFormat:(BDArenaAdvBannerFormat)bannerFormat;

 

Return value

The container view associated with specified banner format.

 

Parameters

bannerFormat

    One of the available banner formats.

    Refer to Constants and types for the complete banner formats list.

 

Discussion

The container views associated with banner formats are managed by the SDK.

There is only one container view for each banner format.

The developer can get one of these views and add them as subviews of any parent view.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in

BDArenaConnector.h

 

 

advGetFullscreenSmartphoneBannerView

 

Gets banner's container view for fullscreen smartphone format.

 

- (UIView*) advGetFullscreenSmartphoneBannerView;

 

Return value

The container view associated with fullscreen smartphone banner format.

 

Discussion

The container views associated with banner formats are managed by the SDK.

There is only one container view for the fullscreen smartphone banner format.

The developer can get one of these views and add them as subviews of any parent view.

The size of the ad is always 320x480 px and supports only portrait orientation.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in

BDArenaConnector.h

 

 

 

advGetFullscreenTabletBannerView

 

Gets banner's container view for fullscreen tablet format.

 

- (UIView*) advGetFullscreenTabletBannerView;

 

Return value

The container view associated with fullscreen tablet banner format.

 

Discussion

The container views associated with banner formats are managed by the SDK.

There is only one container view for the fullscreen tablet banner format.

The developer can get one of these views and add them as subviews of any parent view.

The size of the ad is always 1024x748 px and supports only landscape orientation.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in

BDArenaConnector.h

 

 

 

advRequestBannerWithFormat:

 

Triggers banner refresh action for a specific banner format.

 

- (void) advRequestBannerWithFormat:(BDArenaAdvBannerFormat)bannerFormat;

 

Parameters

bannerFormat

    One of the available banner formats.

    Refer to Constants and types for the complete banner formats list.

 

Discussion

When calling this method, automatic banner refresh should be disabled for targeted banner format.

To achieve that, use the advDisableRotationForBannerFormat: method.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in

BDArenaConnector.h

 

 

 

advRequestBannerInView:withFormat:

 

Loads a banner and places it in a specific, owned by the developer, UIView.

 

- (void) advRequestBannerInView:(UIView*)bannerView

        withFormat:(BDArenaAdvBannerFormat)bannerFormat;

 

Parameters

bannerView

    An UIView owned by the developer in which the SDK will load the ad banner

bannerFormat

    One of the available banner formats.

    Refer to Constants and types for the complete banner formats list.

 

Discussion

This method can be used when the developer needs to have the complete control

over a banner view.

Through this call, several banners within the same UIView can be displayed.

Ad banners retrieved through this method will not refresh automatically.

 

Availability

available in SDK ver 1.8 and later 

 

Declared in

BDArenaConnector.h

 

 

 

advRequestSmartphoneFullscreenBanner

 

Loads a smartphone fullscreen banner.

 

- (void) advRequestSmartphoneFullscreenBanner;

 

Discussion

The size of the ad is always 320x480 px and supports only portrait orientation.

 

Availability

available in SDK ver 1.0 and later 

 

Declared in

BDArenaConnector.h

 

 

 

advRequestTabletFullscreenBanner

 

Loads a tablet fullscreen banner.

 

- (void) advRequestTabletFullscreenBanner;

 

Discussion

The size of the ad is always 1024x748 px and supports only landscape orientation.

 

Availability

available in SDK ver 1.0 and later

 

Declared in

BDArenaConnector.h

 

 

 

 

advRequestAdClipInView:withPresentingController:

 

Requests an ad clip and places it within a specific UIView.

 

- (void) advRequestAdClipInView:(UIView*)clipContainerView 

        withPresentingController:(UIViewController*)presentingController;

 

Parameters

clipContainerView

    An UIView initialized by the developer.

presentingController

    The UIViewController (or a subclass) that will be used by the app to show 

    the click-through alert.

 

Discussion

Within an UIViewController, the clipContainerView can be a particular existing subview

of the UIViewController's view or the main UIViewController's view itself.

The presentingController object is used internally by the SDK to show the click-through alert

(UIAlertView if iOS < 8.0, UIAlertController otherwise) that pops up when the user

taps the ad video view during playback.

 

Availability

available in SDK ver 2.8.6 and later

 

Declared in

BDArenaConnector.h

 

 

 

advRequestAdClipInView:withPresentingController:withConfiguration:

 

Requests an ad clip and places it within a specific UIView.

 

- (void) advRequestAdClipInView:(UIView*)clipContainerView

        withPresentingController:(UIViewController*)presentingController

        withConfiguration:(BDArenaAdClipConfigData*)config;

 

Parameters

clipContainerView

    An UIView initialized by the developer.

presentingController

    The UIViewController (or a subclass) that will be used by the app to show

    the click-through alert.

config

    An BDArenaAdClipConfigData object that contains the customization parameters for

    the current ad clip appearance.

 

Discussion

Within an UIViewController, the clipContainerView can be a particular existing subview

of the UIViewController's view or the main UIViewController's view itself.

The presentingController object is used internally by the SDK to show the click-through alert

(UIAlertView if iOS < 8.0, UIAlertController otherwise) that pops up when the user

taps the ad video view during playback.

 

Availability

available in SDK ver 2.8.6 and later

 

Declared in

BDArenaConnector.h

 

 

 

advPlayAdClipInView:

 

Starts playback of a retrieved ad clip.

 

- (void) advPlayAdClipInView:(UIView*)clipContainerView; 

 

Parameters

clipContainerView

    The UIView that brings the ad clip.

 

Discussion

This method should be called only when the arenaConnector:clipReadyToPlayInView: 

protocol method of BDArenaConnectorDelegate is called by the SDK.

 

Availability

available in SDK ver 1.7 and later

 

Declared in

BDArenaConnector.h

 

 

 

advRequestGhostOverAd

 

Requests an ad of type GhostOver.

 

- (void) advRequestGhostoverAd; 

 

Recommendation

Please, read the WARNING note here before implementing GhostOver ads. 

 

Availability

available in SDK ver 4.0.0 and later

 

Declared in

BDArenaConnector.h

 

 

 

 

advPlayGhostOverAd

 

Starts playback of a retrieved GhostOver ad.

 

- (BOOL) advPlayGhostOverAd;

 

Discussion

before invoking this method , a viable advertising must have been obtained.

In order to obtain an GhostOver ad, invoke the method advRequestGhostoverAd.

 

Recommendation

Please, read the WARNING note here before implementing GhostOver ads. 

 

Availability

available in SDK ver 4.0.0 and later

 

Declared in

BDArenaConnector.h

 

 

 

registerDeviceForPushNotifications:

 

Register the device to the ArenaDaemon's Push Notification Service.

 

- (void) registerDeviceForPushNotifications:(NSData*)deviceToken;

 

Parameters

deviceToken

    The NSData object passed as parameter of the AppDelegate's

    application:didRegisterForRemoteNotificationsWithDeviceToken: method.

 

Discussion

This method MUST be called as soon as the application enters

the application:didRegisterForRemoteNotificationsWithDeviceToken: method.

 

Availability

available in SDK ver 3.2 and later

 

Declared in

BDArenaConnector.h