Follow

Integrating the Apmetrix tvOS (Xcode) SDK

 

Table of Contents:

Apmetrix tvOS Integration

Apmetrix tvOS SDK Functions

Integrating the Apmetrix tvOS (Xcode) SDK

The following simple steps explain how to integrate our tvOS SDK into your game or other Apple TV application.

STEP 1 – Add the ApmetrixTV/ApmetrixTVWithIDFA framework file to your tvOS project.

Download the Apmetrix tvOS SDK from the Support Page and unarchive it into your project’s folder. In Xcode, right click on your project’s name in the Project Explorer pane and select “Add Files to “<your project’s name>”. If your application does not include ad functionality select the ApmetrixTV.framework and click “Add”.  If your application includes ad functionality select the ApmetrixTVWithIDFA.framework and click "Add".  The illustration below is an example of adding the ApmetrixTV.framework.

STEP 2 – Link ApmetrixTV framework to your tvOS project.

Double check to make sure the SDK framework that you added in step 1 is linked with your target. Click on your project’s name in the left hand column of Xcode, select your target then select the Build Phases tab in the middle of the screen. Under the Link Binary With Libraries section you should see the framework that you added in step 1.  The following figure shows what you should see if you added the ApmetrixTV.framework.  If not, click on the + sign and add the framework appropriate for your application (either ApmetrixTV.framework or ApmetrixTVWithIDFA.framework).



STEP 3 – Interface with the Apmetrix SDK in your code.

