Skip to main content

bfgGameReporting Class

#import <bfgGameReporting.h>

Class Methods

(void) + logLevelStart:
 
(void) + logLevelFinished:
 
(void) + reportUserAcquisitionEvent:additionalDetails:
 
(BOOL) + logCustomEvent:value:level:details1:details2:details3:additionalDetails:
 
(BOOL) + logCustomEvent:data:
 
(void) + logCustomPlacement:
 
(void) + setPlacementDelegate:
 
(void) + setSuppressPlacement:
 
(void) + dismissVisiblePlacement
 
(void) + setDeepLinkListener:
 
(void) + logRewardedVideoSeenWithProvider:videoLocation:
 
(void) + logRewardedVideoSeenWithProvider:
 
(void) + setPlayerSpend:
 Optional game specific data (LTV) that can be added to Zendesk tickets. This value must be a float. More...
 
(float) + playerSpend
 Getter for the playerSpend value. More...
 
(void) + setLastLevelPlayed:
 Optional level name to be added to Zendesk tickets. More...
 
(NSString *_Nullable) + lastLevelPlayed
 Getter for the lastLevelPlayed value. More...
 
(void) + setCustomData:
 
(NSDictionary< NSNumber *, NSString * > *_Nullable) + getCustomData
 

Detailed Description

Required game logging APIs.This class is used for reporting all game events.

Method Documentation

◆ dismissVisiblePlacement

+ (void) dismissVisiblePlacement
If a placement is showing, it is automatically and instantly dismissed. If no placement is showing, does nothing.
Since
5.10

◆ getCustomData

+ (NSDictionary< NSNumber *, NSString * > *_Nullable) getCustomData
Gets the custom data (provided using the setCustomData method) that gets added to each Zendesk request.
Returns
The custom data dictionary or null if not set.
Since
6.9.1

◆ lastLevelPlayed

+ (NSString *_Nullable) lastLevelPlayed
Getter for the lastLevelPlayed value.
Returns
The values currently stored in lastLevelPlayed. This will either be the last value the game set, using setLastLevelPlayed, or nil.
Since
6.5

◆ logCustomEvent:data:

+ (BOOL) logCustomEvent: (NSString *_Nonnull) name
data:(NSDictionary *_Nonnull) data 
Log a custom event to Big Fish Mobile Telemetry Services.
Note
When the Big Fish Mobile Telemetry Services backend rejects a custom event, a bfgReporting.BFG_NOTIFICATION_EVENT_LOGGED notification is raised containing details. For example, when a custom event exceeds the maximum size.
Parameters
nameRequired string used for the event name. Cannot be nil. Pass in "" (empty string) if necessary.
dataDictionary containing any additional data pertaining to the event. Sent as JSON.
Returns
Return values
YESif the custom event was added to the event queue.
NOif otherwise.

◆ logCustomEvent:value:level:details1:details2:details3:additionalDetails:

+ (BOOL) logCustomEvent: (NSString *_Nonnull) name
value:(NSInteger) value
level:(NSInteger) level
details1:(NSString *_Nullable) details1
details2:(NSString *_Nullable) details2
details3:(NSString *_Nullable) details3
additionalDetails:("Deprecated since iOS SDK 7.0") __deprecated_msg 
Log a custom event to Big Fish Mobile Telemetry Services.
Note
Please be aware that while the event name is no longer required by the Mobile Telemetry Services the logic in this method has not been updated to reflect that change yet. Therefore, the name parameter is still required to be a non nil value or else the event will not be sent. Other nil fields will not prevent the event from being sent.
Parameters
nameRequired string used for the event name. Cannot be nil. Pass in "" (empty string) if necessary.
valueOptional arbitrary integer value you want associated with the event.
levelOptional integer value between 0 and 255 associated with the current game level.
details1Optional string data, max size is 32 characters. Required if using details2.
details2Optional string data, max size is 32 characters. Required if using details3.
details3Optional string data, max size is 32 characters.
additionalDetailsOptional dictionary containing any additional data pertaining to the event. Sent as JSON.
Returns
Return values
YESif the custom event was added to the event queue.
NOif otherwise.

◆ logCustomPlacement:

+ (void) logCustomPlacement: (NSString *_Nonnull) placementName
logCustomPlacement logs a custom placement.
Parameters
placementNameThe name of the custom placement that has occurred.

◆ logLevelFinished:

