Package 

Class CfLogPromoEvent.Builder


  • 
    public final class CfLogPromoEvent.Builder
    
                        

    CfLogPromoEvent is to log the events associated of the promo lists and promo items and when they are clicked on.

    • Method Detail

      • setPromoId

         final <ERROR CLASS> setPromoId(String promo_id)

        setPromoId is required to set the Id of the promo

      • setPromoAction

         final <ERROR CLASS> setPromoAction(PromoAction promo_action)

        setPromoAction is required to set the action for the promo

      • setPromoTitle

         final <ERROR CLASS> setPromoTitle(String promo_title)

        setPromoTitle is required to set the title of the promo (if any)

      • setPromoType

         final <ERROR CLASS> setPromoType(PromoType promo_type)

        setPromoType is required to set the type of the promo

      • addItem

         final <ERROR CLASS> addItem(PromoItemObject itemModel)

        addItem can be used to add the item promo is being applied to. This log can be used to add one item to the log at a time. Promo item should be in a valid format. With elements of the orderObject as: PromoItemObject(itemID, type)

      • addItem

         final <ERROR CLASS> addItem(String itemJsonString)

        setItem can be used to pass the whole item as a Json String object as well. You can use the POJO ItemModel to parse the data int he required format and pass that to this function as a string to log the event. You can use Gson to convert the object to string but SDK will parse the Json string back to POJO so pass it in the log. This method should be used with caution and is suitable for react native bridge.

      • addItemList

         final <ERROR CLASS> )>addItemList(<ERROR CLASS><PromoItemObject> itemList)

        addItemList can be used to add the whole list to the log at once, the format should be ArrayList<PromoItemObject> to log the event successfully. Order item should be in a valid format. With elements as: PromoItemObject(itemID, type)

      • addItemList

         final <ERROR CLASS> addItemList(String itemListString)

        addItemList can be used to add the whole list to the log at once, the format should be ArrayList<PromoItemObject> to log the event successfully. But the input param is of type string , this is special use case for react native logs where list can be passed as Json string and can be used to log the event. Order item should be in a valid format. With elements of the orderObject as: PromoItemObject(itemID, type)

      • setMeta

         final <ERROR CLASS> setMeta(Object meta)

        You can pass any type of value in setMeta. It is for developer and partners to log additional information with the log that they find would be helpful for logging and providing more context to the log. Default value for the meta is null.

      • updateImmediately

         final <ERROR CLASS> updateImmediately(Boolean update_immediately)

        updateImmediately is responsible for updating the values ot the backend immediately. By default this is set to false or whatever the developer has set in the SDK initialisation block. This differs the time for which the logs will be logged, if true, the SDK will log the content instantly and if false it will wait till the end of user session which is whenever the app goes into background.

      • build

         final <ERROR CLASS> build()

        build will validate all of the values provided and if passes will call the track function and queue the events based on it's updateImmediately value and also on the user's network resources.