Skip to content

promotions

Francisco Dias edited this page Aug 15, 2024 · 3 revisions

Promotions

This is the Apple IAP Promotions module, which allows you to promote in-app purchases.

Apple IAP Object: https://developer.apple.com/documentation/storekit/skproductstorepromotioncontroller?language=objc

For more information on promoting in-app purchases, see:

https://developer.apple.com/documentation/storekit/skpaymenttransactionobserver/promoting_in-app_purchases?language=objc

Functions

These are the module's functions:

Constants

These are the module's constants:



Back To Top

iap_Promotion_Order_Fetch

Apple IAP Function: fetchStorePromotionOrderWithCompletionHandler

This function reads the product order override that determines the promoted product order on this device.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the In-App Purchase Async Event.


Syntax:

iap_Promotion_Order_Fetch()



Returns:

N/A


Triggers:

In-App Purchase Async Event

Key Type Description
id iap_promotion_event_id The constant value iap_promotion_order_fetch.
success Boolean Whether the fetch succeeded or not.
products String A JSON string containing information on the products.



Back To Top

iap_Promotion_Order_Update

Apple IAP Function: updateStorePromotionOrder:completionHandler:

This function overrides the promoted product order on this device.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the In-App Purchase Async Event.


Syntax:

iap_Promotion_Order_Update(products)
Argument Type Description
products String A JSON-encoded string of an array of IAP identifiers.



Returns:

N/A


Triggers:

In-App Purchase Async Event

Key Type Description
id iap_promotion_event_id The constant value iap_promotion_order_update.
success Boolean Whether the update was successful or not.



Back To Top

iap_Promotion_Visibility_Fetch

Apple IAP Function: fetchStorePromotionVisibilityForProduct:completionHandler:

This function reads the visibility setting of a promoted product in the App Store for this device.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the In-App Purchase Async Event.


Syntax:

iap_Promotion_Visibility_Fetch(product)
Argument Type Description
product String The product identifier for which to get the visibility.



Returns:

N/A


Triggers:

In-App Purchase Async Event

Key Type Description
id iap_promotion_event_id The constant value iap_promotion_visibility_fetch.
product String The product identifier.
success Boolean Whether the fetch was successful or not.
visibility iap_promotion_visibility The visibility of the product.



Back To Top

iap_Promotion_Visibility_Update

Apple IAP Function: updateStorePromotionVisibility:forProduct:completionHandler:

This function updates the visibility of the product on the App Store, per device.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the In-App Purchase Async Event.


Syntax:

iap_Promotion_Visibility_Update(product, visibility)
Argument Type Description
product iap_promotion_event_id The IAP identifier of the product.
visibility iap_promotion_visibility The visibility of the product.



Returns:

N/A


Triggers:

In-App Purchase Async Event

Key Type Description
id iap_promotion_event_id The constant value iap_promotion_visibility_update.
success Boolean Whether the fetch was successful or not.



Back To Top

iap_promotion_event_id

This constant represents an async event ID (or type) related to IAP promotions.

These constants are referenced by the following functions:


Member Description
iap_promotion_purchase This event ID indicates a response to a promotion purchase.
iap_promotion_order_fetch This event ID indicates a response to an order fetch.
iap_promotion_order_update This event ID indicates a response to an order update.
iap_promotion_visibility_fetch This event ID indicates a response to a fetch of visibility settings.
iap_promotion_visibility_update This event ID indicates a response to an update of visibility settings.


Back To Top

iap_promotion_visibility

This constant represents the possibilities for promotion visibility.

These constants are referenced by the following functions:


Member Description
iap_promotion_visibility_default Use the default promotion visibility.
iap_promotion_visibility_show Show promotions.
iap_promotion_visibility_hide Hide promotions.