Skip to content

Commit b5f7f95

Browse files
authored
feat(purchases): update to plugin version 1.3.0 (#3547)
1 parent 5d1b5d5 commit b5f7f95

File tree

1 file changed

+134
-11
lines changed
  • src/@ionic-native/plugins/purchases

1 file changed

+134
-11
lines changed

src/@ionic-native/plugins/purchases/index.ts

Lines changed: 134 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,11 @@ export enum INTRO_ELIGIBILITY_STATUS {
203203
* PurchaserInfo
204204
* PurchasesEntitlementInfos
205205
* PurchasesEntitlementInfo
206-
*
206+
* PurchasesTransaction
207207
*/
208208
@Plugin({
209209
pluginName: 'Purchases',
210-
plugin: 'cordova-plugin-purchases@1.2.0',
210+
plugin: 'cordova-plugin-purchases@1.3.0',
211211
pluginRef: 'Purchases', // the variable reference to call the plugin, example: navigator.geolocation
212212
repo: 'https://github.com/RevenueCat/cordova-plugin-purchases', // the github repository URL for the plugin
213213
platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS']
@@ -259,8 +259,8 @@ export class Purchases extends IonicNativePlugin {
259259
* @param {boolean} observerMode An optional boolean. Set this to TRUE if you have your own IAP implementation and
260260
* want to use only RevenueCat's backend. Default is FALSE. If you are on Android and setting this to ON, you will have
261261
* 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
264264
* suite, otherwise it will use standardUserDefaults. Default is null, which will make the SDK use standardUserDefaults.
265265
*/
266266
@Cordova({ sync: true })
@@ -277,6 +277,9 @@ export class Purchases extends IonicNativePlugin {
277277

278278
/**
279279
* Add a dict of attribution information
280+
*
281+
* @deprecated Use the set<NetworkId> functions instead.
282+
*
280283
* @param {object} data Attribution data from any of the attribution networks in Purchases.ATTRIBUTION_NETWORKS
281284
* @param {ATTRIBUTION_NETWORK} network Which network, see Purchases.ATTRIBUTION_NETWORK
282285
* @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 {
542545

543546
/**
544547
* Invalidates the cache for purchaser information.
545-
*
548+
*
546549
* Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state.
547550
* Refer to https://docs.revenuecat.com/docs/purchaserinfo#section-get-user-information for more information on
548551
* using the cache properly.
549-
*
552+
*
550553
* This is useful for cases where purchaser information might have been updated outside of the
551554
* app, like if a promotional subscription is granted through the RevenueCat dashboard.
552555
*/
@@ -573,37 +576,137 @@ export class Purchases extends IonicNativePlugin {
573576
*/
574577
@Cordova({ sync: true })
575578
setEmail(email: string | null): void {}
579+
576580
/**
577581
* Subscriber attribute associated with the phone number for the user
578582
*
579583
* @param phoneNumber Empty String or null will delete the subscriber attribute.
580584
*/
581-
582585
@Cordova({ sync: true })
583586
setPhoneNumber(phoneNumber: string | null): void {}
587+
584588
/**
585589
* Subscriber attribute associated with the display name for the user
586590
*
587591
* @param displayName Empty String or null will delete the subscriber attribute.
588592
*/
589-
590593
@Cordova({ sync: true })
591594
setDisplayName(displayName: string | null): void {}
595+
592596
/**
593597
* Subscriber attribute associated with the push token for the user
594598
*
595-
* @param pushToken null will delete the subscriber attribute.
599+
* @param pushToken Empty String or null will delete the subscriber attribute.
596600
*/
597-
598601
@Cordova({ sync: true })
599602
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+
600704
/**
601705
* Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value from your RevenueCat contact.
602706
* @param url Proxy URL as a string.
603707
*/
604708
@Cordova({ sync: true })
605709
setProxyURL(url: string): void {}
606-
607710
}
608711

609712
/**
@@ -708,6 +811,11 @@ export interface PurchaserInfo {
708811
* Set of purchased skus, active and inactive
709812
*/
710813
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];
711819
/**
712820
* The latest expiration date of all purchased skus
713821
*/
@@ -756,6 +864,21 @@ export interface PurchaserInfo {
756864
readonly managementURL: string | null;
757865
}
758866

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+
759882
export interface PurchasesProduct {
760883
/**
761884
* Product Id.

0 commit comments

Comments
 (0)