In the project App Delegate or anywhere else where you need to use the Apmetrix API functions, use the following import statement (depending on the version of the framework you added in step 1 and 2 above.  The following figure illustrates the import statement for the ApmetrixTV.framework:

import ApmetrixTV
or
import ApmetrixTVWithIDFA

That’s it! You’re now collecting all of the key device and session data. At this point you have successfully completed the integration of the ApmetrixTV SDK framework. You can now set up and call the various functions you need to the Apmetrix analytics platform.

tvOS Functions

All SDK functions are class methods for the Apmetrix class.

1. INITIALIZE SESSION – Initialize (i.e. start an app session) using either of the following functions.

To start an app session using default permissions use:

Function: Apmetrix.initWithDataSet(appDataset:Int, appVersion:String, appUnifier:String)

To start an app session using one or more of the pre-defined permissions use:

Function: Apmetrix.initWithDataSet(appDataset:Int, appVersion:String, appUnifier:String, permissions:Int)

where:

 appDataSet

This number identifies the dataset used for the app data.

Note: The dataset ID is sent to you when a new account has been registered or a new game has been added to your company. You will need to pass in this ID before any data can be collected.

 appVersion

String that identifies the version of the application.

 appUnifier

String which when combined with the appDataset identifies a unique app.

 permissions

Optional parameter that when used defines the permissions/restrictions on the application.

This parameter is an Int type where multiple permissions can be set by "ORing" their values together. If the initWithDataSet method used does not contain the permissions argument then the SDK defaults to NO_GEO_LOOKUP.

and where optional values for permissions are:

Apmetrix.NO_GEO_LOOKUP

Prevents the device from accessing longitude/latitude information. If this permission is set the user will not be queried whether they want to allow your application to use their current location. This is the default permission/restriction should the "initWithDataset: appVersion: appUnifier:" method be called.

Apmetrix.NO_IP_LOOKUP

Prevents the device from determining its IP Address and also prevents the server from looking up information based on a user's IP address.

Apmetrix.NO_AD_ID

Prevents the Universal Device ID from defining the user. If set the user ID is defined instead by a timestamp and random number.

Apmetrix.USE_GEO_LOOKUP

Allows the device to access longitude/latitude information. Even if this parameter is set the user will still be queried whether they want to allow your application to use their current location. If you want this permission set you may need to prompt the user to accept the prompt for using their current location.

Apmetrix.CHILD_SAFE

A shortcut permission option for the highest COPPA compliance. See the document "Children's Online Privacy Protection Act" for further information.

Apmetrix.ALLOW_IDFA

Allows the device to lookup and send to the server the device's "identifier for advertisers". By default the IDFA is NOT looked up and sent to the server so this flag should be set if the application is going to be displaying any advertising. The "identifier for advertisers" is needed for ad tracking so advertisers can know when a user has clicked on their advertisement.

Note: the actual lookup of the "identifier for advertisers" is done and only possible with the version of the tvOS SDK that includes IDFA code (ApmetrixTVWithIDFA.framework).

Apmetrix.NO_IDFA

Prevents the device from looking up and sending the device's "identifier for advertisers" to the server. This flag is set by default for the version of the tvOS SDK that include IDFA code (ApmetrixTVWithIDFA.framework). The "identifier for advertisers" is needed for ad tracking so advertisers can know when a user has clicked on their advertisement.

Note: If your application does not include ad functionality it is recommended to NOT use the version of the tvOS SDK that includes IDFA code (ApmetrixTVWithIDFA.framework). Instead use ApmetrixTV.framework. Applications that include IDFA code when they don't include ad functionality risk being rejected when they are submitted to the App Store for review.

Note: The appDataset and appUnifier can be found in the dashboard under Tasks->Administration->Accounts and expanding Datasets, then select your Dataset.

These methods returns an “Int” value to indicate the resulting status of the function call and will equal one of the following:

(0) Apmetrix.SUCCESS

Successful operation.

(101) Apmetrix.WARNING_IGNORED_SESSION_ALREADY_OPEN

Function call was ignored because a session was already open.

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the parameters passed were incorrect.

(203) Apmetrix.ERROR_EVENT_DROPPED

Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

2. RESTART_SESSION - To restart a new session or the same session use the following command.  Note that the same session is restarted if the following function is called without previously ending the session:

Function: Apmetrix.restartSession()

This method returns an “Int” value to indicate the resulting status of the function call and will equal one of the following:

(0) Apmetrix.SUCCESS

Successful operation.

(102) Apmetrix.WARNING_IGNORED_SESSION_NOT_INITIALIZED

Function call was ignored because a session had not been initialized with a call to initWithDataset().

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

(203) Apmetrix.ERROR_EVENT_DROPPED

Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

3. LOG CUSTOM EVENT - To log custom event data or dimensions use any of the following functions:

Function: Apmetrix.logEvent(table:Apmetrix.tTable, dimensions:String?...)

or

Function: Apmetrix.logEvent(table:Apmetrix.tTable, dimensions:[String?])

or

Function: Apmetrix.logEvent(eventName:String, eventData:[String:String?])

where:

 table

Predefined value for the type of the event (see values below).

 dimensions

Either variable length comma delimited list or array of custom event dimensions.

 eventName

Name of the event to be logged.

 eventData

Event data to be logged (as JSON key/value pairs).

and where predefined values for tables are:

 Apmetrix.tTable.OTHER

Any event that cannot be put into any of the other predefined tables

 Apmetrix.tTable.ACTIONS

Any event that is triggered by the user (e.g. clicks on account settings, opens level map, completes level, completes registration, etc.).

 Apmetrix.tTable.APPS

Any event triggered by the app (e.g. app creates a local notification, app goes into the background, app comes into the foreground, etc.)

 Apmetrix.tTable.FTUE

Any event that is a first time user event (e.g. first time visits website, first time purchase, first time launches app, etc.).

 Apmetrix.tTable.ENGAGE

Any event that is related to engagement (e.g. shares a post, invites a friend, logins into Facebook/Twitter/etc., sends a gift, etc.).

For further information on Log Event functionality see the document "Log Event Functionality Breakdown".

These logEvent() methods return an “Int” value to indicate the resulting status of the function call and will equal one of the following:

(0) Apmetrix.SUCCESS

Successful operation.

(102) Apmetrix.WARNING_IGNORED_SESSION_NOT_INITIALIZED

Function call was ignored because a session had not been initialized with a call to initWithDataset().

(103) Apmetrix.WARNING_IGNORED_SESSION_NOT_OPEN

Function call was ignored because there was not an open session to log event data to.

(104) Apmetrix.WARNING_IGNORED_SOME_EVENT_PARAMETERS

Function call was ignored because there were too many input parameters.

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

(203) Apmetrix.ERROR_EVENT_DROPPED

 Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

4. LOG ONE TIME CUSTOM EVENT - To log one time event call one of the following functions:

Function: Apmetrix.logOneTimeEvent(table:Apmetrix.tTable, tag:String, dimensions:String?...)

or

Function: Apmetrix.logOneTimeEvent(table:Apmetrix.tTable, tag:String, dimensions:[String?])

where:

 table

Predefined value for the type of the event (see values below)

 tag

Identifier for this one-time event.

 dimensions

Either variable length comma delimited list or array of custom event dimensions.

and where predefined values for tables are.

Apmetrix.tTable.OTHER

Any event that cannot be put into any of the other predefined tables

Apmetrix.tTable.ACTIONS

Any event that is triggered by the user (e.g. clicks on account settings, opens level map, completes level, completes registration, etc.).

Apmetrix.tTable.APPS

Any event triggered by the app (e.g. app creates a local notification, app goes into the background, app comes into the foreground, etc.)

Apmetrix.tTable.FTUE

Any event that is a first time user event (e.g. first time visits website, first time purchase, first time launches app, etc.).

Apmetrix.tTrack.ENGAGE

Any event that is related to engagement (e.g. shares a post, invites a friend, logins into Facebook/Twitter/etc., sends a gift, etc.).

For further information on Log Event functionality see the document "Log Event Functionality Breakdown".

These logOneTimeEvent() methods return an “Int” value to indicate the resulting status of the function call and will equal one of the following:

(0) Apmetrix.SUCCESS

Successful operation.

(102) Apmetrix.WARNING_IGNORED_SESSION_NOT_INITIALIZED

Function call was ignored because a session had not been initialized with a call to initWithDataset().

(103) Apmetrix.WARNING_IGNORED_SESSION_NOT_OPEN

Function call was ignored because there was not an open session to log event data to.

(104) Apmetrix.WARNING_IGNORED_SOME_EVENT_PARAMETERS

Function call was ignored because there were too many input parameters.

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

(203) Apmetrix.ERROR_EVENT_DROPPED

Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

5. SEND URL REQUEST - Call this function to send a custom URL request.

Function: Apmetrix.sendRequest(requestData:[String:String])

where:

requestData

Dictionary of url key value pairs.

This sendRequest() method returns an “Int” value to indicate the resulting status of the function call and will equal one of the following:

(0) Apmetrix.SUCCESS

Successful operation.

(102) Apmetrix.WARNING_IGNORED_SESSION_NOT_INITIALIZED

Function call was ignored because a session had not been initialized with a call to initWithDataset().

(103) Apmetrix.WARNING_IGNORED_SESSION_NOT_OPEN

Function call was ignored because there was not an open session to log event data to.

(104) Apmetrix.WARNING_IGNORED_SOME_EVENT_PARAMETERS

Function call was ignored because there were too many input parameters.

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

(203) Apmetrix.ERROR_EVENT_DROPPED

Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

6. IN APPLICATION PURCHASES -

To log a purchase made with real currency (as opposed to virtual currency). Depending on how you want the converted cost to be generated:

Use the following function when you want the converted cost to be generated based on:

  • The users IP address (to determine local currency)
  • Your country’s currency (the country you specified when you created an account with Apmetrix)
Function: Apmetrix.inApPurchase(quantity:Int, item:String, location:String, itemCost:Float)

Use the following function when you want the converted cost to be based on:

  • The local and converted currencies you provide
Function: Apmetrix.inApPurchase(quantity:Int, item:String, location:String, itemCost:Float, localCurrency:String, convertedCurrency:String)

where:

quantity

Identifies the quantity of the items purchased.

item

Identifies the item(s) that were purchased.

location

Identifies where within the application the item(s) were purchased.

itemCost

Identifies the cost that the user purchased the item(s) for.

localCurrency

Identifies the currency that the user purchased the item(s) with. It is suggested to use the setProductId() API method to set the country code that is obtained from the SKProduct. Refer to the document "Using the in-App Purchase Function to Track Individual User Revenues" for information on these pre-defined values and further information.

convertedCurrency

Identifies the currency that the local cost will be converted to. It is suggested to use the pre-defined values for converted currency to avoid errors when exchange rate is generated. Refer to the document "Using the in-App Purchase Function to Track Individual User Revenues" for information on these pre-defined values and further information.

These inApPurchase() methods return an “Int” value to indicate the resulting status of the function call and will equal one of the following:

(0) Apmetrix.SUCCESS

Successful operation.

(102) Apmetrix.WARNING_IGNORED_SESSION_NOT_INITIALIZED

Function call was ignored because a session had not been initialized with a call to initWithDataset().

(103) Apmetrix.WARNING_IGNORED_SESSION_NOT_OPEN

Function call was ignored because there was not an open session to log event data to.

(104) Apmetrix.WARNING_IGNORED_SOME_EVENT_PARAMETERS

Function call was ignored because there were too many input parameters.

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

(203) Apmetrix.ERROR_EVENT_DROPPED

Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

7. VIRTUAL CURRENCY TRANSACTION TRACKING – To track the flow of virtual in-game currency call one of the following functions.

Function: Apmetrix.virtualCurrency(transaction:String, location:String, currencyAmounts:String?...)

or

Function: Apmetrix.virtualCurrency(transaction:String, location:String, currencyAmounts:[String?])

where:

transaction

Identifies the transaction that was made.

location

Identifies where within the application the transaction took place.

currencyAmounts

Either a variable length list or array of currency amounts for this transaction. Up to 3 different denominations can be specified but denominations must be kept in the same order each time this function is called. If the currency amounts for a transaction do not include a previously used denomination, then a “0” must be used for that denomination.

These virtualCurrency() methods return an “Int” value to indicate the resulting status of the function call and will equal one of the following:

(0) Apmetrix.SUCCESS

Successful operation.

(102) Apmetrix.WARNING_IGNORED_SESSION_NOT_INITIALIZED

Function call was ignored because a session had not been initialized with a call to initWithDataset().

(103) Apmetrix.WARNING_IGNORED_SESSION_NOT_OPEN

Function call was ignored because there was not an open session to log event data to.

(104) Apmetrix.WARNING_IGNORED_SOME_EVENT_PARAMETERS

Function call was ignored because there were too many input parameters.

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

(203) Apmetrix.ERROR_EVENT_DROPPED

Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

8. VIRTUAL ITEM TRANSACTION TRACKING – To track the flow of virtual in-game items and virtual in-game currency use one of the following functions:

Function: Apmetrix.virtualItem(transaction:String, quantity:Int, type:String, location:String, currencyAmounts:String?...)

or

Function: Apmetrix.virtualItem(transaction:String, quantity:Int, type:String, location:String, currencyAmounts:[String?])

where

transaction

Identifies the transaction that was made.

quantity

Identifies the amount of items involved in the transaction.

type

Identifies the type of item(s) involved in the transaction.

location

Identifies where within the application the transaction took place.

currencyAmounts

Either a variable length list or array of currency amounts for this transaction. Up to 3 different denominations can be specified but denominations must be kept in the same order each time this function is called. If the currency amounts for a transaction do not include a previously used denomination then a “0” must be used for that denomination.

 

These virtualItem() methods return an “Int” value to indicate the resulting status of the function call and will equal one of the following:

 

(0) Apmetrix.SUCCESS

Successful operation.

(102) Apmetrix.WARNING_IGNORED_SESSION_NOT_INITIALIZED

Function call was ignored because a session had not been initialized with a call to initWithDataset(). 

(103) Apmetrix.WARNING_IGNORED_SESSION_NOT_OPEN

Function call was ignored because a session was not open to log event data.

(104) Apmetrix.WARNING_IGNORED_SOME_EVENT_PARAMETERS

Function call was ignored because there were too many input parameters.

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

9. OFFER TRACKING - To track offers presented to the user, accepted by the user or declined by the user use the following function:

Function: Apmetrix.offer(transaction:Apmetrix.tOffer, offer:String, location:String)

where

transaction

A predefined value that identifies whether the offer was presented to the user, accepted by the user or declined by the user (see values below).

offer

Identifies the actual offer presented, accepted or declined.

location

Identifies where within the application the offer was presented, accepted or declined.

 

and where predefined values for transaction are.

 

Apmetrix.tOffer.PRESENTED

For offers that are presented.

Apmetrix.tOffer.ACCEPTED

For offers that are accepted.

Apmetrix.tOffer.DECLINED

For offers that are declined.

 

This offer() method returns an “Int” value to indicate the resulting status of the function call and will equal one of the following:

 

(0) Apmetrix.SUCCESS

Successful operation. 

(102) Apmetrix.WARNING_IGNORED_SESSION_NOT_INITIALIZED

Function call was ignored because a session had not been initialized with a call to initWithDataset().

(103) Apmetrix.WARNING_IGNORED_SESSION_NOT_OPEN

Function call was ignored because a session was not open to log event data.

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

(203) Apmetrix.ERROR_EVENT_DROPPED

Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

10. START EVENT TIMER - To start an event specific timer use the following function:

Function: Apmetrix.startTimerForEvent(event:String)

where

event

Identifies the event the timer is being started for.

 

This startTimerForEvent() method returns an “Int” value to indicate the resulting status of the function call and will equal one of the following:

 

(0) Apmetrix.SUCCESS

Successful operation. 

(102) Apmetrix.WARNING_IGNORED_SESSION_NOT_INITIALIZED

Function call was ignored because a session had not been initialized with a call to initWithDataset().

(103) Apmetrix.WARNING_IGNORED_SESSION_NOT_OPEN

Function call was ignored because a session was not open to log event data.

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

(203) Apmetrix.ERROR_EVENT_DROPPED

Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

11. STOP EVENT TIMER - To stop an event specific timer that has previously been started use the following function:

 

Function: Apmetrix.stopTimerForEvent(event:String)

 

where

event

Identifies the event the timer is being stopped for. This value must match the parameter used when the timer was started otherwise the function will be ignored.

 

This stopTimerForEvent() method returns an “Int” value to indicate the resulting status of the function call and will equal one of the following:

 

(0) Apmetrix.SUCCESS

Successful operation.

(102) Apmetrix.WARNING_IGNORED_SESSION_NOT_INITIALIZED

Function call was ignored because a session had not been initialized with a call to initWithDataset().

(103) Apmetrix.WARNING_IGNORED_SESSION_NOT_OPEN

Function call was ignored because a session was not open to log event data.

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

(203) Apmetrix.ERROR_EVENT_DROPPED

Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

12. PAUSE EVENT TIMERS - To pause all event timers when your application is in background use the following function:

Function: Apmetrix.appDidEnterBackground()

Note: It is suggested this function be called from your application delegate’s applicationDidEnterBackground() method. Failure to call this method, or calling it from the wrong app delegate method may result in incorrect timer durations being logged for your events.

13. RESUME EVENT TIMERS – To resume all event timers that were paused when your application was in background use the following function:

Function: Apmetrix.appWillEnterForeground()

Note: It is suggested that this function be called from your application delegate’s applicationWillEnterForeground() method. Failure to call this method, or calling it from the wrong app delegate method may result in incorrect timer durations being logged for your events.

14. START PLAYER LEVEL - To track how much time a player spent on a particular level use the following function:

Function: Apmetrix.startLevel(levelName:String)

 

Example:

Call when the game is launched for the very first time.

Apmetrix.startLevel(“Level 1”)

Call when the player levels up.

Apmetrix.startLevel(“Level 2”)

 

This startLevel() method returns an “Int” value to indicate the resulting status of the function call and will equal one of the following:

(0) Apmetrix.SUCCESS

Successful operation.

(103) Apmetrix.WARNING_IGNORED_SESSION_NOT_OPEN

Function call was ignored because there was not an open session to log event data to.

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

(203) Apmetrix.ERROR_EVENT_DROPPED

Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

15. SET CUSTOMER ID - Use this function to track a customer ID so it can be correlated with the rest of the data being tracked on this device for this user. This method is useful for applications where the user can be identified via a logon ID or user ID, thus allowing the rest of the data tracked to be correlated on a per user basis. To set a customer ID call:

Function: Apmetrix.setCustomerId(customerId:String)

where

customerId

Identifies the user playing the game or logged onto the app.

Note: If setting the customer ID with this function it MUST be done prior to initializing the session with the call to initWithDataset()  

Example:

The following is an example that demonstrates use of the setCustomerId() function where “Number 1 Fan” is the ID the customer is identified by:

Apmetrix.setCustomerId(“Number 1 Fan”)

(0) Apmetrix.SUCCESS

Successful operation.

(204) Apmetrix.ERROR_FAILED

Operation failed because this API method must be called before the session is first initialized.

16. SET PRODUCT ID – Call this function to set the interval SDK information regarding App Store locale. This product ID is used in conjunction with In App Purchases to correctly set the player’s local currency.

Function: Apmetrix.setProductId(productId:String) 

where

productId

The product identifier for the in-App Purchase item(s).

Note: If setting the product ID with this function it MUST be done prior to initializing the session with the call to initWithDataset() 

Example

Called when the game is launched for the very first time.

Apmetrix.setProductId(“com.apmerix.test.RedSword”)

17. END SESSION – To end a session use the following command:

Function: Apmetrix.endSession()

 

This method returns an “Int” value to indicate the resulting status of the function call and will equal one of the following:

 

(0) Apmetrix.SUCCESS

Successful operation.

(103) Apmetrix.WARNING_IGNORED_SESSION_NOT_OPEN

Function call was ignored because there was not an open session to end (or close).

(201) Apmetrix.ERROR_INVALID_ARGUMENTS

Operation could not be completed because the original call to initWithDataset() had an invalid dataset or unifier.

(203) Apmetrix.ERROR_EVENT_DROPPED

Operation could not be completed due to a server error causing internal buffers to reach their maximum capacity. Check the log files for information on the specific error.

(204) Apmetrix.ERROR_FAILED

Operation could not be completed because of some other error. Check the log files for information on the specific error.

Have more questions? Submit a request