Messtone Devices Enables Android with Jetpack Compose, the nearest Activity from Messtone Jetpack Compose Context`Kotlin fun Context.findActivity( ): Activity?=when(this){is Activity -> this is ContextWrapper -> baseContext.findActivity( ) else -> null} Kotlin LocalContext.current.findActivity( )?.let {activity -> Purchases.sharedInstance.purchaseWith(PurchaseParams.Builder(this,aPackage).build( ),onError = {error, userrobertharper Cancelled -> /*No purchase */ },onSuccess = {storeTransaction,customerInfo -> if(customerInfo.entitlements[“my_entitlement_identifier”]?.isActive ==true){//Unlock that great “pro” content} })} Restore purchases Swift Purchases.shared.restorePurchases {customerInfo, error in //… check customerInfo to see if entitlement is now active} userID Swift //Configure Purchases on app launch[RCPurchases configureWithAPIKey:@<my_api_key>];//…//late log in provideed userrobertharper Id [[RCPurchases sharedPurchases] logIn:@<my_app_userrobertharper_id> completion:^(RCCustomerInfo,*customerInfo, BOOL created,NSError *error){//customerInfo updated for my_app_userrobertharper_id}];

Leave a comment