@@ -203,11 +203,11 @@ export enum INTRO_ELIGIBILITY_STATUS {
203
203
* PurchaserInfo
204
204
* PurchasesEntitlementInfos
205
205
* PurchasesEntitlementInfo
206
- *
206
+ * PurchasesTransaction
207
207
*/
208
208
@Plugin ( {
209
209
pluginName : 'Purchases' ,
210
- plugin : 'cordova-plugin-purchases@1.2 .0' ,
210
+ plugin : 'cordova-plugin-purchases@1.3 .0' ,
211
211
pluginRef : 'Purchases' , // the variable reference to call the plugin, example: navigator.geolocation
212
212
repo : 'https://github.com/RevenueCat/cordova-plugin-purchases' , // the github repository URL for the plugin
213
213
platforms : [ 'Android' , 'iOS' ] , // Array of platforms supported, example: ['Android', 'iOS']
@@ -259,8 +259,8 @@ export class Purchases extends IonicNativePlugin {
259
259
* @param {boolean } observerMode An optional boolean. Set this to TRUE if you have your own IAP implementation and
260
260
* want to use only RevenueCat's backend. Default is FALSE. If you are on Android and setting this to ON, you will have
261
261
* to acknowledge the purchases yourself.
262
- * @param {string? } userDefaultsSuiteName An optional string. iOS-only, will be ignored for Android.
263
- * Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults
262
+ * @param {string? } userDefaultsSuiteName An optional string. iOS-only, will be ignored for Android.
263
+ * Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults
264
264
* suite, otherwise it will use standardUserDefaults. Default is null, which will make the SDK use standardUserDefaults.
265
265
*/
266
266
@Cordova ( { sync : true } )
@@ -277,6 +277,9 @@ export class Purchases extends IonicNativePlugin {
277
277
278
278
/**
279
279
* Add a dict of attribution information
280
+ *
281
+ * @deprecated Use the set<NetworkId> functions instead.
282
+ *
280
283
* @param {object } data Attribution data from any of the attribution networks in Purchases.ATTRIBUTION_NETWORKS
281
284
* @param {ATTRIBUTION_NETWORK } network Which network, see Purchases.ATTRIBUTION_NETWORK
282
285
* @param {string? } networkUserId An optional unique id for identifying the user. Needs to be a string.
@@ -542,11 +545,11 @@ export class Purchases extends IonicNativePlugin {
542
545
543
546
/**
544
547
* Invalidates the cache for purchaser information.
545
- *
548
+ *
546
549
* Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state.
547
550
* Refer to https://docs.revenuecat.com/docs/purchaserinfo#section-get-user-information for more information on
548
551
* using the cache properly.
549
- *
552
+ *
550
553
* This is useful for cases where purchaser information might have been updated outside of the
551
554
* app, like if a promotional subscription is granted through the RevenueCat dashboard.
552
555
*/
@@ -573,37 +576,137 @@ export class Purchases extends IonicNativePlugin {
573
576
*/
574
577
@Cordova ( { sync : true } )
575
578
setEmail ( email : string | null ) : void { }
579
+
576
580
/**
577
581
* Subscriber attribute associated with the phone number for the user
578
582
*
579
583
* @param phoneNumber Empty String or null will delete the subscriber attribute.
580
584
*/
581
-
582
585
@Cordova ( { sync : true } )
583
586
setPhoneNumber ( phoneNumber : string | null ) : void { }
587
+
584
588
/**
585
589
* Subscriber attribute associated with the display name for the user
586
590
*
587
591
* @param displayName Empty String or null will delete the subscriber attribute.
588
592
*/
589
-
590
593
@Cordova ( { sync : true } )
591
594
setDisplayName ( displayName : string | null ) : void { }
595
+
592
596
/**
593
597
* Subscriber attribute associated with the push token for the user
594
598
*
595
- * @param pushToken null will delete the subscriber attribute.
599
+ * @param pushToken Empty String or null will delete the subscriber attribute.
596
600
*/
597
-
598
601
@Cordova ( { sync : true } )
599
602
setPushToken ( pushToken : string | null ) : void { }
603
+
604
+ /**
605
+ * Subscriber attribute associated with the install media source for the user
606
+ *
607
+ * @param mediaSource Empty String or null will delete the subscriber attribute.
608
+ */
609
+ @Cordova ( { sync : true } )
610
+ setMediaSource ( mediaSource : string | null ) : void { }
611
+
612
+ /**
613
+ * Subscriber attribute associated with the install campaign for the user
614
+ *
615
+ * @param campaign Empty String or null will delete the subscriber attribute.
616
+ */
617
+ @Cordova ( { sync : true } )
618
+ setCampaign ( campaign : string | null ) : void { }
619
+
620
+ /**
621
+ * Subscriber attribute associated with the install ad group for the user
622
+ *
623
+ * @param adGroup Empty String or null will delete the subscriber attribute.
624
+ */
625
+ @Cordova ( { sync : true } )
626
+ setAdGroup ( adGroup : string | null ) : void { }
627
+
628
+ /**
629
+ * Subscriber attribute associated with the install ad for the user
630
+ *
631
+ * @param ad Empty String or null will delete the subscriber attribute.
632
+ */
633
+ @Cordova ( { sync : true } )
634
+ setAd ( ad : string | null ) : void { }
635
+
636
+ /**
637
+ * Subscriber attribute associated with the install keyword for the user
638
+ *
639
+ * @param keyword Empty String or null will delete the subscriber attribute.
640
+ */
641
+ @Cordova ( { sync : true } )
642
+ setKeyword ( keyword : string | null ) : void { }
643
+
644
+ /**
645
+ * Subscriber attribute associated with the install ad creative for the user
646
+ *
647
+ * @param creative Empty String or null will delete the subscriber attribute.
648
+ */
649
+ @Cordova ( { sync : true } )
650
+ setCreative ( creative : string | null ) : void { }
651
+
652
+ /**
653
+ * Subscriber attribute associated with the Adjust Id for the user
654
+ * Required for the RevenueCat Adjust integration
655
+ *
656
+ * @param adjustID Empty String or null will delete the subscriber attribute.
657
+ */
658
+ @Cordova ( { sync : true } )
659
+ setAdjustId ( adjustId : string | null ) : void { }
660
+
661
+ /**
662
+ * Subscriber attribute associated with the AppsFlyer Id for the user
663
+ * Required for the RevenueCat AppsFlyer integration
664
+ * @param appsflyerID Empty String or null will delete the subscriber attribute.
665
+ */
666
+ @Cordova ( { sync : true } )
667
+ setAppsflyerId ( appsflyerId : string | null ) : void { }
668
+
669
+ /**
670
+ * Subscriber attribute associated with the Facebook SDK Anonymous Id for the user
671
+ * Recommended for the RevenueCat Facebook integration
672
+ *
673
+ * @param fbAnonymousID Empty String or null will delete the subscriber attribute.
674
+ */
675
+ @Cordova ( { sync : true } )
676
+ setFbAnonymousId ( fbAnonymousId : string | null ) : void { }
677
+
678
+ /**
679
+ * Subscriber attribute associated with the mParticle Id for the user
680
+ * Recommended for the RevenueCat mParticle integration
681
+ *
682
+ * @param mparticleID Empty String or null will delete the subscriber attribute.
683
+ */
684
+ @Cordova ( { sync : true } )
685
+ setMparticleId ( mparticleId : string | null ) : void { }
686
+
687
+ /**
688
+ * Subscriber attribute associated with the OneSignal Player Id for the user
689
+ * Required for the RevenueCat OneSignal integration
690
+ *
691
+ * @param onesignalID Empty String or null will delete the subscriber attribute.
692
+ */
693
+ @Cordova ( { sync : true } )
694
+ setOnesignalId ( onesignalId : string | null ) : void { }
695
+
696
+ /**
697
+ * Automatically collect subscriber attributes associated with the device identifiers.
698
+ * $idfa, $idfv, $ip on iOS
699
+ * $gpsAdId, $androidId, $ip on Android
700
+ */
701
+ @Cordova ( { sync : true } )
702
+ collectDeviceIdentifiers ( ) : void { }
703
+
600
704
/**
601
705
* Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value from your RevenueCat contact.
602
706
* @param url Proxy URL as a string.
603
707
*/
604
708
@Cordova ( { sync : true } )
605
709
setProxyURL ( url : string ) : void { }
606
-
607
710
}
608
711
609
712
/**
@@ -708,6 +811,11 @@ export interface PurchaserInfo {
708
811
* Set of purchased skus, active and inactive
709
812
*/
710
813
readonly allPurchasedProductIdentifiers : [ string ] ;
814
+ /**
815
+ * Returns all the non-subscription purchases a user has made.
816
+ * The purchases are ordered by purchase date in ascending order.
817
+ */
818
+ readonly nonSubscriptionTransactions : [ PurchasesTransaction ] ;
711
819
/**
712
820
* The latest expiration date of all purchased skus
713
821
*/
@@ -756,6 +864,21 @@ export interface PurchaserInfo {
756
864
readonly managementURL : string | null ;
757
865
}
758
866
867
+ export interface PurchasesTransaction {
868
+ /**
869
+ * RevenueCat Id associated to the transaction.
870
+ */
871
+ readonly revenueCatId : string ;
872
+ /**
873
+ * Product Id associated with the transaction.
874
+ */
875
+ readonly productId : string ;
876
+ /**
877
+ * Purchase date of the transaction in ISO 8601 format.
878
+ */
879
+ readonly purchaseDate : string ;
880
+ }
881
+
759
882
export interface PurchasesProduct {
760
883
/**
761
884
* Product Id.
0 commit comments