Skip to content

Commit

Permalink
Release: 4.4.0 (#375)
Browse files Browse the repository at this point in the history
* added method to set airship channel id

* added test

* bumped version number and added changelog

* updated PR number in changelog

* updated the docstrings to indicate that an empty string will delete the subscriber attribute
  • Loading branch information
aboedo authored Nov 8, 2021
1 parent ab8e217 commit e719249
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 19 deletions.
7 changes: 2 additions & 5 deletions CHANGELOG.latest.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
- Patch around BillingClient bug resulting in multiple responses from querySkuDetailsAsync and queryPurchaseHistoryAsync
https://github.com/RevenueCat/purchases-android/pull/369
- Update test dependencies, Gradle plugin and buildToolsVersion
https://github.com/RevenueCat/purchases-android/pull/363
https://github.com/RevenueCat/purchases-android/pull/365
- Added support for Airship integration via `setAirshipChannelID`
https://github.com/RevenueCat/purchases-android/pull/375
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 4.4.0

- Added support for Airship integration via `setAirshipChannelID`
https://github.com/RevenueCat/purchases-android/pull/375

## 4.3.3

- Patch around BillingClient bug resulting in multiple responses from querySkuDetailsAsync and queryPurchaseHistoryAsync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ object Config {

var debugLogsEnabled = false

const val frameworkVersion = "4.3.3"
const val frameworkVersion = "4.4.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum class ReservedSubscriberAttribute(val value: String) {
FB_ANON_ID("\$fbAnonId"),
MPARTICLE_ID("\$mparticleId"),
ONESIGNAL_ID("\$onesignalId"),
AIRSHIP_CHANNEL_ID("\$airshipChannelId"),

/**
* Optional campaign parameters
Expand Down Expand Up @@ -60,6 +61,7 @@ sealed class SubscriberAttributeKey(val backendKey: String) {
object Facebook : AttributionIds(ReservedSubscriberAttribute.FB_ANON_ID)
object Mparticle : AttributionIds(ReservedSubscriberAttribute.MPARTICLE_ID)
object OneSignal : AttributionIds(ReservedSubscriberAttribute.ONESIGNAL_ID)
object Airship : AttributionIds(ReservedSubscriberAttribute.AIRSHIP_CHANNEL_ID)
}

sealed class CampaignParameters(
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GROUP=com.revenuecat.purchases

VERSION_NAME=4.3.3
VERSION_NAME=4.4.0

POM_DESCRIPTION=Mobile subscriptions in hours, not months.
POM_URL=https://github.com/RevenueCat/purchases-android
Expand Down
2 changes: 1 addition & 1 deletion library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
minSdkVersion minVersion
targetSdkVersion compileVersion
versionCode 1
versionName "4.3.3"
versionName "4.4.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
38 changes: 27 additions & 11 deletions purchases/src/main/kotlin/com/revenuecat/purchases/Purchases.kt
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ class Purchases @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) intern
* Subscriber attribute associated with the Adjust Id for the user
* Required for the RevenueCat Adjust integration
*
* @param adjustID null will delete the subscriber attribute
* @param adjustID null or an empty string will delete the subscriber attribute
*/
fun setAdjustID(adjustID: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("setAdjustID"))
Expand All @@ -986,7 +986,7 @@ class Purchases @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) intern
* Subscriber attribute associated with the AppsFlyer Id for the user
* Required for the RevenueCat AppsFlyer integration
*
* @param appsflyerID null will delete the subscriber attribute
* @param appsflyerID null or an empty string will delete the subscriber attribute
*/
fun setAppsflyerID(appsflyerID: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("setAppsflyerID"))
Expand All @@ -1002,7 +1002,7 @@ class Purchases @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) intern
* Subscriber attribute associated with the Facebook SDK Anonymous Id for the user
* Recommended for the RevenueCat Facebook integration
*
* @param fbAnonymousID null will delete the subscriber attribute
* @param fbAnonymousID null or an empty string will delete the subscriber attribute
*/
fun setFBAnonymousID(fbAnonymousID: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("setFBAnonymousID"))
Expand All @@ -1018,7 +1018,7 @@ class Purchases @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) intern
* Subscriber attribute associated with the mParticle Id for the user
* Recommended for the RevenueCat mParticle integration
*
* @param mparticleID null will delete the subscriber attribute
* @param mparticleID null or an empty string will delete the subscriber attribute
*/
fun setMparticleID(mparticleID: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("setMparticleID"))
Expand All @@ -1034,7 +1034,7 @@ class Purchases @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) intern
* Subscriber attribute associated with the OneSignal Player Id for the user
* Required for the RevenueCat OneSignal integration
*
* @param onesignalID null will delete the subscriber attribute
* @param onesignalID null or an empty string will delete the subscriber attribute
*/
fun setOnesignalID(onesignalID: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("setOnesignalID"))
Expand All @@ -1046,13 +1046,29 @@ class Purchases @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) intern
)
}