+ (void) logLevelFinished: ("Deprecated since iOS SDK 7.0") __deprecated_msg
Called each time a level is finished.
Deprecated:\n Deprecated since iOS SDK 7.0

◆ logLevelStart:

+ (void) logLevelStart: ("Deprecated since iOS SDK 7.0") __deprecated_msg
Called each time a level has started.
Deprecated:\n Deprecated since iOS SDK 7.0

◆ logRewardedVideoSeenWithProvider:

+ (void) logRewardedVideoSeenWithProvider: (NSString *_Nullable) provider
Calling this method will report that a rewarded video has been fully watched.
Parameters
providerThe name of the ad provider, example "vungle".
Since
6.1

◆ logRewardedVideoSeenWithProvider:videoLocation:

+ (void) logRewardedVideoSeenWithProvider:(NSString *_Nullable) provider
videoLocation:(NSString *_Nullable) videoLocation 
Calling this method will report that a rewarded video has been fully watched.
Parameters
providerThe name of the ad provider, example "vungle".
videoLocationLocation in the game where the user tapped to view the video, example "in-game-store".
Since
6.1

◆ playerSpend

+ (float) playerSpend
Getter for the playerSpend value.
Returns
The value currently stored in playerSpend. This will either be the last value the game set, using setPlayerSpend, or nil.
Since
6.5

◆ reportUserAcquisitionEvent:additionalDetails:

+ (void) reportUserAcquisitionEvent: (NSString *_Nonnull) eventName
additionalDetails:(NSDictionary *_Nullable) eventDetailsDictionary 
Call this method to report an event to our User Acquisition provider
Since
7.2.1
Parameters
eventNameRequired string used for the event name. Cannot be nil
eventDetailsDictionaryOptional dictionary containing contextual infomation for the event

◆ setCustomData:

+ (void) setCustomData: (NSDictionary< NSNumber *, NSString * > *_Nullable) customData
Set custom data fields to be added to all Zendesk requests. Each field is defined using a Zendesk-specific ID number and a string value. The string values should be consistently formatted for display, depending on data type, as follows:
  • text: Text strings can be formattted as the developer thinks appropriate or as otherwise specified.
  • Numeric: The numeric value can consist of only integers. Commas and other separators are not allowed.
  • Decimal: Floating point values. Commas and other seperators (other than the decimal point) are not allowed.
  • Boolean: "true" or "false"
  • Date: ISO 8601 date format string, such as YYYY-MM-DD (2018-12-06).
  • DropDown: String that matches the tag for the corresponding value. For example, sdk_vip_# such as "sdk_vip_11" for VIP 11.
To remove the custom fields pass nil into this method.
Parameters
customDataA collection of ID/Value pairs to provide to Zendesk as extra, game-specific data. The IDs are defined in Zendesk, specifically by each game that requires them and uniquely identifies the corresponding value. For example, an ID/Value pair of 123456789 and "123.45" could be used to specify the total recent purchase amount as $123.45, and give a corresponding custom field with an id of 123456789.
Since
6.9.1

◆ setDeepLinkListener:

+ (void) setDeepLinkListener: (id< bfgDeepLinkListener > _Nonnull) listener
Set this before initializing bfgManager to receive notifications if you received a deep link.
Parameters
listenerThe listener is informed when deep links succeed or fail.
Since
6.9.1

◆ setLastLevelPlayed:

+ (void) setLastLevelPlayed: (NSString *_Nullable) lastLevelPlayed
Optional level name to be added to Zendesk tickets.
Parameters
lastLevelPlayedThe last level played by the user to be reported to Zendesk.
Since
6.5

◆ setPlacementDelegate:

+ (void) setPlacementDelegate: (id< bfgPlacementDelegate > _Nonnull) delegate
Placements will make calls to their delegate in addition to posting notifications. If you prefer using delegation to NSNotifications, implement the delegate calls and set your delegate here.
Parameters
delegateAn implementer of bfgPlacementDelegate
Since
5.7

◆ setPlayerSpend:

+ (void) setPlayerSpend: (float) playerSpend
Optional game specific data (LTV) that can be added to Zendesk tickets. This value must be a float.
Parameters
playerSpendThe value of the user's current spend to be reported to Zendesk.
Since
6.5

◆ setSuppressPlacement:

+ (void) setSuppressPlacement: (BOOL) suppressPlacements
If it would be inappropriate for a placement ad to appear over the game in the moment, set suppressPlacements to YES. As soon as it is all right to show placements again, be sure to set it back to NO.
Since
5.10