@@ -1205,6 +1205,40 @@ class FirebaseAnalytics extends FirebasePluginPlatform {
12051205 );
12061206 }
12071207
1208+ /// Logs the standard `in_app_purchase` event.
1209+ ///
1210+ /// This event signifies that an item(s) was purchased by a user.
1211+ ///
1212+ /// This API supports manually logging in-app purchase events on iOS and Android.
1213+ /// This is especially useful in cases where purchases happen outside the native
1214+ /// billing systems (e.g. custom payment flows).
1215+ Future <void > logInAppPurchase ({
1216+ String ? currency,
1217+ bool ? freeTrial,
1218+ double ? price,
1219+ bool ? priceIsDiscounted,
1220+ String ? productID,
1221+ String ? productName,
1222+ int ? quantity,
1223+ bool ? subscription,
1224+ num ? value,
1225+ }) {
1226+ return _delegate.logEvent (
1227+ name: 'in_app_purchase' ,
1228+ parameters: filterOutNulls (< String , Object ? > {
1229+ _CURRENCY : currency,
1230+ _FREE_TRIAL : freeTrial,
1231+ _PRICE : price,
1232+ _PRICE_IS_DISCOUNTED : priceIsDiscounted,
1233+ _PRODUCT_ID : productID,
1234+ _PRODUCT_NAME : productName,
1235+ _QUANTITY : quantity,
1236+ _SUBSCRIPTION : subscription,
1237+ _VALUE : value,
1238+ }),
1239+ );
1240+ }
1241+
12081242 /// Sets the duration of inactivity that terminates the current session.
12091243 ///
12101244 /// The default value is 1800000 milliseconds (30 minutes).
@@ -1547,3 +1581,24 @@ const String _PROMOTION_ID = 'promotion_id';
15471581
15481582/// The name of a product promotion
15491583const String _PROMOTION_NAME = 'promotion_name' ;
1584+
1585+ /// Whether the purchase is a free trial
1586+ const String _FREE_TRIAL = 'free_trial' ;
1587+
1588+ /// The price of the item
1589+ const String _PRICE = 'price' ;
1590+
1591+ /// Whether the price is discounted
1592+ const String _PRICE_IS_DISCOUNTED = 'price_is_discounted' ;
1593+
1594+ /// The ID of the product
1595+ const String _PRODUCT_ID = 'product_id' ;
1596+
1597+ /// The name of the product
1598+ const String _PRODUCT_NAME = 'product_name' ;
1599+
1600+ /// The quantity of the product
1601+ const String _QUANTITY = 'quantity' ;
1602+
1603+ /// Whether the purchase is a subscription
1604+ const String _SUBSCRIPTION = 'subscription' ;
0 commit comments