/**
* Subscriber attribute associated with the Airship Channel ID
* Required for the RevenueCat Airship integration
*
* @param airshipChannelID null or an empty string will delete the subscriber attribute
*/
fun setAirshipChannelID(airshipChannelID: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("setAirshipChannelID"))
subscriberAttributesManager.setAttributionID(
SubscriberAttributeKey.AttributionIds.Airship,
airshipChannelID,
appUserID,
application
)
}

// endregion
// region Campaign parameters

/**
* Subscriber attribute associated with the install media source for the user
*
* @param mediaSource null will delete the subscriber attribute.
* @param mediaSource null or an empty string will delete the subscriber attribute.
*/
fun setMediaSource(mediaSource: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("setMediaSource"))
Expand All @@ -1066,7 +1082,7 @@ class Purchases @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) intern
/**
* Subscriber attribute associated with the install campaign for the user
*
* @param campaign null will delete the subscriber attribute.
* @param campaign null or an empty string will delete the subscriber attribute.
*/
fun setCampaign(campaign: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("setCampaign"))
Expand All @@ -1080,7 +1096,7 @@ class Purchases @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) intern
/**
* Subscriber attribute associated with the install ad group for the user
*
* @param adGroup null will delete the subscriber attribute.
* @param adGroup null or an empty string will delete the subscriber attribute.
*/
fun setAdGroup(adGroup: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("setAdGroup"))
Expand All @@ -1094,7 +1110,7 @@ class Purchases @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) intern
/**
* Subscriber attribute associated with the install ad for the user
*
* @param ad null will delete the subscriber attribute.
* @param ad null or an empty string will delete the subscriber attribute.
*/
fun setAd(ad: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("setAd"))
Expand All @@ -1108,7 +1124,7 @@ class Purchases @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) intern
/**
* Subscriber attribute associated with the install keyword for the user
*
* @param keyword null will delete the subscriber attribute.
* @param keyword null or an empty string will delete the subscriber attribute.
*/
fun setKeyword(keyword: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("seKeyword"))
Expand All @@ -1122,7 +1138,7 @@ class Purchases @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) intern
/**
* Subscriber attribute associated with the install ad creative for the user
*
* @param creative null will delete the subscriber attribute.
* @param creative null or an empty string will delete the subscriber attribute.
*/
fun setCreative(creative: String?) {
log(LogIntent.DEBUG, AttributionStrings.METHOD_CALLED.format("setCreative"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,13 @@ class SubscriberAttributesPurchasesTests {
}
}

@Test
fun `setAirshipChannelID`() {
attributionIDTest(SubscriberAttributeKey.AttributionIds.Airship) { id ->
underTest.setAirshipChannelID(id)
}
}

// endregion

// region Campaign parameters
Expand Down

0 comments on commit e719249

Please sign in to comment.