diff --git a/ios/README.md b/ios/README.md new file mode 100644 index 0000000..00a3156 --- /dev/null +++ b/ios/README.md @@ -0,0 +1,27 @@ +# LexFloatClient iOS Example + +Example demonstrating floating license acquisition with the LexFloatClient iOS +library. + +## Setup + +This project links against `LexFloatClient.xcframework`, which is not bundled here. +Build it from the LexFloatClient native source and place it at: + +``` +examples/sample/LexFloatClient.xcframework +``` + +## Running + +Open `examples/sample/sample.xcodeproj` in Xcode, select your signing team, and +run the `sample` target. + +Set your product ID and float server URL in +[ViewController.m](sample/sample/ViewController.m) before running. + +## Documentation + +Refer to the following for documentation: + +https://docs.cryptlex.com/floating-licenses/on-premise-floating-licenses/using-lexfloatclient diff --git a/ios/sample/sample.xcodeproj/project.pbxproj b/ios/sample/sample.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b41ad9b --- /dev/null +++ b/ios/sample/sample.xcodeproj/project.pbxproj @@ -0,0 +1,394 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 52; + objects = { + +/* Begin PBXBuildFile section */ + 8406D84C268C874F00307DA0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8406D84B268C874F00307DA0 /* AppDelegate.m */; }; + 8406D84F268C874F00307DA0 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8406D84E268C874F00307DA0 /* SceneDelegate.m */; }; + 8406D852268C874F00307DA0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8406D851268C874F00307DA0 /* ViewController.m */; }; + 8406D855268C874F00307DA0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8406D853268C874F00307DA0 /* Main.storyboard */; }; + 8406D857268C875000307DA0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8406D856268C875000307DA0 /* Assets.xcassets */; }; + 8406D85A268C875000307DA0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8406D858268C875000307DA0 /* LaunchScreen.storyboard */; }; + 8406D85D268C875000307DA0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8406D85C268C875000307DA0 /* main.m */; }; + 842387802696D92600A1F0A5 /* LexFloatClient.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8423877F2696D92600A1F0A5 /* LexFloatClient.xcframework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 842F070D2693023D007F6F0D /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 8406D847268C874F00307DA0 /* sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 8406D84A268C874F00307DA0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 8406D84B268C874F00307DA0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 8406D84D268C874F00307DA0 /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = ""; }; + 8406D84E268C874F00307DA0 /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = ""; }; + 8406D850268C874F00307DA0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 8406D851268C874F00307DA0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 8406D854268C874F00307DA0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8406D856268C875000307DA0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 8406D859268C875000307DA0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 8406D85B268C875000307DA0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8406D85C268C875000307DA0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 8423877F2696D92600A1F0A5 /* LexFloatClient.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = LexFloatClient.xcframework; path = sample/LexFloatClient.xcframework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8406D844268C874F00307DA0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 842387802696D92600A1F0A5 /* LexFloatClient.xcframework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 8406D83E268C874F00307DA0 = { + isa = PBXGroup; + children = ( + 8406D849268C874F00307DA0 /* sample */, + 8406D848268C874F00307DA0 /* Products */, + 8406D865268D9A3E00307DA0 /* Frameworks */, + ); + sourceTree = ""; + }; + 8406D848268C874F00307DA0 /* Products */ = { + isa = PBXGroup; + children = ( + 8406D847268C874F00307DA0 /* sample.app */, + ); + name = Products; + sourceTree = ""; + }; + 8406D849268C874F00307DA0 /* sample */ = { + isa = PBXGroup; + children = ( + 8406D84A268C874F00307DA0 /* AppDelegate.h */, + 8406D84B268C874F00307DA0 /* AppDelegate.m */, + 8406D84D268C874F00307DA0 /* SceneDelegate.h */, + 8406D84E268C874F00307DA0 /* SceneDelegate.m */, + 8406D850268C874F00307DA0 /* ViewController.h */, + 8406D851268C874F00307DA0 /* ViewController.m */, + 8406D853268C874F00307DA0 /* Main.storyboard */, + 8406D856268C875000307DA0 /* Assets.xcassets */, + 8406D858268C875000307DA0 /* LaunchScreen.storyboard */, + 8406D85B268C875000307DA0 /* Info.plist */, + 8406D85C268C875000307DA0 /* main.m */, + ); + path = sample; + sourceTree = ""; + }; + 8406D865268D9A3E00307DA0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8423877F2696D92600A1F0A5 /* LexFloatClient.xcframework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8406D846268C874F00307DA0 /* sample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8406D860268C875000307DA0 /* Build configuration list for PBXNativeTarget "sample" */; + buildPhases = ( + 8406D843268C874F00307DA0 /* Sources */, + 8406D844268C874F00307DA0 /* Frameworks */, + 8406D845268C874F00307DA0 /* Resources */, + 842F070D2693023D007F6F0D /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = sample; + productName = sample; + productReference = 8406D847268C874F00307DA0 /* sample.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 8406D83F268C874F00307DA0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1250; + TargetAttributes = { + 8406D846268C874F00307DA0 = { + CreatedOnToolsVersion = 12.5.1; + }; + }; + }; + buildConfigurationList = 8406D842268C874F00307DA0 /* Build configuration list for PBXProject "sample" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 8406D83E268C874F00307DA0; + productRefGroup = 8406D848268C874F00307DA0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8406D846268C874F00307DA0 /* sample */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8406D845268C874F00307DA0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8406D85A268C875000307DA0 /* LaunchScreen.storyboard in Resources */, + 8406D857268C875000307DA0 /* Assets.xcassets in Resources */, + 8406D855268C874F00307DA0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8406D843268C874F00307DA0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8406D852268C874F00307DA0 /* ViewController.m in Sources */, + 8406D84C268C874F00307DA0 /* AppDelegate.m in Sources */, + 8406D85D268C875000307DA0 /* main.m in Sources */, + 8406D84F268C874F00307DA0 /* SceneDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 8406D853268C874F00307DA0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8406D854268C874F00307DA0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8406D858268C875000307DA0 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8406D859268C875000307DA0 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8406D85E268C875000307DA0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.5; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 8406D85F268C875000307DA0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 8406D861268C875000307DA0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/sample", + ); + INFOPLIST_FILE = sample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = "-lc++"; + PRODUCT_BUNDLE_IDENTIFIER = com.cryptlex.sample.sample; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = NO; + VALIDATE_WORKSPACE = NO; + }; + name = Debug; + }; + 8406D862268C875000307DA0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/sample", + ); + INFOPLIST_FILE = sample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_LDFLAGS = "-lc++"; + PRODUCT_BUNDLE_IDENTIFIER = com.cryptlex.sample.sample; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_WORKSPACE = NO; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 8406D842268C874F00307DA0 /* Build configuration list for PBXProject "sample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8406D85E268C875000307DA0 /* Debug */, + 8406D85F268C875000307DA0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8406D860268C875000307DA0 /* Build configuration list for PBXNativeTarget "sample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8406D861268C875000307DA0 /* Debug */, + 8406D862268C875000307DA0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 8406D83F268C874F00307DA0 /* Project object */; +} diff --git a/ios/sample/sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/sample/sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ios/sample/sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/sample/sample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/sample/sample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/sample/sample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/sample/sample.xcodeproj/xcshareddata/xcschemes/sample.xcscheme b/ios/sample/sample.xcodeproj/xcshareddata/xcschemes/sample.xcscheme new file mode 100644 index 0000000..f002caf --- /dev/null +++ b/ios/sample/sample.xcodeproj/xcshareddata/xcschemes/sample.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/sample/sample/AppDelegate.h b/ios/sample/sample/AppDelegate.h new file mode 100644 index 0000000..fdc4769 --- /dev/null +++ b/ios/sample/sample/AppDelegate.h @@ -0,0 +1,14 @@ +// +// AppDelegate.h +// sample +// +// Created by Adnan Kamili on 30/06/21. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + diff --git a/ios/sample/sample/AppDelegate.m b/ios/sample/sample/AppDelegate.m new file mode 100644 index 0000000..379d19c --- /dev/null +++ b/ios/sample/sample/AppDelegate.m @@ -0,0 +1,40 @@ +// +// AppDelegate.m +// sample +// +// Created by Adnan Kamili on 30/06/21. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end diff --git a/ios/sample/sample/Assets.xcassets/AccentColor.colorset/Contents.json b/ios/sample/sample/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ios/sample/sample/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/sample/sample/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/sample/sample/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/ios/sample/sample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/sample/sample/Assets.xcassets/Contents.json b/ios/sample/sample/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ios/sample/sample/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/sample/sample/Base.lproj/LaunchScreen.storyboard b/ios/sample/sample/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..1cfdc7e --- /dev/null +++ b/ios/sample/sample/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/sample/sample/Base.lproj/Main.storyboard b/ios/sample/sample/Base.lproj/Main.storyboard new file mode 100644 index 0000000..8f62c9f --- /dev/null +++ b/ios/sample/sample/Base.lproj/Main.storyboard @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/sample/sample/Info.plist b/ios/sample/sample/Info.plist new file mode 100644 index 0000000..72bf2c4 --- /dev/null +++ b/ios/sample/sample/Info.plist @@ -0,0 +1,66 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/ios/sample/sample/SceneDelegate.h b/ios/sample/sample/SceneDelegate.h new file mode 100644 index 0000000..81e806f --- /dev/null +++ b/ios/sample/sample/SceneDelegate.h @@ -0,0 +1,15 @@ +// +// SceneDelegate.h +// sample +// +// Created by Adnan Kamili on 30/06/21. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/ios/sample/sample/SceneDelegate.m b/ios/sample/sample/SceneDelegate.m new file mode 100644 index 0000000..3db3656 --- /dev/null +++ b/ios/sample/sample/SceneDelegate.m @@ -0,0 +1,57 @@ +// +// SceneDelegate.m +// sample +// +// Created by Adnan Kamili on 30/06/21. +// + +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end diff --git a/ios/sample/sample/ViewController.h b/ios/sample/sample/ViewController.h new file mode 100644 index 0000000..783d3e4 --- /dev/null +++ b/ios/sample/sample/ViewController.h @@ -0,0 +1,14 @@ +// +// ViewController.h +// sample +// +// Created by Adnan Kamili on 30/06/21. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/ios/sample/sample/ViewController.m b/ios/sample/sample/ViewController.m new file mode 100644 index 0000000..54f72d8 --- /dev/null +++ b/ios/sample/sample/ViewController.m @@ -0,0 +1,74 @@ +// +// ViewController.m +// sample +// +// Created by Adnan Kamili on 30/06/21. +// + +#import "ViewController.h" +#import +@interface ViewController () +@property (weak, nonatomic) IBOutlet UIButton *activateButton; +@property (weak, nonatomic) IBOutlet UIButton *dropLicenseButton; +@property (weak, nonatomic) IBOutlet UILabel *licenseStatusLabel; + +@end + +@implementation ViewController + +void LF_CC licenceRenewCallback(uint32_t status) +{ + switch (status) + { + case LF_OK: + printf("The license lease has renewed successfully.\n"); + break; + case LF_E_LICENSE_NOT_FOUND: + printf("The license expired before it could be renewed.\n"); + break; + case LF_E_LICENSE_EXPIRED_INET: + printf("The license expired due to network connection failure.\n"); + break; + default: + printf("The license renew failed due to other reason. Error code: %d\n", status); + break; + } +} + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + int status; + status = SetHostProductId("PASTE_PRODUCT_ID"); + if(status != LF_OK) + { + self.licenseStatusLabel.text = [NSString stringWithFormat:@"%d",status]; + return; + } + + status = SetHostUrl("http://localhost:8090"); + if(status != LF_OK) + { + self.licenseStatusLabel.text = [NSString stringWithFormat:@"%d",status]; + return; + } + +} +- (IBAction)onActivateClick:(id)sender { + int status; + status = SetFloatingLicenseCallback(licenceRenewCallback); + if(status != LF_OK) + { + self.licenseStatusLabel.text = [NSString stringWithFormat:@"%d",status]; + return; + } + status = RequestFloatingLicense(); + self.licenseStatusLabel.text = [NSString stringWithFormat:@"%d",status]; +} +- (IBAction)onDropLicenseClick:(id)sender { + int status = DropFloatingLicense(); + self.licenseStatusLabel.text = [NSString stringWithFormat:@"%d",status]; +} + + +@end diff --git a/ios/sample/sample/main.m b/ios/sample/sample/main.m new file mode 100644 index 0000000..f1b4d52 --- /dev/null +++ b/ios/sample/sample/main.m @@ -0,0 +1,18 @@ +// +// main.m +// sample +// +// Created by Adnan Kamili on 30/06/21. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +}