Skip to content

Instantly share code, notes, and snippets.

@nside
Created September 9, 2021 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nside/1cdbcc92554a944ca9049e0ce7d333ea to your computer and use it in GitHub Desktop.
Save nside/1cdbcc92554a944ca9049e0ce7d333ea to your computer and use it in GitHub Desktop.
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