UPDATE. Since the publication of the article Rules has been significantly improved in Apphud. Now we support scheduled and manual push campaigns, allowing you to run campaigns whenever you want to your custom audience.
Apphud may help to win back churned subscribers, reduce churn rate, get cancellation insights, reduce involuntary churn, and many more using the mechanics below. These mechanics are called Rules.
When creating a new rule you will need to choose a rule type. The most popular ones are Get cancellation insights and Win back lost subscribers. Let's take a closer look at these.
Creating each Rule type itself doesn't have any differences except choosing a Screen. While creating the Get cancellation insights rule you will need to create a survey screen. The default question in this survey screen is "Why did you cancel subscription?". While creating the Win back lost subscribers rule you can choose paywall screens only.
You can choose an event at which the rule will be triggered. By default, it's "Autorenew disabled", which is being called when subscription auto-renewal is turned off in subscriptions settings in App Store.
Currently, "Autorenew disabled" is deprecated, but Rules will continue to work correctly. There are two new events that replace this event: "Trial canceled" and "Subscription canceled". The first one is being created when users cancel a free trial subscription, in other cases "Subscription canceled" event is created.
Trial canceled event is also created when canceling a free trial purchased from a promotional offer or Offer Code (available since iOS 14). Trial Canceled is also created when a grace or expired subscription was canceled automatically due to an unrecovered billing issue if the subscription wasn't paid.
You can also choose other events, like, "Subscription expired". In this case, a rule will be triggered when the paid subscription period is actually expired.
At the question "How many times rule can be performed for each user?" you can choose "unlimited times". It means that if a user cancels the subscription again, the same rule will be triggered and a new push notification will arrive.
At the "User segments" section you can choose your audience to which your Rule will be applied. The following segments are available:
true
, if a user is (or was) paying customer;At the "Actions" section you can set Push notification title and message, which can be localized. In order to add localization, you must first add it in Apphud -> iOS localization
Also here you select a screen, which will be shown in the app.
When the user cancels the subscription, Apple sends a server notification to Apphud with notification_type
= DID_CHANGE_RENEWAL_STATUS
. In this notification, there is also a receipt snapshot, which is a JSON format string with an in-app receipts array. There is original_transaction_id
– the unique subscription identifier. Using this identifier Apphud finds a customer in its database and if found, triggers a rule with push notification.
To receive server notifications from Apple, you must set the URL for App Store Server Notifications. More details here.
Once a user opened Push notification, Apphud SDK loads and displays a modal screen with whatever the user has configured. If a user didn't open Push notification, a screen will still be displayed at the next app launch or activation.
When executing Rules, Apphud sends a Push notification to a user, if they have a device token.
func submitPushNotificationsToken(token: Data, callback: ApphudBoolCallback?)
func handlePushNotification(apsInfo: \[AnyHashable: Any\]) -> Bool
You can create and edit your screens over-the-air using a powerful web editor. When creating a new screen you can choose one of four types: Promo offer (Paywall), Survey, Feedback, and Billing Issue.
Screens Editor has many great features:
ApphudUIDelegate
.You can set your own survey text and answer options. For each answer option, you can present another screen, like one more survey or promo offer screen.
Paywall screens can be of two types: with or without promotion offers. This option can be configured in the Purchase button section. When creating a paywall screen you must provide Product ID, and optionally Promo Offer ID if purchasing a promotional offer.
When choosing Purchase promo offer on tap
, you must provide a promotional offer identifier, that is being set in App Store Connect when creating a promotional offer for a subscription product.
Don't get confused with Offer Codes!
Keep in mind, that purchasing subscription offers requires generating a signature using Subscription Key. Luckily, Apphud handles that from the box. You just need to create Subscription Key in App Store Connect and upload it to Apphud. You can read more about generating subscription key here.
Set promotional offer id and product id:
When you choose Purchase product on tap
, it means purchasing a regular subscription or in-app purchase. Promotional offer id should be left blank.
If the user wants to close the screen, you can also present another screen, so that the new screen will be pushed into the navigation controller hierarchy. For example, you can offer a better discount when the user wants to close the paywall.
In order to display the localized prices for IAP, you can use macroses – orange buttons near to text fields.
Macroses can be of two types: Regular or Offer price.
This is the regular price of your in-app purchase, just select Product ID and Apphud SDK will automatically replace macros with the standard product price.
This is a promotional offer price, you should set Promo Offer ID and Product ID, the same values that in the Purchase button. Apphud SDK will automatically replace this macros with promotional offer price.
If you use a free trial period, you can add your own text and combine it with macros. For example: 3 days for free, then just {regular_price} per month.
Phrases "3 days for free, then just" and "per month" you add manually, and regular price is replaced by SDK.
By default, the long text with subscription information is shown in this block. You can edit the text or remove this block at all – it is not required anymore.
Many blocks can be hidden with the "Hide block" button.
Apphud SDK has many ways to control rules behavior. Here are some:
false
to cancel rule execution. Using this delegate method you can present your own screens. Keep in mind, that in this case Rule Analytics will not work: func apphudShouldPerformRule(rule: ApphudRule) -> Bool
none
value, you can cancel automatic screen dismissal and push your own controller into the hierarchy by using navigationController
property of controller
: func apphudScreenDismissAction(screenName: String, controller: UIViewController) -> ApphudScreenDismissAction
ApphudUIDelegate
for more detailsTo display Apphud Screens in the app, you need to create a Rule, a Screen, and set up push notifications.
func submitPushNotificationsToken(token: Data, callback: ApphudBoolCallback?)
func handlePushNotification(apsInfo: [AnyHashable: Any]) -> Bool
func apphudScreenPresentationStyle(controller: UIViewController) -> UIModalPresentationStyle