Skip to content

Instantly share code, notes, and snippets.

View CoreyRab's full-sized avatar

Corey Rabazinski CoreyRab

View GitHub Profile
// An example call to getOfferings from a Flutter app (see diagram step a)
try {
Offerings offerings = await Purchases.getOfferings();  
// Display packages for sale
} on PlatformException catch (e) {    
// optional error handling
}
Purchases.shared.getPurchaserInfo { info, error in
// info.entitlements[“beta”]?.isActive == true
}
@CoreyRab
CoreyRab / subscriberAttributeTracking.swift
Last active March 17, 2020 21:19
Subscriber attribute tracking JSON
{
"attributes" : {
"cancel_survey_sent" : {
"value" : {{zap_meta_timestamp}}
}
}
}
@CoreyRab
CoreyRab / customAtrributes.swift
Last active April 28, 2020 01:43
Save custom attributes in RevenueCaat
// 2.
Purchases.shared.setAttributes(["favorite_workout" : "cycling"])
@CoreyRab
CoreyRab / captureEmails.swift
Last active March 17, 2020 21:20
Capture emails with RevenueCat
// 1.
Purchases.shared.setEmail(emailField.text)