Skip to content

Instantly share code, notes, and snippets.

@nside
Created Sep 9, 2021
Embed
What would you like to do?
SDL2 RevenueCat integration
// You can use this in your main.mm
#import "../SDL/include/SDL_uikitappdelegate.h"
#import <Purchases/Purchases.h>
@interface MyDelegate : SDLUIKitDelegate
@end
@implementation MyDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
BOOL ret = [super application:application didFinishLaunchingWithOptions:launchOptions];
// RevenueCat
RCPurchases.logLevel = RCLogLevelDebug;
[RCPurchases configureWithAPIKey:@"xxx"];
return ret;
}
@end
// Add a 'category' to the SDL app delegate class
@interface SDLUIKitDelegate (extra)
{
}
@end
@implementation SDLUIKitDelegate (extra)
+ (NSString *)getAppDelegateClassName {
return @"MyDelegate";
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment