registerJourneyStateHandler

Register a callback that will be made any time there's a change to the Journey State for the user. Note that Nami fetches journey state at the start of each session and this is the most likely time to see a change.

NamiCustomerManager.registerJourneyStateHandler { journeyState in
    print("customer journey state")
    print("former subscriber: \(journeyState.formerSubscriber)")
    print("in grace period: \(journeyState.inGracePeriod)")
    print("in trial period: \(journeyState.inTrialPeriod)")
    print("in intro offer period: \(journeyState.inIntroOfferPeriod)")
    print("has cancelled subscription: \(journeyState.isCancelled)")
    print("in account hold: \(journeyState.inAccountHold)")
    print("in pause (Google Play): \(journeyState.inPause)")
}

Last updated