Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * This function assumes logger is an instance of AppEventsLogger and has been
- * created using AppEventsLogger.newLogger() call.
- */
- public void logPurchasedEvent (int numItems, String contentType, String contentId, String currency, double price) {
- Bundle params = new Bundle();
- params.putInt(AppEventsConstants.EVENT_PARAM_NUM_ITEMS, numItems); //Number of items. Integer.
- params.putString(AppEventsConstants.EVENT_PARAM_CONTENT_TYPE, contentType); //'product' or 'product_group'. String.
- params.putString(AppEventsConstants.EVENT_PARAM_CONTENT_ID, contentId); //product identifier. String.
- params.putString(AppEventsConstants.EVENT_PARAM_CURRENCY, currency); //ISO 4217 code, e.g., "EUR", "RSD"..string.
- logger.logPurchase(price, Currency.getInstance(currency),params);
- }
Advertisement
Add Comment
Please, Sign In to add comment