diff --git a/FinDemo.xcodeproj/project.pbxproj b/FinDemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b1635bf --- /dev/null +++ b/FinDemo.xcodeproj/project.pbxproj @@ -0,0 +1,533 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + A5E020AE5E13AC7CEB65DB6D /* libPods-FinDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F92103C497B51062D53EACA4 /* libPods-FinDemo.a */; }; + D60E44C32A25BFF500F256B1 /* FinCustomUIViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D60E44C22A25BFF500F256B1 /* FinCustomUIViewController.m */; }; + D60E44C52A25C2E700F256B1 /* finclipLogin.zip in Resources */ = {isa = PBXBuildFile; fileRef = D60E44C42A25C2E600F256B1 /* finclipLogin.zip */; }; + D60E44C82A25C56600F256B1 /* FinDelegateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D60E44C72A25C56600F256B1 /* FinDelegateViewController.m */; }; + D6471C012A2485AC0054EF34 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D6471C002A2485AC0054EF34 /* AppDelegate.m */; }; + D6471C072A2485AC0054EF34 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D6471C062A2485AC0054EF34 /* ViewController.m */; }; + D6471C0A2A2485AC0054EF34 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D6471C082A2485AC0054EF34 /* Main.storyboard */; }; + D6471C0C2A2485AF0054EF34 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D6471C0B2A2485AF0054EF34 /* Assets.xcassets */; }; + D6471C0F2A2485AF0054EF34 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D6471C0D2A2485AF0054EF34 /* LaunchScreen.storyboard */; }; + D6471C122A2485AF0054EF34 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D6471C112A2485AF0054EF34 /* main.m */; }; + D6471C242A2496B70054EF34 /* FinStartAppletViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D6471C232A2496B70054EF34 /* FinStartAppletViewController.m */; }; + D6471C272A2496E30054EF34 /* FinManageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D6471C262A2496E30054EF34 /* FinManageViewController.m */; }; + D6471C2A2A2595000054EF34 /* FinNormalStartViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D6471C292A2595000054EF34 /* FinNormalStartViewController.m */; }; + D6471C2D2A25955C0054EF34 /* FinScanStartViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D6471C2C2A25955C0054EF34 /* FinScanStartViewController.m */; }; + D6471C302A2598150054EF34 /* FinQRCodeScanViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D6471C2F2A2598150054EF34 /* FinQRCodeScanViewController.m */; }; + D6471C332A25A36F0054EF34 /* FinCustomApiViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D6471C322A25A36F0054EF34 /* FinCustomApiViewController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 5D8C9A62395C924AC1334F55 /* Pods-FinDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FinDemo.release.xcconfig"; path = "Target Support Files/Pods-FinDemo/Pods-FinDemo.release.xcconfig"; sourceTree = ""; }; + C5CA001A70332B91FE135258 /* Pods-FinDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FinDemo.debug.xcconfig"; path = "Target Support Files/Pods-FinDemo/Pods-FinDemo.debug.xcconfig"; sourceTree = ""; }; + D60E44C12A25BFF500F256B1 /* FinCustomUIViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinCustomUIViewController.h; sourceTree = ""; }; + D60E44C22A25BFF500F256B1 /* FinCustomUIViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinCustomUIViewController.m; sourceTree = ""; }; + D60E44C42A25C2E600F256B1 /* finclipLogin.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = finclipLogin.zip; sourceTree = ""; }; + D60E44C62A25C56600F256B1 /* FinDelegateViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinDelegateViewController.h; sourceTree = ""; }; + D60E44C72A25C56600F256B1 /* FinDelegateViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinDelegateViewController.m; sourceTree = ""; }; + D6471BFC2A2485AC0054EF34 /* FinDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FinDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + D6471BFF2A2485AC0054EF34 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + D6471C002A2485AC0054EF34 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + D6471C052A2485AC0054EF34 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + D6471C062A2485AC0054EF34 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + D6471C092A2485AC0054EF34 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + D6471C0B2A2485AF0054EF34 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + D6471C0E2A2485AF0054EF34 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + D6471C102A2485AF0054EF34 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + D6471C112A2485AF0054EF34 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + D6471C222A2496B60054EF34 /* FinStartAppletViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinStartAppletViewController.h; sourceTree = ""; }; + D6471C232A2496B70054EF34 /* FinStartAppletViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinStartAppletViewController.m; sourceTree = ""; }; + D6471C252A2496E30054EF34 /* FinManageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinManageViewController.h; sourceTree = ""; }; + D6471C262A2496E30054EF34 /* FinManageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinManageViewController.m; sourceTree = ""; }; + D6471C282A2595000054EF34 /* FinNormalStartViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinNormalStartViewController.h; sourceTree = ""; }; + D6471C292A2595000054EF34 /* FinNormalStartViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinNormalStartViewController.m; sourceTree = ""; }; + D6471C2B2A25955C0054EF34 /* FinScanStartViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinScanStartViewController.h; sourceTree = ""; }; + D6471C2C2A25955C0054EF34 /* FinScanStartViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinScanStartViewController.m; sourceTree = ""; }; + D6471C2E2A2598150054EF34 /* FinQRCodeScanViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinQRCodeScanViewController.h; sourceTree = ""; }; + D6471C2F2A2598150054EF34 /* FinQRCodeScanViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinQRCodeScanViewController.m; sourceTree = ""; }; + D6471C312A25A36F0054EF34 /* FinCustomApiViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinCustomApiViewController.h; sourceTree = ""; }; + D6471C322A25A36F0054EF34 /* FinCustomApiViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinCustomApiViewController.m; sourceTree = ""; }; + F92103C497B51062D53EACA4 /* libPods-FinDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-FinDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D6471BF92A2485AC0054EF34 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A5E020AE5E13AC7CEB65DB6D /* libPods-FinDemo.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 4986B21812B70137AECC9394 /* Pods */ = { + isa = PBXGroup; + children = ( + C5CA001A70332B91FE135258 /* Pods-FinDemo.debug.xcconfig */, + 5D8C9A62395C924AC1334F55 /* Pods-FinDemo.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; + D6471BF32A2485AC0054EF34 = { + isa = PBXGroup; + children = ( + D6471BFE2A2485AC0054EF34 /* FinDemo */, + D6471BFD2A2485AC0054EF34 /* Products */, + 4986B21812B70137AECC9394 /* Pods */, + F49530F1C3FD683C1294DECF /* Frameworks */, + ); + sourceTree = ""; + }; + D6471BFD2A2485AC0054EF34 /* Products */ = { + isa = PBXGroup; + children = ( + D6471BFC2A2485AC0054EF34 /* FinDemo.app */, + ); + name = Products; + sourceTree = ""; + }; + D6471BFE2A2485AC0054EF34 /* FinDemo */ = { + isa = PBXGroup; + children = ( + D6471BFF2A2485AC0054EF34 /* AppDelegate.h */, + D6471C002A2485AC0054EF34 /* AppDelegate.m */, + D6471C052A2485AC0054EF34 /* ViewController.h */, + D6471C062A2485AC0054EF34 /* ViewController.m */, + D6471C182A2492340054EF34 /* 功能演示 */, + D6471C082A2485AC0054EF34 /* Main.storyboard */, + D6471C0B2A2485AF0054EF34 /* Assets.xcassets */, + D6471C0D2A2485AF0054EF34 /* LaunchScreen.storyboard */, + D6471C102A2485AF0054EF34 /* Info.plist */, + D6471C112A2485AF0054EF34 /* main.m */, + ); + path = FinDemo; + sourceTree = ""; + }; + D6471C182A2492340054EF34 /* 功能演示 */ = { + isa = PBXGroup; + children = ( + D6471C1C2A2492340054EF34 /* 1.打开小程序 */, + D6471C1A2A2492340054EF34 /* 2.日志管理 */, + D6471C1B2A2492340054EF34 /* 3.UI样式自定义 */, + D6471C212A2492340054EF34 /* 4.api自定义 */, + D6471C192A2492340054EF34 /* 5.代理方法 */, + ); + path = "功能演示"; + sourceTree = ""; + }; + D6471C192A2492340054EF34 /* 5.代理方法 */ = { + isa = PBXGroup; + children = ( + D60E44C62A25C56600F256B1 /* FinDelegateViewController.h */, + D60E44C72A25C56600F256B1 /* FinDelegateViewController.m */, + ); + path = "5.代理方法"; + sourceTree = ""; + }; + D6471C1A2A2492340054EF34 /* 2.日志管理 */ = { + isa = PBXGroup; + children = ( + D6471C252A2496E30054EF34 /* FinManageViewController.h */, + D6471C262A2496E30054EF34 /* FinManageViewController.m */, + ); + path = "2.日志管理"; + sourceTree = ""; + }; + D6471C1B2A2492340054EF34 /* 3.UI样式自定义 */ = { + isa = PBXGroup; + children = ( + D60E44C12A25BFF500F256B1 /* FinCustomUIViewController.h */, + D60E44C22A25BFF500F256B1 /* FinCustomUIViewController.m */, + ); + path = "3.UI样式自定义"; + sourceTree = ""; + }; + D6471C1C2A2492340054EF34 /* 1.打开小程序 */ = { + isa = PBXGroup; + children = ( + D6471C1D2A2492340054EF34 /* 2.扫码打开小程序 */, + D6471C1E2A2492340054EF34 /* 1.普通打开小程序 */, + D6471C222A2496B60054EF34 /* FinStartAppletViewController.h */, + D6471C232A2496B70054EF34 /* FinStartAppletViewController.m */, + ); + path = "1.打开小程序"; + sourceTree = ""; + }; + D6471C1D2A2492340054EF34 /* 2.扫码打开小程序 */ = { + isa = PBXGroup; + children = ( + D6471C2B2A25955C0054EF34 /* FinScanStartViewController.h */, + D6471C2C2A25955C0054EF34 /* FinScanStartViewController.m */, + D6471C2E2A2598150054EF34 /* FinQRCodeScanViewController.h */, + D6471C2F2A2598150054EF34 /* FinQRCodeScanViewController.m */, + ); + path = "2.扫码打开小程序"; + sourceTree = ""; + }; + D6471C1E2A2492340054EF34 /* 1.普通打开小程序 */ = { + isa = PBXGroup; + children = ( + D6471C282A2595000054EF34 /* FinNormalStartViewController.h */, + D6471C292A2595000054EF34 /* FinNormalStartViewController.m */, + ); + path = "1.普通打开小程序"; + sourceTree = ""; + }; + D6471C212A2492340054EF34 /* 4.api自定义 */ = { + isa = PBXGroup; + children = ( + D60E44C42A25C2E600F256B1 /* finclipLogin.zip */, + D6471C312A25A36F0054EF34 /* FinCustomApiViewController.h */, + D6471C322A25A36F0054EF34 /* FinCustomApiViewController.m */, + ); + path = "4.api自定义"; + sourceTree = ""; + }; + F49530F1C3FD683C1294DECF /* Frameworks */ = { + isa = PBXGroup; + children = ( + F92103C497B51062D53EACA4 /* libPods-FinDemo.a */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + D6471BFB2A2485AC0054EF34 /* FinDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = D6471C152A2485AF0054EF34 /* Build configuration list for PBXNativeTarget "FinDemo" */; + buildPhases = ( + F52F36A7EFE87448174DEB10 /* [CP] Check Pods Manifest.lock */, + D6471BF82A2485AC0054EF34 /* Sources */, + D6471BF92A2485AC0054EF34 /* Frameworks */, + D6471BFA2A2485AC0054EF34 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = FinDemo; + productName = FinDemo; + productReference = D6471BFC2A2485AC0054EF34 /* FinDemo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D6471BF42A2485AC0054EF34 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1310; + TargetAttributes = { + D6471BFB2A2485AC0054EF34 = { + CreatedOnToolsVersion = 13.1; + }; + }; + }; + buildConfigurationList = D6471BF72A2485AC0054EF34 /* Build configuration list for PBXProject "FinDemo" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = D6471BF32A2485AC0054EF34; + productRefGroup = D6471BFD2A2485AC0054EF34 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D6471BFB2A2485AC0054EF34 /* FinDemo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D6471BFA2A2485AC0054EF34 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D6471C0F2A2485AF0054EF34 /* LaunchScreen.storyboard in Resources */, + D6471C0C2A2485AF0054EF34 /* Assets.xcassets in Resources */, + D6471C0A2A2485AC0054EF34 /* Main.storyboard in Resources */, + D60E44C52A25C2E700F256B1 /* finclipLogin.zip in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + F52F36A7EFE87448174DEB10 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-FinDemo-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D6471BF82A2485AC0054EF34 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D6471C332A25A36F0054EF34 /* FinCustomApiViewController.m in Sources */, + D6471C072A2485AC0054EF34 /* ViewController.m in Sources */, + D60E44C82A25C56600F256B1 /* FinDelegateViewController.m in Sources */, + D6471C242A2496B70054EF34 /* FinStartAppletViewController.m in Sources */, + D60E44C32A25BFF500F256B1 /* FinCustomUIViewController.m in Sources */, + D6471C2D2A25955C0054EF34 /* FinScanStartViewController.m in Sources */, + D6471C2A2A2595000054EF34 /* FinNormalStartViewController.m in Sources */, + D6471C012A2485AC0054EF34 /* AppDelegate.m in Sources */, + D6471C122A2485AF0054EF34 /* main.m in Sources */, + D6471C272A2496E30054EF34 /* FinManageViewController.m in Sources */, + D6471C302A2598150054EF34 /* FinQRCodeScanViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + D6471C082A2485AC0054EF34 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D6471C092A2485AC0054EF34 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + D6471C0D2A2485AF0054EF34 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + D6471C0E2A2485AF0054EF34 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + D6471C132A2485AF0054EF34 /* 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++17"; + 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 = 15.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + D6471C142A2485AF0054EF34 /* 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++17"; + 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 = 15.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + D6471C162A2485AF0054EF34 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C5CA001A70332B91FE135258 /* Pods-FinDemo.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = M6UWNQYZ59; + ENABLE_BITCODE = NO; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = FinDemo/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.finogeeks.finclip.demo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + D6471C172A2485AF0054EF34 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5D8C9A62395C924AC1334F55 /* Pods-FinDemo.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = M6UWNQYZ59; + ENABLE_BITCODE = NO; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = FinDemo/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.finogeeks.finclip.demo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D6471BF72A2485AC0054EF34 /* Build configuration list for PBXProject "FinDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D6471C132A2485AF0054EF34 /* Debug */, + D6471C142A2485AF0054EF34 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D6471C152A2485AF0054EF34 /* Build configuration list for PBXNativeTarget "FinDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D6471C162A2485AF0054EF34 /* Debug */, + D6471C172A2485AF0054EF34 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D6471BF42A2485AC0054EF34 /* Project object */; +} diff --git a/demo/AppDelegate.h b/FinDemo/AppDelegate.h similarity index 63% rename from demo/AppDelegate.h rename to FinDemo/AppDelegate.h index 0c81cac..05a2de3 100644 --- a/demo/AppDelegate.h +++ b/FinDemo/AppDelegate.h @@ -1,9 +1,8 @@ // // AppDelegate.h -// demo +// FinDemo // -// Created by 杨涛 on 2020/2/6. -// Copyright © 2020 finogeeks. All rights reserved. +// Created by 胡健辉 on 2023/5/29. // #import diff --git a/FinDemo/AppDelegate.m b/FinDemo/AppDelegate.m new file mode 100644 index 0000000..e2b63f6 --- /dev/null +++ b/FinDemo/AppDelegate.m @@ -0,0 +1,55 @@ +// +// AppDelegate.m +// FinDemo +// +// Created by 胡健辉 on 2023/5/29. +// + +#import "AppDelegate.h" +#import + + +static NSString *sdkKey1 = @"22LyZEib0gLTQdU3MUauATBwgfnTCJjdr7FCnywmAEM="; +static NSString *sdkSecret1 = @"bdfd76cae24d4313"; +static NSString *apiServer1 = @"https://api.finclip.com"; +//static NSString *sdkKey1 = @""; +//static NSString *sdkKey1 = @""; + + + + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + self.window.backgroundColor = [UIColor whiteColor]; + self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[NSClassFromString(@"ViewController") new]]; + [self.window makeKeyAndVisible]; + + NSMutableArray *storeArrayM = [NSMutableArray array]; + FATStoreConfig *storeConfig = [[FATStoreConfig alloc] init]; + storeConfig.sdkKey = sdkKey1; + storeConfig.sdkSecret = sdkSecret1; + storeConfig.apiServer = apiServer1; + storeConfig.cryptType = FATApiCryptTypeSM; + [storeArrayM addObject:storeConfig]; + + FATConfig *config = [FATConfig configWithStoreConfigs:storeArrayM]; + /* + 注意:小程序的其他操作必须放在FATClient初始化之后,否则失效!!! + */ + BOOL result = [[FATClient sharedClient] initWithConfig:config error:nil]; + NSLog(@"注册SDK%@!!!!", result? @"成功" : @"失败"); + + return YES; +} + + + + +@end diff --git a/FinDemo/Assets.xcassets/AccentColor.colorset/Contents.json b/FinDemo/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/FinDemo/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/FinDemo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..728e6c3 --- /dev/null +++ b/FinDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images": [ + { + "size": "20x20", + "idiom": "iphone", + "filename": "icon-20@2x.png", + "scale": "2x" + }, + { + "size": "20x20", + "idiom": "iphone", + "filename": "icon-20@3x.png", + "scale": "3x" + }, + { + "size": "29x29", + "idiom": "iphone", + "filename": "icon-29.png", + "scale": "1x" + }, + { + "size": "29x29", + "idiom": "iphone", + "filename": "icon-29@2x.png", + "scale": "2x" + }, + { + "size": "29x29", + "idiom": "iphone", + "filename": "icon-29@3x.png", + "scale": "3x" + }, + { + "size": "40x40", + "idiom": "iphone", + "filename": "icon-40@2x.png", + "scale": "2x" + }, + { + "size": "40x40", + "idiom": "iphone", + "filename": "icon-40@3x.png", + "scale": "3x" + }, + { + "size": "60x60", + "idiom": "iphone", + "filename": "icon-60@2x.png", + "scale": "2x" + }, + { + "size": "60x60", + "idiom": "iphone", + "filename": "icon-60@3x.png", + "scale": "3x" + }, + { + "size": "20x20", + "idiom": "ipad", + "filename": "icon-20-ipad.png", + "scale": "1x" + }, + { + "size": "20x20", + "idiom": "ipad", + "filename": "icon-20@2x-ipad.png", + "scale": "2x" + }, + { + "size": "29x29", + "idiom": "ipad", + "filename": "icon-29-ipad.png", + "scale": "1x" + }, + { + "size": "29x29", + "idiom": "ipad", + "filename": "icon-29@2x-ipad.png", + "scale": "2x" + }, + { + "size": "40x40", + "idiom": "ipad", + "filename": "icon-40.png", + "scale": "1x" + }, + { + "size": "40x40", + "idiom": "ipad", + "filename": "icon-40@2x.png", + "scale": "2x" + }, + { + "size": "76x76", + "idiom": "ipad", + "filename": "icon-76.png", + "scale": "1x" + }, + { + "size": "76x76", + "idiom": "ipad", + "filename": "icon-76@2x.png", + "scale": "2x" + }, + { + "size": "83.5x83.5", + "idiom": "ipad", + "filename": "icon-83.5@2x.png", + "scale": "2x" + }, + { + "size": "1024x1024", + "idiom": "ios-marketing", + "filename": "icon-1024.png", + "scale": "1x" + } + ], + "info": { + "version": 1, + "author": "icon.wuruihong.com" + } +} \ No newline at end of file diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-1024.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-1024.png new file mode 100644 index 0000000..bbf09f8 Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-1024.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png new file mode 100644 index 0000000..b303541 Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20@2x-ipad.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20@2x-ipad.png new file mode 100644 index 0000000..cd8bef8 Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20@2x-ipad.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png new file mode 100644 index 0000000..cd8bef8 Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png new file mode 100644 index 0000000..16c1160 Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29-ipad.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29-ipad.png new file mode 100644 index 0000000..d463027 Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29-ipad.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29.png new file mode 100644 index 0000000..d463027 Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29@2x-ipad.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29@2x-ipad.png new file mode 100644 index 0000000..4295f3f Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29@2x-ipad.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png new file mode 100644 index 0000000..4295f3f Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png new file mode 100644 index 0000000..647af1d Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-40.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-40.png new file mode 100644 index 0000000..cd8bef8 Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-40.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png new file mode 100644 index 0000000..89dd2fc Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png new file mode 100644 index 0000000..dbfe305 Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png new file mode 100644 index 0000000..dbfe305 Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png new file mode 100644 index 0000000..a5aa9ec Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-76.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-76.png new file mode 100644 index 0000000..4bdb9f8 Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-76.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png new file mode 100644 index 0000000..0581abb Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png differ diff --git a/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png new file mode 100644 index 0000000..9c0d93b Binary files /dev/null and b/FinDemo/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png differ diff --git a/demo/Assets.xcassets/Contents.json b/FinDemo/Assets.xcassets/Contents.json similarity index 100% rename from demo/Assets.xcassets/Contents.json rename to FinDemo/Assets.xcassets/Contents.json diff --git a/demo/Base.lproj/LaunchScreen.storyboard b/FinDemo/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from demo/Base.lproj/LaunchScreen.storyboard rename to FinDemo/Base.lproj/LaunchScreen.storyboard diff --git a/FinDemo/Base.lproj/Main.storyboard b/FinDemo/Base.lproj/Main.storyboard new file mode 100644 index 0000000..808a21c --- /dev/null +++ b/FinDemo/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FinDemo/Info.plist b/FinDemo/Info.plist new file mode 100644 index 0000000..35f9292 --- /dev/null +++ b/FinDemo/Info.plist @@ -0,0 +1,82 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLName + weixin + CFBundleURLSchemes + + wx85663af68a0cbbc8 + + + + CFBundleVersion + 1 + LSApplicationQueriesSchemes + + weixin + weixinULAPI + + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + NSBluetoothPeripheralUsageDescription + 是否允许【FinApplet】使用蓝牙? + NSCalendarsUsageDescription + 是否允许【FinApplet】使用日历? + NSCameraUsageDescription + 是否允许【FinApplet】使用你的相机? + NSContactsUsageDescription + 开启同步通讯录信息,可智能补全客户资料。如果系统提示确认权限,请点击“好”。 + NSLocationAlwaysUsageDescription + 我们需要通过您的地理位置信息获取您周边的相关数据 + NSLocationWhenInUseUsageDescription + 我们需要通过您的地理位置信息获取您周边的相关数据 + NSMicrophoneUsageDescription + 是否允许【FinApplet】使用你的麦克风? + NSPhotoLibraryUsageDescription + 是否允许【FinApplet】使用语相册? + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/FinDemo/ViewController.h b/FinDemo/ViewController.h new file mode 100644 index 0000000..3d8e6a0 --- /dev/null +++ b/FinDemo/ViewController.h @@ -0,0 +1,14 @@ +// +// ViewController.h +// FinDemo +// +// Created by 胡健辉 on 2023/5/29. +// + +#import + +@interface ViewController : UITableViewController + + +@end + diff --git a/FinDemo/ViewController.m b/FinDemo/ViewController.m new file mode 100644 index 0000000..7ad123b --- /dev/null +++ b/FinDemo/ViewController.m @@ -0,0 +1,61 @@ +// +// ViewController.m +// FinDemo +// +// Created by 胡健辉 on 2023/5/29. +// + +#import "ViewController.h" + +@interface ViewController () +@property (nonatomic, strong) NSMutableArray *dataArray; + +@end + +@implementation ViewController + +static NSString *cellID = @"cellid"; + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.dataArray = @[ + @{@"title" : @"打开小程序", @"class" : @"FinStartAppletViewController"}, + @{@"title" : @"日志管理", @"class" : @"FinManageViewController"}, + @{@"title" : @"UI样式自定义", @"class" : @"FinCustomUIViewController"}, + @{@"title" : @"api自定义", @"class" : @"FinCustomApiViewController"}, +// @{@"title" : @"", @"class" : @""}, + ].mutableCopy; + [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:cellID]; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return 40; +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.dataArray.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + NSDictionary *dic = self.dataArray[indexPath.row]; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; + cell.textLabel.text = dic[@"title"]; + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + NSDictionary *dic = self.dataArray[indexPath.row]; + UIViewController *vc = [NSClassFromString(dic[@"class"]) new]; + vc.title = dic[@"title"]; + if (vc) { + [self.navigationController pushViewController:vc animated:YES]; + } +} + + +@end diff --git a/demo/main.m b/FinDemo/main.m similarity index 79% rename from demo/main.m rename to FinDemo/main.m index 7514bf5..b64d040 100644 --- a/demo/main.m +++ b/FinDemo/main.m @@ -1,9 +1,8 @@ // // main.m -// demo +// FinDemo // -// Created by 杨涛 on 2020/2/6. -// Copyright © 2020 finogeeks. All rights reserved. +// Created by 胡健辉 on 2023/5/29. // #import diff --git a/FinDemo/功能演示/1.打开小程序/1.普通打开小程序/FinNormalStartViewController.h b/FinDemo/功能演示/1.打开小程序/1.普通打开小程序/FinNormalStartViewController.h new file mode 100644 index 0000000..e71f72f --- /dev/null +++ b/FinDemo/功能演示/1.打开小程序/1.普通打开小程序/FinNormalStartViewController.h @@ -0,0 +1,16 @@ +// +// FinNormalStartViewController.h +// FinDemo +// +// Created by 胡健辉 on 2023/5/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FinNormalStartViewController : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/FinDemo/功能演示/1.打开小程序/1.普通打开小程序/FinNormalStartViewController.m b/FinDemo/功能演示/1.打开小程序/1.普通打开小程序/FinNormalStartViewController.m new file mode 100644 index 0000000..bd43842 --- /dev/null +++ b/FinDemo/功能演示/1.打开小程序/1.普通打开小程序/FinNormalStartViewController.m @@ -0,0 +1,37 @@ +// +// FinNormalStartViewController.m +// FinDemo +// +// Created by 胡健辉 on 2023/5/30. +// + +#import "FinNormalStartViewController.h" +#import + +@interface FinNormalStartViewController () + +@end + +@implementation FinNormalStartViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.view.backgroundColor = UIColor.whiteColor; + UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 300, 40)]; + [button setTitle: NSLocalizedString(@"打开小程序", nil) forState:UIControlStateNormal]; + [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + [button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:button]; + button.center = self.view.center; + +} + +- (void)click { + FATAppletRequest *request = [[FATAppletRequest alloc] init]; + request.appletId = @"5f72e3559a6a7900019b5baa";//微信官方小程序 + + [[FATClient sharedClient] startAppletWithRequest:request InParentViewController:self completion:nil closeCompletion:nil]; +} + +@end diff --git a/FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinQRCodeScanViewController.h b/FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinQRCodeScanViewController.h new file mode 100644 index 0000000..4345a39 --- /dev/null +++ b/FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinQRCodeScanViewController.h @@ -0,0 +1,35 @@ +// +// FinQRCodeScanViewController.h +// FinDemo +// +// Created by 胡健辉 on 2023/5/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +typedef void(^ScanCompletion)(NSString *qrcode); + +@interface FinQRCodeScanViewController : UIViewController +@property (nonatomic, copy) ScanCompletion scanCompletion; + +@end + +@interface FinQRScanView : UIView + +@property (nonatomic, assign) CGFloat scanner_width; +@property (nonatomic, assign) CGFloat scanner_x; +@property (nonatomic, assign) CGFloat scanner_y; + +- (void)p_startScannerLineAnimation; + +- (void)p_pauseScannerLineAnimation; + +- (void)p_addActivityIndicator; + +- (void)p_removeActivityIndicator; + +@end + + +NS_ASSUME_NONNULL_END diff --git a/demo/Scan/View/FCQRScanView.m b/FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinQRCodeScanViewController.m similarity index 52% rename from demo/Scan/View/FCQRScanView.m rename to FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinQRCodeScanViewController.m index a4dd11d..22f7e5f 100644 --- a/demo/Scan/View/FCQRScanView.m +++ b/FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinQRCodeScanViewController.m @@ -1,12 +1,225 @@ // -// FCQRScanView.m -// FinoSprite +// FinQRCodeScanViewController.m +// FinDemo // -// Created by Haley on 2019/12/6. -// Copyright © 2019 finogeeks. All rights reserved. +// Created by 胡健辉 on 2023/5/30. // -#import "FCQRScanView.h" +#import "FinQRCodeScanViewController.h" + +#import +#import +#import + +@interface FinQRCodeScanViewController () +@property (nonatomic, strong) AVCaptureSession *session; + +@property (nonatomic, strong) FinQRScanView *scanView; +@end + +@implementation FinQRCodeScanViewController + + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + + [self p_initNavigationBar]; + + [self p_addNotifications]; + + [self p_initSubView]; + + [self p_checkCameraStatus:^(BOOL granted) { + if (granted) { + [self p_initCameraSession]; + } else { + [self p_showAlert:@"请在”设置-隐私-相机”选项中,允许访问你的相机" btnTitle:@"确定"]; + } + }]; +} + +- (void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + + [self p_resumeScanning]; +} + +- (void)viewWillDisappear:(BOOL)animated +{ + [super viewWillDisappear:animated]; + [self p_pauseScanning]; +} + +#pragma mark - ovverride +- (void)updateNavigationBar +{ + self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; + [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}]; + self.navigationController.navigationBar.barTintColor = [UIColor blackColor]; + + [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; + + [self.navigationController setNavigationBarHidden:NO animated:YES]; +} + +#pragma mark - private methods +- (void)p_initNavigationBar +{ + self.title = @"扫一扫"; +} + +- (void)p_addNotifications +{ + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillResignActive) name:UIApplicationWillResignActiveNotification object:nil]; +} + +- (void)p_initSubView +{ + self.view.backgroundColor = [UIColor blackColor]; + + [self.view addSubview:self.scanView]; +} + +- (void)p_initCameraSession +{ + AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; + if (!device) { + return; + } + + AVCaptureDeviceInput *deviceInput = [AVCaptureDeviceInput deviceInputWithDevice:device error:nil]; + if (!deviceInput) { + return; + } + + AVCaptureMetadataOutput *metadataOutput = [[AVCaptureMetadataOutput alloc] init]; + [metadataOutput setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()]; + + // 配置扫描区域 + metadataOutput.rectOfInterest = CGRectMake(_scanView.scanner_y / self.view.frame.size.height, _scanView.scanner_x / self.view.frame.size.width, _scanView.scanner_width / self.view.frame.size.height, _scanView.scanner_width / self.view.frame.size.width); + + self.session = [[AVCaptureSession alloc] init]; + + [self.session canSetSessionPreset:AVCaptureSessionPresetHigh]; + if ([self.session canAddInput:deviceInput]) { + [self.session addInput:deviceInput]; + } + + if ([self.session canAddOutput:metadataOutput]) { + [self.session addOutput:metadataOutput]; + } + + metadataOutput.metadataObjectTypes = @[AVMetadataObjectTypeQRCode]; + + AVCaptureVideoPreviewLayer *videoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.session]; + videoPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill; + videoPreviewLayer.frame = self.view.layer.bounds; + [self.view.layer insertSublayer:videoPreviewLayer atIndex:0]; + + [self.session startRunning]; +} + +- (void)p_showAlert:(NSString *)title btnTitle:(NSString *)btnTitle +{ + UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:title style:UIAlertActionStyleCancel handler:nil]; + [alertVC addAction:cancelAction]; + [self presentViewController:alertVC animated:YES completion:nil]; +} + +- (void)p_checkCameraStatus:(void (^)(BOOL granted))completion +{ + AVAuthorizationStatus cameraStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; + + switch (cameraStatus) { + case AVAuthorizationStatusAuthorized: + { + if (completion) { + completion(true); + } + } + break; + case AVAuthorizationStatusNotDetermined: + { + if (completion) { + completion(true); + } + } + break; + default: + { + if (completion) { + completion(false); + } + } + break; + } +} + +/// 恢复扫一扫功能 +- (void)p_resumeScanning +{ + [self.session startRunning]; + [self.scanView p_startScannerLineAnimation]; +} + +/// 暂停扫一扫功能 +- (void)p_pauseScanning +{ + [self.session stopRunning]; + [self.scanView p_pauseScannerLineAnimation]; +} + +#pragma mark - QRCode handler +- (void)handleQrCode:(NSString *)qrCode +{ + [self.navigationController popViewControllerAnimated:YES]; + + if (self.scanCompletion) { + self.scanCompletion(qrCode); + } +} + +#pragma mark - notification handler +- (void)appDidBecomeActive +{ + [self p_resumeScanning]; +} + +- (void)appWillResignActive +{ + [self p_pauseScanning]; +} + +#pragma mark - AVCaptureMetadataOutputObjectsDelegate +-(void)captureOutput:(AVCaptureOutput *)output didOutputMetadataObjects:(NSArray<__kindof AVMetadataObject *> *)metadataObjects fromConnection:(AVCaptureConnection *)connection +{ + if (metadataObjects != nil && metadataObjects.count > 0) { + + [self p_pauseScanning]; + + AVMetadataMachineReadableCodeObject *obj = metadataObjects[0]; + [self handleQrCode:[obj stringValue]]; + } else { + + } +} + +#pragma mark - setter && getter + +- (FinQRScanView *)scanView +{ + if (!_scanView) { + _scanView = [[FinQRScanView alloc] initWithFrame:self.view.bounds]; + } + return _scanView; +} + +@end const CGFloat scanner_borderWidth = 1.0; /** 扫描器边框宽度 */ const CGFloat scanner_cornerWidth = 3.0; /** 扫描器棱角宽度 */ @@ -16,7 +229,7 @@ const CGFloat tipLab_height = 50.0; /** 扫描器下方提示文字高度 */ static NSString *scannerLineAnmationKey = @"ScannerLineAnmationKey"; /** 扫描线条动画Key值 */ -@interface FCQRScanView () +@interface FinQRScanView () @property (nonatomic, strong) UIColor *scannerBorderColor; @@ -30,7 +243,7 @@ static NSString *scannerLineAnmationKey = @"ScannerLineAnmationKey"; /** 扫描 @end -@implementation FCQRScanView +@implementation FinQRScanView - (instancetype)initWithFrame:(CGRect)frame { diff --git a/FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinScanStartViewController.h b/FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinScanStartViewController.h new file mode 100644 index 0000000..b3c5eb5 --- /dev/null +++ b/FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinScanStartViewController.h @@ -0,0 +1,16 @@ +// +// FinScanStartViewController.h +// FinDemo +// +// Created by 胡健辉 on 2023/5/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FinScanStartViewController : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinScanStartViewController.m b/FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinScanStartViewController.m new file mode 100644 index 0000000..8934a44 --- /dev/null +++ b/FinDemo/功能演示/1.打开小程序/2.扫码打开小程序/FinScanStartViewController.m @@ -0,0 +1,46 @@ +// +// FinScanStartViewController.m +// FinDemo +// +// Created by 胡健辉 on 2023/5/30. +// + +#import "FinScanStartViewController.h" +#import +#import "FinQRCodeScanViewController.h" + +@interface FinScanStartViewController () + +@end + +@implementation FinScanStartViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.view.backgroundColor = UIColor.whiteColor; + UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 300, 40)]; + [button setTitle: NSLocalizedString(@"打开小程序", nil) forState:UIControlStateNormal]; + [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + [button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:button]; + button.center = self.view.center; + +} + +- (void)click { + FinQRCodeScanViewController *scanVC = [[FinQRCodeScanViewController alloc] init]; + scanVC.scanCompletion = ^(NSString *qrcode) { + if (![qrcode containsString:@"/runtime/applet/"]) { + NSLog(@"不能识别的二维码"); + return; + } + FATAppletQrCodeRequest *req = [FATAppletQrCodeRequest new]; + req.qrCode = qrcode; + [[FATClient sharedClient] startAppletWithQrCodeRequest:req inParentViewController:self requestBlock:nil completion:nil closeCompletion:nil]; + }; + [self.navigationController pushViewController:scanVC animated:YES]; +} + + +@end diff --git a/FinDemo/功能演示/1.打开小程序/FinStartAppletViewController.h b/FinDemo/功能演示/1.打开小程序/FinStartAppletViewController.h new file mode 100644 index 0000000..21b89fc --- /dev/null +++ b/FinDemo/功能演示/1.打开小程序/FinStartAppletViewController.h @@ -0,0 +1,16 @@ +// +// FinStartAppletViewController.h +// FinDemo +// +// Created by 胡健辉 on 2023/5/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FinStartAppletViewController : UITableViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/FinDemo/功能演示/1.打开小程序/FinStartAppletViewController.m b/FinDemo/功能演示/1.打开小程序/FinStartAppletViewController.m new file mode 100644 index 0000000..43758e5 --- /dev/null +++ b/FinDemo/功能演示/1.打开小程序/FinStartAppletViewController.m @@ -0,0 +1,58 @@ +// +// FinStartAppletViewController.m +// FinDemo +// +// Created by 胡健辉 on 2023/5/29. +// + +#import "FinStartAppletViewController.h" + +@interface FinStartAppletViewController () +@property (nonatomic, strong) NSMutableArray *dataArray; + +@end + +@implementation FinStartAppletViewController + +static NSString *cellID = @"cellid"; + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.dataArray = @[ + @{@"title" : @"普通打开小程序", @"class" : @"FinNormalStartViewController"}, + @{@"title" : @"扫码打开小程序", @"class" : @"FinScanStartViewController"}, + ].mutableCopy; + [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:cellID]; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return 40; +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.dataArray.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + NSDictionary *dic = self.dataArray[indexPath.row]; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; + cell.textLabel.text = dic[@"title"]; + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + NSDictionary *dic = self.dataArray[indexPath.row]; + UIViewController *vc = [NSClassFromString(dic[@"class"]) new]; + vc.title = dic[@"title"]; + if (vc) { + [self.navigationController pushViewController:vc animated:YES]; + } +} + + +@end diff --git a/FinDemo/功能演示/2.日志管理/FinManageViewController.h b/FinDemo/功能演示/2.日志管理/FinManageViewController.h new file mode 100644 index 0000000..88b8be8 --- /dev/null +++ b/FinDemo/功能演示/2.日志管理/FinManageViewController.h @@ -0,0 +1,16 @@ +// +// FinManageViewController.h +// FinDemo +// +// Created by 胡健辉 on 2023/5/29. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FinManageViewController : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/FinDemo/功能演示/2.日志管理/FinManageViewController.m b/FinDemo/功能演示/2.日志管理/FinManageViewController.m new file mode 100644 index 0000000..720ecde --- /dev/null +++ b/FinDemo/功能演示/2.日志管理/FinManageViewController.m @@ -0,0 +1,66 @@ +// +// FinManageViewController.m +// FinDemo +// +// Created by 胡健辉 on 2023/5/29. +// + +#import "FinManageViewController.h" +#import + +@interface FinManageViewController () + +@end + +@implementation FinManageViewController + +- (instancetype)init { + if (self = [super init]) { + NSArray *patchs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *documentsDirectory = [patchs objectAtIndex:0]; + NSString *logDir = [documentsDirectory stringByAppendingPathComponent:@"ABC_FinClip_LogFiles"]; + + //开启不同level的日志可以看到不同的log + [[FATClient sharedClient].logManager initLogWithLogDir:logDir logLevel:FATLogLevelDebug consoleLog:YES]; + + //也可以通过这个api打开vconsole查看js的输出 + [FATClient sharedClient].config.enableAppletDebug = FATBOOLStateTrue; + + //如果想自行收集log,实现该代理即可。 + //[FATClient sharedClient].logDelegate = self; + } + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.view.backgroundColor = UIColor.whiteColor; + UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 300, 40)]; + [button setTitle: NSLocalizedString(@"打开小程序", nil) forState:UIControlStateNormal]; + [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + [button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:button]; + button.center = self.view.center; + +} + +- (void)click { + FATAppletRequest *request = [[FATAppletRequest alloc] init]; + request.appletId = @"5f72e3559a6a7900019b5baa";//微信官方小程序 + + [[FATClient sharedClient] startAppletWithRequest:request InParentViewController:self completion:nil closeCompletion:nil]; +} + +- (void)logMessage:(NSString *)message { + NSLog(@"logMessage:%@", message); +} + +- (void)dealloc { + //关闭log + [[FATClient sharedClient].logManager closeLog]; + + //关闭vconsole + [FATClient sharedClient].config.enableAppletDebug = FATBOOLStateUndefined; +} +@end diff --git a/FinDemo/功能演示/3.UI样式自定义/FinCustomUIViewController.h b/FinDemo/功能演示/3.UI样式自定义/FinCustomUIViewController.h new file mode 100644 index 0000000..19a61b1 --- /dev/null +++ b/FinDemo/功能演示/3.UI样式自定义/FinCustomUIViewController.h @@ -0,0 +1,19 @@ +// +// FinCustomUIViewController.h +// FinDemo +// +// Created by 胡健辉 on 2023/5/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FinCustomUIViewController : UIViewController + +@end + + + + +NS_ASSUME_NONNULL_END diff --git a/FinDemo/功能演示/3.UI样式自定义/FinCustomUIViewController.m b/FinDemo/功能演示/3.UI样式自定义/FinCustomUIViewController.m new file mode 100644 index 0000000..5787153 --- /dev/null +++ b/FinDemo/功能演示/3.UI样式自定义/FinCustomUIViewController.m @@ -0,0 +1,68 @@ +// +// FinCustomUIViewController.m +// FinDemo +// +// Created by 胡健辉 on 2023/5/30. +// + +#import "FinCustomUIViewController.h" +#import + +//需要继承FATBaseLoadingView +@interface LoadingView : FATBaseLoadingView + +@end + +@implementation LoadingView + +- (void)layoutSubviews { + [super layoutSubviews]; + + //修改小程序标题的颜色 + self.titleLabel.textColor = [UIColor redColor]; + + //修改loading页的logo + self.loadingView.iconImageView.image = [UIImage imageNamed:@"AppIcon"]; +} +@end + + +@implementation FinCustomUIViewController +/* + 详情参考https://www.finclip.com/mop/document/runtime-sdk/custom-ui/set-loading.html + */ +- (instancetype)init { + if (self = [super init]) { + //自定义loading页面的样式 + [FATClient sharedClient].config.baseLoadingViewClass = @"LoadingView"; + } + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.view.backgroundColor = UIColor.whiteColor; + UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 300, 40)]; + [button setTitle: NSLocalizedString(@"打开小程序", nil) forState:UIControlStateNormal]; + [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + [button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:button]; + button.center = self.view.center; + +} + +- (void)click { + FATAppletRequest *request = [[FATAppletRequest alloc] init]; + request.appletId = @"5f72e3559a6a7900019b5baa";//微信官方小程序 + + [[FATClient sharedClient] startAppletWithRequest:request InParentViewController:self completion:nil closeCompletion:nil]; +} + +- (void)dealloc { + //取消自定义样式 + [FATClient sharedClient].config.baseLoadingViewClass = nil; +} + +@end + diff --git a/FinDemo/功能演示/4.api自定义/FinCustomApiViewController.h b/FinDemo/功能演示/4.api自定义/FinCustomApiViewController.h new file mode 100644 index 0000000..a3dacfa --- /dev/null +++ b/FinDemo/功能演示/4.api自定义/FinCustomApiViewController.h @@ -0,0 +1,16 @@ +// +// FinCustomApiViewController.h +// FinDemo +// +// Created by 胡健辉 on 2023/5/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FinCustomApiViewController : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/FinDemo/功能演示/4.api自定义/FinCustomApiViewController.m b/FinDemo/功能演示/4.api自定义/FinCustomApiViewController.m new file mode 100644 index 0000000..ee74ded --- /dev/null +++ b/FinDemo/功能演示/4.api自定义/FinCustomApiViewController.m @@ -0,0 +1,71 @@ +// +// FinCustomApiViewController.m +// FinDemo +// +// Created by 胡健辉 on 2023/5/30. +// + +#import "FinCustomApiViewController.h" +#import + +@interface FinCustomApiViewController () + +@end + +@implementation FinCustomApiViewController + +/* + 有时候我们需要app提供超出微信小程序体系的能力,能可以通过自定义api提供。 + + 详细教程可以参考https://www.finclip.com/mop/document/runtime-sdk/ios/api/api-custom.html#_1-1-%E6%B3%A8%E5%86%8C%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%BC%82%E6%AD%A5api + */ + +- (instancetype)init { + if (self = [super init]) { + //注册自定义api(异步)。param是入参 + [[FATClient sharedClient] registerExtensionApi:@"finclipLogin" handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) { + NSLog(@"自定义api入参:%@", param); + + //出参 + NSDictionary *outParam = @{ + @"token" : @"abcdefg", + @"name" : @"小明", + @"url" : [NSString stringWithFormat:@"这是新的url:%@", param[@"url"]?:@""] + }; + + //返回成功和出参 + callback(FATExtensionCodeSuccess, outParam); + }]; + + + //可以打开vconsole观看小程序的log输出 + [FATClient sharedClient].config.enableAppletDebug = FATBOOLStateTrue; + } + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.view.backgroundColor = UIColor.whiteColor; + UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 300, 40)]; + [button setTitle: NSLocalizedString(@"打开小程序", nil) forState:UIControlStateNormal]; + [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + [button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:button]; + button.center = self.view.center; + +} + +- (void)click { + FATAppletRequest *request = [[FATAppletRequest alloc] init]; + request.appletId = @"64756ffed21d34000194b307";//小程序代码可见finclipLogin.zip + + [[FATClient sharedClient] startAppletWithRequest:request InParentViewController:self completion:nil closeCompletion:nil]; +} + +- (void)dealloc { + //关闭vconsole + [FATClient sharedClient].config.enableAppletDebug = FATBOOLStateUndefined; +} +@end diff --git a/FinDemo/功能演示/4.api自定义/finclipLogin.zip b/FinDemo/功能演示/4.api自定义/finclipLogin.zip new file mode 100644 index 0000000..f169e0f Binary files /dev/null and b/FinDemo/功能演示/4.api自定义/finclipLogin.zip differ diff --git a/FinDemo/功能演示/5.代理方法/FinDelegateViewController.h b/FinDemo/功能演示/5.代理方法/FinDelegateViewController.h new file mode 100644 index 0000000..6363bfd --- /dev/null +++ b/FinDemo/功能演示/5.代理方法/FinDelegateViewController.h @@ -0,0 +1,16 @@ +// +// FinDelegateViewController.h +// FinDemo +// +// Created by 胡健辉 on 2023/5/30. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FinDelegateViewController : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/FinDemo/功能演示/5.代理方法/FinDelegateViewController.m b/FinDemo/功能演示/5.代理方法/FinDelegateViewController.m new file mode 100644 index 0000000..a827dc6 --- /dev/null +++ b/FinDemo/功能演示/5.代理方法/FinDelegateViewController.m @@ -0,0 +1,116 @@ +// +// FinDelegateViewController.m +// FinDemo +// +// Created by 胡健辉 on 2023/5/30. +// + +#import "FinDelegateViewController.h" +#import + +@interface FinDelegateViewController () + +@end + +@implementation FinDelegateViewController + +- (instancetype)init { + if (self = [super init]) { + //设置FATAppletLifeCycleDelegate代理 + [FATClient sharedClient].lifeCycleDelegate = self; + } + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.view.backgroundColor = UIColor.whiteColor; + UIButton * button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 300, 40)]; + [button setTitle: NSLocalizedString(@"打开小程序", nil) forState:UIControlStateNormal]; + [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; + [button addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:button]; + button.center = self.view.center; + +} + +- (void)click { + FATAppletRequest *request = [[FATAppletRequest alloc] init]; + request.appletId = @"5f72e3559a6a7900019b5baa";//微信官方小程序 + + [[FATClient sharedClient] startAppletWithRequest:request InParentViewController:self completion:nil closeCompletion:nil]; +} + +#pragma mark 小程序生命周期 ------------------------------ +/** + 小程序打开完成的事件 + @param appletInfo 小程序info + @param error 错误对象 + */ +- (void)appletInfo:(FATAppletInfo *)appletInfo didOpenCompletion:(NSError *)error { + NSLog(@"小程序打开完成的事件"); + NSLog(@"%@", NSStringFromSelector(_cmd)); +} + +/** + 小程序关闭完成的事件 + @param appletInfo 小程序info + @param error 错误对象 + */ +- (void)appletInfo:(FATAppletInfo *)appletInfo didCloseCompletion:(NSError *)error { + NSLog(@"小程序关闭完成的事件"); + NSLog(@"%@", NSStringFromSelector(_cmd)); +} + +/** + 小程序初始化完成,冷启动时首页显示出来的事件 + @param appletInfo 小程序info + @param error 错误对象 + */ +- (void)appletInfo:(FATAppletInfo *)appletInfo initCompletion:(NSError *)error { + NSLog(@"小程序初始化完成"); + NSLog(@"%@", NSStringFromSelector(_cmd)); +} + +/** + 小程序进入活跃状态的事件 + @param appletInfo 小程序info + @param error 错误对象 + */ +- (void)appletInfo:(FATAppletInfo *)appletInfo didActive:(NSError *)error { + NSLog(@"小程序进入活跃状态的事件"); + NSLog(@"%@", NSStringFromSelector(_cmd)); +} + +/** + 小程序进入非活跃状态的事件 + @param appletInfo 小程序info + @param error 错误对象 + */ +- (void)appletInfo:(FATAppletInfo *)appletInfo resignActive:(NSError *)error { + NSLog(@"小程序进入非活跃状态的事件"); + NSLog(@"%@", NSStringFromSelector(_cmd)); +} + +/** + 小程序出错的事件 + @param appletInfo 小程序info + @param error 错误对象 + */ +- (void)appletInfo:(FATAppletInfo *)appletInfo didFail:(NSError *)error { + NSLog(@"小程序出错的事件"); + NSLog(@"%@", NSStringFromSelector(_cmd)); +} + +/** + 小程序被销毁的事件 + @param appletInfo 小程序info + @param error 错误对象 + */ +- (void)appletInfo:(FATAppletInfo *)appletInfo dealloc:(NSError *)error { + NSLog(@"小程序被销毁的事件"); + NSLog(@"%@", NSStringFromSelector(_cmd)); +} + +@end diff --git a/Podfile b/Podfile old mode 100644 new mode 100755 index d834fa3..e4cc37b --- a/Podfile +++ b/Podfile @@ -1,19 +1,17 @@ -platform :ios, "9.0" +source 'https://github.com/CocoaPods/Specs.git' +#国内的源 +#source 'https://cdn.cocoapods.org/' -source 'https://cdn.cocoapods.org/' +target 'FinDemo' do + #FinClip核心SDK,必集成(其他子SDK都是可选)。最低支持iOS9.0系统 + #pod 'FinApplet' -inhibit_all_warnings! + #如小程序中用到chooseLocation、getLocation、openLocation、choosePoi、startRecord、stopRecord、RecorderManager这些api,可集成该子SDK + #pod 'FinAppletExt' + -target "demo" do - pod 'FinApplet' - pod 'FinAppletExt' - pod 'FinAppletWebRTC' - pod 'FinAppletBDMap' - pod 'FinAppletGDMap' - pod 'FinAppletBLE' - pod 'WechatOpenSDK' + + end - -# \ No newline at end of file diff --git a/demo.xcodeproj/project.pbxproj b/demo.xcodeproj/project.pbxproj deleted file mode 100644 index c72999f..0000000 --- a/demo.xcodeproj/project.pbxproj +++ /dev/null @@ -1,498 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 9DD565BE23EC45080011FC4A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DD565BD23EC45080011FC4A /* AppDelegate.m */; }; - 9DD565C423EC45080011FC4A /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DD565C323EC45080011FC4A /* MainViewController.m */; }; - 9DD565C923EC450A0011FC4A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9DD565C823EC450A0011FC4A /* Assets.xcassets */; }; - 9DD565CC23EC450A0011FC4A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9DD565CA23EC450A0011FC4A /* LaunchScreen.storyboard */; }; - 9DD565CF23EC450A0011FC4A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DD565CE23EC450A0011FC4A /* main.m */; }; - A0E041B926CE6DAD00D58D47 /* demo.plist in Resources */ = {isa = PBXBuildFile; fileRef = A0E041B826CE6DAD00D58D47 /* demo.plist */; }; - A0E041BD26CE720900D58D47 /* servers.plist in Resources */ = {isa = PBXBuildFile; fileRef = A0E041BC26CE720900D58D47 /* servers.plist */; }; - A823321F258C3B7000C1B2D5 /* FINDemoClientHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = A823321D258C3B7000C1B2D5 /* FINDemoClientHelper.m */; }; - A863B745257A09A300959AA1 /* FINExtensionHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = A863B744257A09A300959AA1 /* FINExtensionHelper.m */; }; - A8BC097A258BA095001289A3 /* FINCustomMenuModel.m in Sources */ = {isa = PBXBuildFile; fileRef = A8BC0979258BA095001289A3 /* FINCustomMenuModel.m */; }; - A8CE73562810F8C800965B7E /* FCQRCodeScanViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A8CE73512810F8C800965B7E /* FCQRCodeScanViewController.m */; }; - A8CE73572810F8C800965B7E /* FCQRScanView.m in Sources */ = {isa = PBXBuildFile; fileRef = A8CE73542810F8C800965B7E /* FCQRScanView.m */; }; - FBF7F422A6EA50C856DB84F7 /* libPods-demo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 28A582EE796CD12C1FF4F5DB /* libPods-demo.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 28A582EE796CD12C1FF4F5DB /* libPods-demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-demo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3F2BFD149B6F799A303A07B3 /* Pods-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.release.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.release.xcconfig"; sourceTree = ""; }; - 9DD565B923EC45080011FC4A /* demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 9DD565BC23EC45080011FC4A /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 9DD565BD23EC45080011FC4A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9DD565C223EC45080011FC4A /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; - 9DD565C323EC45080011FC4A /* MainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; - 9DD565C823EC450A0011FC4A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 9DD565CB23EC450A0011FC4A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 9DD565CD23EC450A0011FC4A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9DD565CE23EC450A0011FC4A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - A0E041B826CE6DAD00D58D47 /* demo.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = demo.plist; sourceTree = ""; }; - A0E041BC26CE720900D58D47 /* servers.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = servers.plist; sourceTree = ""; }; - A823321D258C3B7000C1B2D5 /* FINDemoClientHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FINDemoClientHelper.m; sourceTree = ""; }; - A823321E258C3B7000C1B2D5 /* FINDemoClientHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FINDemoClientHelper.h; sourceTree = ""; }; - A863B743257A09A200959AA1 /* FINExtensionHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FINExtensionHelper.h; sourceTree = ""; }; - A863B744257A09A300959AA1 /* FINExtensionHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FINExtensionHelper.m; sourceTree = ""; }; - A8BC0978258BA095001289A3 /* FINCustomMenuModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FINCustomMenuModel.h; sourceTree = ""; }; - A8BC0979258BA095001289A3 /* FINCustomMenuModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FINCustomMenuModel.m; sourceTree = ""; }; - A8CE73512810F8C800965B7E /* FCQRCodeScanViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FCQRCodeScanViewController.m; sourceTree = ""; }; - A8CE73522810F8C800965B7E /* FCQRCodeScanViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FCQRCodeScanViewController.h; sourceTree = ""; }; - A8CE73542810F8C800965B7E /* FCQRScanView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FCQRScanView.m; sourceTree = ""; }; - A8CE73552810F8C800965B7E /* FCQRScanView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FCQRScanView.h; sourceTree = ""; }; - D6278645283CC38F001270F1 /* demo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = demo.entitlements; sourceTree = ""; }; - FBEBA7E73B95B66C846E76FF /* Pods-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.debug.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 9DD565B623EC45080011FC4A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - FBF7F422A6EA50C856DB84F7 /* libPods-demo.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 9DD565B023EC45080011FC4A = { - isa = PBXGroup; - children = ( - 9DD565BB23EC45080011FC4A /* demo */, - 9DD565BA23EC45080011FC4A /* Products */, - F230DA512C0C77A07ACE5BB1 /* Pods */, - ACE3AE3120D1733A6BB38C8A /* Frameworks */, - ); - sourceTree = ""; - }; - 9DD565BA23EC45080011FC4A /* Products */ = { - isa = PBXGroup; - children = ( - 9DD565B923EC45080011FC4A /* demo.app */, - ); - name = Products; - sourceTree = ""; - }; - 9DD565BB23EC45080011FC4A /* demo */ = { - isa = PBXGroup; - children = ( - D6278645283CC38F001270F1 /* demo.entitlements */, - A8CE734B2810F3B400965B7E /* Common */, - 9DD565BC23EC45080011FC4A /* AppDelegate.h */, - 9DD565BD23EC45080011FC4A /* AppDelegate.m */, - A8CE734F2810F8C800965B7E /* Scan */, - 9DD565C223EC45080011FC4A /* MainViewController.h */, - 9DD565C323EC45080011FC4A /* MainViewController.m */, - 9DD565C823EC450A0011FC4A /* Assets.xcassets */, - 9DD565CA23EC450A0011FC4A /* LaunchScreen.storyboard */, - 9DD565CD23EC450A0011FC4A /* Info.plist */, - 9DD565CE23EC450A0011FC4A /* main.m */, - A0E041B826CE6DAD00D58D47 /* demo.plist */, - A0E041BC26CE720900D58D47 /* servers.plist */, - ); - path = demo; - sourceTree = ""; - }; - A8CE734B2810F3B400965B7E /* Common */ = { - isa = PBXGroup; - children = ( - A823321E258C3B7000C1B2D5 /* FINDemoClientHelper.h */, - A823321D258C3B7000C1B2D5 /* FINDemoClientHelper.m */, - A863B743257A09A200959AA1 /* FINExtensionHelper.h */, - A863B744257A09A300959AA1 /* FINExtensionHelper.m */, - A8BC0978258BA095001289A3 /* FINCustomMenuModel.h */, - A8BC0979258BA095001289A3 /* FINCustomMenuModel.m */, - ); - path = Common; - sourceTree = ""; - }; - A8CE734F2810F8C800965B7E /* Scan */ = { - isa = PBXGroup; - children = ( - A8CE73502810F8C800965B7E /* Controller */, - A8CE73532810F8C800965B7E /* View */, - ); - path = Scan; - sourceTree = ""; - }; - A8CE73502810F8C800965B7E /* Controller */ = { - isa = PBXGroup; - children = ( - A8CE73522810F8C800965B7E /* FCQRCodeScanViewController.h */, - A8CE73512810F8C800965B7E /* FCQRCodeScanViewController.m */, - ); - path = Controller; - sourceTree = ""; - }; - A8CE73532810F8C800965B7E /* View */ = { - isa = PBXGroup; - children = ( - A8CE73552810F8C800965B7E /* FCQRScanView.h */, - A8CE73542810F8C800965B7E /* FCQRScanView.m */, - ); - path = View; - sourceTree = ""; - }; - ACE3AE3120D1733A6BB38C8A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 28A582EE796CD12C1FF4F5DB /* libPods-demo.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - F230DA512C0C77A07ACE5BB1 /* Pods */ = { - isa = PBXGroup; - children = ( - FBEBA7E73B95B66C846E76FF /* Pods-demo.debug.xcconfig */, - 3F2BFD149B6F799A303A07B3 /* Pods-demo.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 9DD565B823EC45080011FC4A /* demo */ = { - isa = PBXNativeTarget; - buildConfigurationList = 9DD565D223EC450A0011FC4A /* Build configuration list for PBXNativeTarget "demo" */; - buildPhases = ( - E71B82096235B4713AA534F8 /* [CP] Check Pods Manifest.lock */, - 9DD565B523EC45080011FC4A /* Sources */, - 9DD565B623EC45080011FC4A /* Frameworks */, - 9DD565B723EC45080011FC4A /* Resources */, - DFB054DF507DE3B18CCCE932 /* [CP] Embed Pods Frameworks */, - 11B173FBB433EBB6C00BA0E7 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = demo; - productName = demo; - productReference = 9DD565B923EC45080011FC4A /* demo.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 9DD565B123EC45080011FC4A /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1130; - ORGANIZATIONNAME = finogeeks; - TargetAttributes = { - 9DD565B823EC45080011FC4A = { - CreatedOnToolsVersion = 11.3.1; - }; - }; - }; - buildConfigurationList = 9DD565B423EC45080011FC4A /* Build configuration list for PBXProject "demo" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 9DD565B023EC45080011FC4A; - productRefGroup = 9DD565BA23EC45080011FC4A /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 9DD565B823EC45080011FC4A /* demo */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 9DD565B723EC45080011FC4A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9DD565CC23EC450A0011FC4A /* LaunchScreen.storyboard in Resources */, - A0E041B926CE6DAD00D58D47 /* demo.plist in Resources */, - 9DD565C923EC450A0011FC4A /* Assets.xcassets in Resources */, - A0E041BD26CE720900D58D47 /* servers.plist in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 11B173FBB433EBB6C00BA0E7 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - DFB054DF507DE3B18CCCE932 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - E71B82096235B4713AA534F8 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-demo-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 9DD565B523EC45080011FC4A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9DD565C423EC45080011FC4A /* MainViewController.m in Sources */, - A823321F258C3B7000C1B2D5 /* FINDemoClientHelper.m in Sources */, - A8BC097A258BA095001289A3 /* FINCustomMenuModel.m in Sources */, - A8CE73562810F8C800965B7E /* FCQRCodeScanViewController.m in Sources */, - A863B745257A09A300959AA1 /* FINExtensionHelper.m in Sources */, - A8CE73572810F8C800965B7E /* FCQRScanView.m in Sources */, - 9DD565BE23EC45080011FC4A /* AppDelegate.m in Sources */, - 9DD565CF23EC450A0011FC4A /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 9DD565CA23EC450A0011FC4A /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 9DD565CB23EC450A0011FC4A /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 9DD565D023EC450A0011FC4A /* 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_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 = 13.2; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 9DD565D123EC450A0011FC4A /* 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_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 = 13.2; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 9DD565D323EC450A0011FC4A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FBEBA7E73B95B66C846E76FF /* Pods-demo.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = demo/demo.entitlements; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 9QCKYFU5M4; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = demo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.finogeeks.finclip.demo; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 9DD565D423EC450A0011FC4A /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3F2BFD149B6F799A303A07B3 /* Pods-demo.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_ENTITLEMENTS = demo/demo.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = 9QCKYFU5M4; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = demo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.finogeeks.finclip.demo; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = github_demo_adhoc; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 9DD565B423EC45080011FC4A /* Build configuration list for PBXProject "demo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 9DD565D023EC450A0011FC4A /* Debug */, - 9DD565D123EC450A0011FC4A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 9DD565D223EC450A0011FC4A /* Build configuration list for PBXNativeTarget "demo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 9DD565D323EC450A0011FC4A /* Debug */, - 9DD565D423EC450A0011FC4A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 9DD565B123EC45080011FC4A /* Project object */; -} diff --git a/demo/AppDelegate.m b/demo/AppDelegate.m deleted file mode 100644 index bedeaf6..0000000 --- a/demo/AppDelegate.m +++ /dev/null @@ -1,78 +0,0 @@ -// -// AppDelegate.m -// demo -// -// Created by 杨涛 on 2020/2/6. -// Copyright © 2020 finogeeks. All rights reserved. -// - -#import "AppDelegate.h" -#import "MainViewController.h" -#import "FINExtensionHelper.h" -#import "FINDemoClientHelper.h" - -#import -#import -#import - -@interface AppDelegate () - -@end - -@implementation AppDelegate - - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - - NSString *bundleId = [NSBundle mainBundle].bundleIdentifier; - NSString *path = [[NSBundle mainBundle] pathForResource:@"servers" ofType:@"plist"]; - NSDictionary *servers = [NSDictionary dictionaryWithContentsOfFile:path]; - NSArray *array = servers[bundleId]; - NSMutableArray *configs = [NSMutableArray array]; - for (NSDictionary *data in array) { - NSString *appKey = data[@"appKey"]; - NSString *appSecret = data[@"appSecret"]; - NSString *apiServer = data[@"apiServer"]; - FATApiCryptType cryptType = [data[@"cryptType"] isEqualToString:@"MD5"] ? FATApiCryptTypeMD5 : FATApiCryptTypeSM; - FATStoreConfig *storeConfig = [[FATStoreConfig alloc] init]; - storeConfig.sdkKey = appKey; - storeConfig.sdkSecret = appSecret; - storeConfig.apiServer = apiServer; - storeConfig.cryptType = cryptType; - [configs addObject:storeConfig]; - } - - FATConfig *config = [FATConfig configWithStoreConfigs:configs]; - [[FATClient sharedClient] initWithConfig:config error:nil]; - // 设置Log日志 - [[FATClient sharedClient].logManager initLogWithLogDir:nil logLevel:FATLogLevelVerbose consoleLog:YES]; - - [FATClient sharedClient].delegate = [FINDemoClientHelper sharedHelper]; - // 注入自定义api - [[FINExtensionHelper sharedHelper] registerCustomApis]; - -// // 注册百度地图 -// [FATBDMapComponent setBDMapAppKey:@"申请的key"]; -// // 注册高德地图 -// [FATGDMapComponent setGDMapAppKey:@"申请的key"]; - - // 注册微信SDK - // 调试微信登录和微信支付时,需要修改bundleId,并配置跟bundleId匹配的微信 appKey、universalLink -// [WXApi registerApp:@"微信开放sdk的key" universalLink:@"微信开放sdk的universalLink"]; - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - self.window.backgroundColor = [UIColor whiteColor]; - - MainViewController *mainVC = [[MainViewController alloc] init]; - self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:mainVC]; - [self.window makeKeyAndVisible]; - - return YES; -} - -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - return [WXApi handleOpenURL:url delegate:[FINExtensionHelper sharedHelper]]; -} - -@end diff --git a/demo/Assets.xcassets/AppIcon.appiconset/Contents.json b/demo/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d8db8d6..0000000 --- a/demo/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/demo/Assets.xcassets/minipro_list_collect.imageset/Contents.json b/demo/Assets.xcassets/minipro_list_collect.imageset/Contents.json deleted file mode 100644 index 96dd923..0000000 --- a/demo/Assets.xcassets/minipro_list_collect.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "minipro_list_collect@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "minipro_list_collect@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/demo/Assets.xcassets/minipro_list_collect.imageset/minipro_list_collect@2x.png b/demo/Assets.xcassets/minipro_list_collect.imageset/minipro_list_collect@2x.png deleted file mode 100644 index 1b517c1..0000000 Binary files a/demo/Assets.xcassets/minipro_list_collect.imageset/minipro_list_collect@2x.png and /dev/null differ diff --git a/demo/Assets.xcassets/minipro_list_collect.imageset/minipro_list_collect@3x.png b/demo/Assets.xcassets/minipro_list_collect.imageset/minipro_list_collect@3x.png deleted file mode 100644 index cf4dfb1..0000000 Binary files a/demo/Assets.xcassets/minipro_list_collect.imageset/minipro_list_collect@3x.png and /dev/null differ diff --git a/demo/Assets.xcassets/minipro_list_service.imageset/Contents.json b/demo/Assets.xcassets/minipro_list_service.imageset/Contents.json deleted file mode 100644 index 4a2d688..0000000 --- a/demo/Assets.xcassets/minipro_list_service.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "minipro_list_service@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "minipro_list_service@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/demo/Assets.xcassets/minipro_list_service.imageset/minipro_list_service@2x.png b/demo/Assets.xcassets/minipro_list_service.imageset/minipro_list_service@2x.png deleted file mode 100644 index 5b5e785..0000000 Binary files a/demo/Assets.xcassets/minipro_list_service.imageset/minipro_list_service@2x.png and /dev/null differ diff --git a/demo/Assets.xcassets/minipro_list_service.imageset/minipro_list_service@3x.png b/demo/Assets.xcassets/minipro_list_service.imageset/minipro_list_service@3x.png deleted file mode 100644 index bc2db40..0000000 Binary files a/demo/Assets.xcassets/minipro_list_service.imageset/minipro_list_service@3x.png and /dev/null differ diff --git a/demo/Common/FINCustomMenuModel.h b/demo/Common/FINCustomMenuModel.h deleted file mode 100644 index 194a608..0000000 --- a/demo/Common/FINCustomMenuModel.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// FINCustomMenuModel.h -// demo -// -// Created by Haley on 2020/12/17. -// Copyright © 2020 finogeeks. All rights reserved. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface FINCustomMenuModel : NSObject - -@end - -NS_ASSUME_NONNULL_END diff --git a/demo/Common/FINCustomMenuModel.m b/demo/Common/FINCustomMenuModel.m deleted file mode 100644 index d500264..0000000 --- a/demo/Common/FINCustomMenuModel.m +++ /dev/null @@ -1,24 +0,0 @@ -// -// FINCustomMenuModel.m -// demo -// -// Created by Haley on 2020/12/17. -// Copyright © 2020 finogeeks. All rights reserved. -// - -#import "FINCustomMenuModel.h" - -@implementation FINCustomMenuModel - -@synthesize menuId, menuIconImage, menuTitle, menuType; - -- (id)copyWithZone:(NSZone *)zone -{ - FINCustomMenuModel *model = [[FINCustomMenuModel allocWithZone:zone] init]; - model.menuId = self.menuId; - model.menuIconImage = self.menuIconImage; - model.menuTitle = self.menuTitle; - return model; -} - -@end diff --git a/demo/Common/FINDemoClientHelper.h b/demo/Common/FINDemoClientHelper.h deleted file mode 100644 index 9c77e58..0000000 --- a/demo/Common/FINDemoClientHelper.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// FINClientHelper.h -// demo -// -// Created by Haley on 2020/12/17. -// Copyright © 2020 finogeeks. All rights reserved. -// - -#import -#import - -@interface FINDemoClientHelper : NSObject - -+ (instancetype)sharedHelper; - -@end - diff --git a/demo/Common/FINDemoClientHelper.m b/demo/Common/FINDemoClientHelper.m deleted file mode 100644 index cd79cc8..0000000 --- a/demo/Common/FINDemoClientHelper.m +++ /dev/null @@ -1,127 +0,0 @@ -// -// FINClientHelper.m -// demo -// -// Created by Haley on 2020/12/17. -// Copyright © 2020 finogeeks. All rights reserved. -// - -#import "FINDemoClientHelper.h" -#import "FINCustomMenuModel.h" - -static FINDemoClientHelper *instance = nil; - -@implementation FINDemoClientHelper - -+ (instancetype)sharedHelper { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [[[self class] alloc] init]; - }); - return instance; -} - -+ (instancetype)allocWithZone:(struct _NSZone *)zone { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [super allocWithZone:zone]; - }); - return instance; -} - -- (id)copy { - return instance; -} - -#pragma mark - FATAppletDelegate -- (void)forwardAppletWithInfo:(NSDictionary *)contentInfo completion:(void (^)(FATExtensionCode, NSDictionary *))completion -{ - NSLog(@"小程序信息:%@", contentInfo); - - // 1.如果你需要将小程序转发到自己app的聊天室,那么就根据contentInfo封装成自己IM消息,然后发送。 - - // 2.如果你需要将小程序转发到自己app的朋友圈,那么就根据contentInfo,组装信息发送给后台。 -} - -/// 小程序灰度扩展参数 -/// @param appletId 小程序id -- (NSDictionary *)grayExtensionWithAppletId:(NSString *)appletId -{ - if ([appletId isEqualToString:@"5facb3a52dcbff00017469bd"]) { - return @{@"phone":@(1234567890)}; - } - - if ([appletId isEqualToString:@"5fa214a29a6a7900019b5cc1"]) { - return @{@"token":@"xxxxxtoken"}; - } - - return @{@"key1":@"value1"}; -} - -#pragma mark - more menu -/// 更多按钮中自定义的菜单,会在页面弹出菜单时调用该api -/// @param appletInfo 小程序信息 -/// @param path 页面路径 -- (NSArray> *)customMenusInApplet:(FATAppletInfo *)appletInfo atPath:(NSString *)path -{ - NSString *appletId = appletInfo.appId; - if ([appletId isEqualToString:@"5facb3a52dcbff00017469bd"]) { - FINCustomMenuModel *favModel1 = [[FINCustomMenuModel alloc] init]; - favModel1.menuId = @"1001"; - favModel1.menuTitle = @"客服"; - favModel1.menuIconImage = [UIImage imageNamed:@"minipro_list_service"]; - - return @[favModel1]; - } - - if ([appletId isEqualToString:@"5fa214a29a6a7900019b5cc1"]) { - FINCustomMenuModel *favModel2 = [[FINCustomMenuModel alloc] init]; - favModel2.menuId = @"1002"; - favModel2.menuTitle = @"收藏"; - favModel2.menuIconImage = [UIImage imageNamed:@"minipro_list_collect"]; - - return @[favModel2]; - } - - FINCustomMenuModel *favModel1 = [[FINCustomMenuModel alloc] init]; - favModel1.menuId = @"1003"; - favModel1.menuTitle = @"客服"; - favModel1.menuIconImage = [UIImage imageNamed:@"minipro_list_service"]; - - FINCustomMenuModel *favModel2 = [[FINCustomMenuModel alloc] init]; - favModel2.menuId = @"1004"; - favModel2.menuTitle = @"收藏"; - favModel2.menuIconImage = [UIImage imageNamed:@"minipro_list_collect"]; - - return @[favModel1, favModel2]; -} - -/// 点击自定义菜单时,会触发的事件 -/// @param customMenu 自定义菜单对象 -/// @param appletInfo 小程序信息 -/// @param path 当前页面路径 -- (void)customMenu:(id)customMenu inApplet:(FATAppletInfo *)appletInfo didClickAtPath:(NSString *)path -{ - NSLog(@"自定义按钮被点击"); - if ([customMenu.menuId isEqual:@"1001"]) { - NSLog(@"客服按钮被点击"); - return; - } - - if ([customMenu.menuId isEqual:@"1002"]) { - NSLog(@"收藏按钮被点击"); - // 1.获取用户id -// NSString *userId = @""; -// -// // 2.获取小程序id -// NSString *appletId = appletInfo.appId; -// -// NSDictionary *param = @{@"userId":userId,@"appletId":appletId}; - // 3.调用网络接口 -// [FINNetworkClient postParam:param completion:]; - - return; - } -} - -@end diff --git a/demo/Common/FINExtensionHelper.h b/demo/Common/FINExtensionHelper.h deleted file mode 100644 index d94c2c2..0000000 --- a/demo/Common/FINExtensionHelper.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// FINExtensionHelper.h -// finclip_custom_demo -// -// Created by Haley on 2020/12/3. -// - -#import -#import - -@interface FINExtensionHelper : NSObject - -+ (instancetype)sharedHelper; - -- (void)registerCustomApis; - -@end - diff --git a/demo/Common/FINExtensionHelper.m b/demo/Common/FINExtensionHelper.m deleted file mode 100644 index 5a2bc9d..0000000 --- a/demo/Common/FINExtensionHelper.m +++ /dev/null @@ -1,229 +0,0 @@ -// -// FINExtensionHelper.m -// finclip_custom_demo -// -// Created by Haley on 2020/12/3. -// - -#import "FINExtensionHelper.h" -#import -#import -#import -#import - -@interface FINExtensionHelper () - -// 支付时,支付的回调是异步的,故这里将小程序的回调持有,在适当的时机调用(用户可根据自己的场景自行实现自己调用的逻辑) -@property (nonatomic, copy) FATExtensionApiCallback callback; - -@end - -static FINExtensionHelper *instance = nil; - -@implementation FINExtensionHelper - -+ (instancetype)sharedHelper { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [[FINExtensionHelper alloc] init]; - }); - return instance; -} - -+ (instancetype)allocWithZone:(struct _NSZone *)zone { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [super allocWithZone:zone]; - }); - return instance; -} - -- (id)copy { - return instance; -} - -// 注入自定义api -- (void)registerCustomApis { - [[FATClient sharedClient] registerExtensionApi:@"onNative" handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) { - NSString *inputText = @"床前明月光,疑是地上霜。举头望明月,低头思故乡。"; - callback(FATExtensionCodeSuccess, @{@"text":inputText}); - }]; - - [[FATClient sharedClient] fat_registerWebApi:@"user_define_native" handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) { - NSString *inputText = @"鹅鹅鹅,曲项向天歌,白毛浮绿水,红掌拨清波。"; - callback(FATExtensionCodeSuccess, @{@"text":inputText}); - }]; - - // 注入获取用户信息 - [[FATClient sharedClient] registerExtensionApi:@"getUserProfile" handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) { - NSDictionary *userInfo = @{@"nickName":@"张三",@"avatarUrl":@"",@"gender":@1,@"country":@"中国",@"province":@"广东省",@"city":@"深圳",@"language":@"zh_CN"}; - NSDictionary *resDic = @{@"userInfo":userInfo}; - callback(FATExtensionCodeSuccess,resDic); - }]; - - // 注入登录方法 - [[FATClient sharedClient] registerExtensionApi:@"login" handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) { - // 处理小程序登录逻辑后,调用小程序回调 - // 登录成功回调示例 - NSString *wxid = appletInfo.wechatLoginInfo[@"wechatOriginId"]; - NSString *path = appletInfo.wechatLoginInfo[@"profileUrl"]; - BOOL canWXLogin = [WXApi isWXAppInstalled] && [wxid length] > 0 && [path length] > 0; - if (canWXLogin) { - self.callback = callback; - WXLaunchMiniProgramReq *req = [WXLaunchMiniProgramReq object]; - req.userName = wxid; - req.path = path; - req.miniProgramType = WXMiniProgramTypeRelease; - [WXApi sendReq:req completion:^(BOOL success) { - NSLog(@"打开微信:%d", success); - }]; - } - else { - callback(FATExtensionCodeSuccess,@{@"desc":@"登录成功"}); - } - }]; - // 注入微信支付方法 - __weak typeof(self) weakSelf = self; - [[FATClient sharedClient] registerExtensionApi:@"requestPayment" handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) { - // 支付有两种方式实现: - // 1.利用app实现支付,结果通过回调通告小程序 - [weakSelf getTestPayment:callback]; - - // 2.使用微信小程序实现支付 -// [weakSelf wechatMiniProgramPayment:appletInfo param:param callback:callback]; - }]; -} - -#pragma mark - WXPay -// 模拟向服务请求支付订单 -- (void)getTestPayment:(FATExtensionApiCallback)callback { - // 以下只是示例代码,演示自行实现的过程 - // 1.请求自己业务后台的订单信息 - // 2.调用app的微信支付功能支付 - // 3.返回支付结果给小程序 - NSString *urlString = @"https://finclip-testing.finogeeks.club/mop/wechat-auth/api/order"; - NSURL *url = [NSURL URLWithString:urlString]; - NSMutableURLRequest *requset = [NSMutableURLRequest requestWithURL:url]; - requset.HTTPMethod = @"POST"; - __weak typeof(self) weakSelf = self; - NSURLSessionTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:requset completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { - NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; - if (httpResponse.statusCode == 200) { - NSString *appId = @"wx85663af68a0cbbc8"; - NSString *partnerId = @"1600932850"; - NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil]; - NSString *prepayId = dict[@"data"][@"prepay_id"]; - NSString *nonceStr = @"5K8264ILTKCH16CQ2502SI8ZNMTM67VS"; // 随机字符串,这里就不模拟了 - UInt32 timeStamp = [[NSDate date] timeIntervalSince1970]; - NSString *text = [NSString stringWithFormat:@"%@\n%ld\n%@\n%@\n", appId, (long)timeStamp, nonceStr, prepayId]; - NSString *sign = [weakSelf sha256:text]; - PayReq *request = [[PayReq alloc] init]; - request.partnerId = partnerId; - request.prepayId = prepayId; - request.package = @"Sign=WXPay"; - request.nonceStr = nonceStr; - request.timeStamp = timeStamp; - request.sign= sign; - dispatch_async(dispatch_get_main_queue(), ^{ - [WXApi sendReq:request completion:^(BOOL success) { - if (success) { - weakSelf.callback = callback; - } else { - callback(FATExtensionCodeFailure, nil); - } - }]; - }); - return; - } - callback(FATExtensionCodeFailure, nil); - }]; - [task resume]; -} - -- (void)wechatMiniProgramPayment:(FATAppletInfo *)appletInfo - param:(NSDictionary *)param - callback:(FATExtensionApiCallback)callback -{ - NSDictionary *info = appletInfo.wechatLoginInfo; - NSString *wxid = appletInfo.wechatLoginInfo[@"wechatOriginId"]; - NSString *path = appletInfo.wechatLoginInfo[@"paymentUrl"]; - if (wxid.length == 0 || path.length == 0) { - callback(FATExtensionCodeFailure, @{@"desc":@"微信小程序关联信息异常"}); - return; - } - - NSDictionary *dataDic = param; - NSString *payString = [NSString stringWithFormat:@"?appId=%@&nonceStr=%@&package=%@&paySign=%@&signType=%@&timeStamp=%@&type=%@", dataDic[@"appId"], dataDic[@"nonceStr"], dataDic[@"package"], dataDic[@"paySign"], dataDic[@"signType"], dataDic[@"timeStamp"], dataDic[@"type"]]; - - // 需要appDelegate 里注册微信开放SDK。 - WXLaunchMiniProgramReq *launchMiniProgramReq = [WXLaunchMiniProgramReq object]; - launchMiniProgramReq.userName = wxid; - launchMiniProgramReq.path = [NSString stringWithFormat:@"%@%@", wxid, payString]; - if (appletInfo.appletVersionType == FATAppletVersionTypeRelease) { - launchMiniProgramReq.miniProgramType = WXMiniProgramTypeRelease; //正式版 - } else if (appletInfo.appletVersionType == FATAppletVersionTypeTrial) { - launchMiniProgramReq.miniProgramType = WXMiniProgramTypePreview; //体验版 - } else { - launchMiniProgramReq.miniProgramType = WXMiniProgramTypeTest; //开发版 - } - [WXApi sendReq:launchMiniProgramReq completion:^(BOOL success) { - NSLog(@"打开微信:%d", success); - if (success) { - callback(FATExtensionCodeSuccess, @{@"desc":@"支付成功"}); - return; - } - callback(FATExtensionCodeFailure, @{@"desc":@"支付失败"}); - }]; -} - -// 签名加密(正常是放在后台处理,由上面的请求接口返回 -- (NSString *)sha256:(NSString *)shaStr { - NSData *data = [shaStr dataUsingEncoding:NSUTF8StringEncoding]; - uint8_t digest[CC_SHA256_DIGEST_LENGTH]; - CC_SHA256(data.bytes, (CC_LONG)data.length, digest); - NSData *adata = [[NSData alloc] initWithBytes:digest length:CC_SHA256_DIGEST_LENGTH]; - adata = [adata base64EncodedDataWithOptions:0]; - NSString *ret = [[NSString alloc] initWithData:adata encoding:NSUTF8StringEncoding]; - return ret; -} - -#pragma mark - WXApiDelegate -//发起支付请求回调 -- (void)onReq:(BaseReq *)req { - -} - -//微信结果回调 -- (void)onResp:(BaseResp *)resp { - FATExtensionCode code = FATExtensionCodeSuccess; - if (resp.errCode != WXSuccess) { - code = FATExtensionCodeFailure; - } - if ([resp isKindOfClass:[PayResp class]]) {//支付 - self.callback(code, nil); - } - else if ([resp isKindOfClass:[WXLaunchMiniProgramResp class]]) {//打开小程序 - NSString *extMsg = ((WXLaunchMiniProgramResp *)resp).extMsg; - if (extMsg.length <= 0) { - self.callback(FATExtensionCodeFailure, nil); - } - else { - self.callback(code, [self dictionaryWithJsonString:extMsg]); - - } - } -} - -- (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString { - if (jsonString == nil) return nil; - - NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; - NSError *err; - NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&err]; - if(err) { - NSLog(@"json解析失败:%@",err); - return nil; - } - return dic; -} -@end diff --git a/demo/Info.plist b/demo/Info.plist deleted file mode 100644 index f14de6c..0000000 --- a/demo/Info.plist +++ /dev/null @@ -1,82 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLName - weixin - CFBundleURLSchemes - - wx85663af68a0cbbc8 - - - - CFBundleVersion - 1 - LSApplicationQueriesSchemes - - weixin - weixinULAPI - - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - NSBluetoothPeripheralUsageDescription - 是否允许【FinApplet】使用蓝牙? - NSCalendarsUsageDescription - 是否允许【FinApplet】使用日历? - NSCameraUsageDescription - 是否允许【FinApplet】使用你的相机? - NSContactsUsageDescription - 开启同步通讯录信息,可智能补全客户资料。如果系统提示确认权限,请点击“好”。 - NSLocationAlwaysUsageDescription - 我们需要通过您的地理位置信息获取您周边的相关数据 - NSLocationWhenInUseUsageDescription - 我们需要通过您的地理位置信息获取您周边的相关数据 - NSMicrophoneUsageDescription - 是否允许【FinApplet】使用你的麦克风? - NSPhotoLibraryUsageDescription - 是否允许【FinApplet】使用语相册? - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/demo/MainViewController.h b/demo/MainViewController.h deleted file mode 100644 index 44730f6..0000000 --- a/demo/MainViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// MainViewController.h -// demo -// -// Created by 杨涛 on 2020/2/6. -// Copyright © 2020 finogeeks. All rights reserved. -// - -#import - -@interface MainViewController : UIViewController - - -@end - diff --git a/demo/MainViewController.m b/demo/MainViewController.m deleted file mode 100644 index 5481b9d..0000000 --- a/demo/MainViewController.m +++ /dev/null @@ -1,144 +0,0 @@ -// -// MainViewController.m -// demo -// -// Created by 杨涛 on 2020/2/6. -// Copyright © 2020 finogeeks. All rights reserved. -// - -#import "MainViewController.h" -#import "FCQRCodeScanViewController.h" - -#import -#import - -@interface MainViewController () - -@property (nonatomic, strong) UITableView *tableView; - -@property (nonatomic, strong) NSMutableArray *appletList; - -@end - -@implementation MainViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view. - self.title = @"FinClip"; - - [self p_initNavigationBar]; - - [self p_loadData]; - - [self p_initSubViews]; -} - -- (void)p_initNavigationBar { - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"扫码" style:UIBarButtonItemStylePlain target:self action:@selector(scanItemClick)]; -} - -- (void)p_initSubViews { - CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width; - CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height; - - self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, screenHeight) style:UITableViewStylePlain]; - self.tableView.tableFooterView = [UIView new]; - self.tableView.delegate = self; - self.tableView.dataSource = self; - [self.view addSubview:self.tableView]; -} - -- (void)p_loadData { - // 配置小程序列表 - self.appletList = [[NSMutableArray alloc] init]; - NSString *bundleId = [NSBundle mainBundle].bundleIdentifier; - NSString *appName = [bundleId componentsSeparatedByString:@"."].lastObject; - if (![appName isEqualToString:@""]) { - NSString *path = [[NSBundle mainBundle] pathForResource:appName ofType:@"plist"]; - NSArray *array = [NSArray arrayWithContentsOfFile:path]; - for (NSDictionary *dict in array) { - [self.appletList addObject:dict]; - } - } - [self.tableView reloadData]; -} - -// 原生向小程序发送的事件 -- (void)sendCustomEvent { - if (@available(iOS 10.0, *)) { - [NSTimer scheduledTimerWithTimeInterval:3 repeats:YES block:^(NSTimer * _Nonnull timer) { - NSTimeInterval timestamp = [[NSDate date] timeIntervalSince1970]; - [[FATClient sharedClient].nativeViewManager sendCustomEventWithDetail:@{@"timestamp":@(timestamp)} completion:^(id result, NSError *error) { - NSLog(@"sendCustomEventW:%@", error); - }]; - }]; - } -} - -- (void)handleQrCode:(NSString *)qrCode -{ - NSLog(@"qrCode:%@", qrCode); - if (![qrCode containsString:@"/runtime/applet/"]) { - NSLog(@"不能识别的二维码"); - return; - } - - FATAppletQrCodeRequest *qrcodeRequest = [[FATAppletQrCodeRequest alloc] init]; - qrcodeRequest.qrCode = qrCode; - [[FATClient sharedClient] startAppletWithQrCodeRequest:qrcodeRequest inParentViewController:self requestBlock:^(BOOL result, FATError *error) { - NSLog(@"请求完成:%@", error); - } completion:^(BOOL result, FATError *error) { - NSLog(@"打开完成:%@", error); - } closeCompletion:^{ - NSLog(@"关闭"); - }]; -} - -#pragma mark - click events -- (void)scanItemClick -{ - FCQRCodeScanViewController *scanVC = [[FCQRCodeScanViewController alloc] init]; - scanVC.scanCompletion = ^(NSString *qrcode) { - [self handleQrCode:qrcode]; - }; - [self.navigationController pushViewController:scanVC animated:YES]; -} - -#pragma mark - UITableViewDataSource -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return self.appletList.count; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - static NSString *identifer = @"identifer"; - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifer]; - if (cell == nil) { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifer]; - } - - NSDictionary *dict = self.appletList[indexPath.row]; - cell.textLabel.text = dict[@"title"]; - return cell; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - - NSDictionary *dict = self.appletList[indexPath.row]; - NSString *appId = dict[@"appId"]; - NSDictionary *startParams = dict[@"startParams"]; - - FATAppletRequest *request = [[FATAppletRequest alloc] init]; - request.appletId = appId; - request.startParams = startParams; - request.apiServer = @"https://api.finclip.com"; - - [[FATClient sharedClient] startAppletWithRequest:request InParentViewController:self completion:^(BOOL result, FATError *error) { - - } closeCompletion:^{ - [[FATClient sharedClient] clearMemoryCache]; - }]; -} - -@end diff --git a/demo/Scan/Controller/FCQRCodeScanViewController.h b/demo/Scan/Controller/FCQRCodeScanViewController.h deleted file mode 100644 index 8a416ca..0000000 --- a/demo/Scan/Controller/FCQRCodeScanViewController.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// FCQRCodeScanViewController.h -// FinoSprite -// -// Created by Haley on 2019/12/6. -// Copyright © 2019 finogeeks. All rights reserved. -// - -#import - -typedef void(^ScanCompletion)(NSString *qrcode); - -@interface FCQRCodeScanViewController : UIViewController - -@property (nonatomic, copy) ScanCompletion scanCompletion; - -@end - diff --git a/demo/Scan/Controller/FCQRCodeScanViewController.m b/demo/Scan/Controller/FCQRCodeScanViewController.m deleted file mode 100644 index 2c8baf3..0000000 --- a/demo/Scan/Controller/FCQRCodeScanViewController.m +++ /dev/null @@ -1,227 +0,0 @@ -// -// FCQRCodeScanViewController.m -// FinoSprite -// -// Created by Haley on 2019/12/6. -// Copyright © 2019 finogeeks. All rights reserved. -// - -#import "FCQRCodeScanViewController.h" -#import "FCQRScanView.h" - -#import -#import -#import - -@interface FCQRCodeScanViewController () - -@property (nonatomic, strong) AVCaptureSession *session; - -@property (nonatomic, strong) FCQRScanView *scanView; - -@end - -@implementation FCQRCodeScanViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view. - - [self p_initNavigationBar]; - - [self p_addNotifications]; - - [self p_initSubView]; - - [self p_checkCameraStatus:^(BOOL granted) { - if (granted) { - [self p_initCameraSession]; - } else { - [self p_showAlert:@"请在”设置-隐私-相机”选项中,允许访问你的相机" btnTitle:@"确定"]; - } - }]; -} - -- (void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; - - [self p_resumeScanning]; -} - -- (void)viewWillDisappear:(BOOL)animated -{ - [super viewWillDisappear:animated]; - [self p_pauseScanning]; -} - -#pragma mark - ovverride -- (void)updateNavigationBar -{ - self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; - [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}]; - self.navigationController.navigationBar.barTintColor = [UIColor blackColor]; - - [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; - - [self.navigationController setNavigationBarHidden:NO animated:YES]; -} - -#pragma mark - private methods -- (void)p_initNavigationBar -{ - self.title = @"扫一扫"; -} - -- (void)p_addNotifications -{ - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillResignActive) name:UIApplicationWillResignActiveNotification object:nil]; -} - -- (void)p_initSubView -{ - self.view.backgroundColor = [UIColor blackColor]; - - [self.view addSubview:self.scanView]; -} - -- (void)p_initCameraSession -{ - AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; - if (!device) { - return; - } - - AVCaptureDeviceInput *deviceInput = [AVCaptureDeviceInput deviceInputWithDevice:device error:nil]; - if (!deviceInput) { - return; - } - - AVCaptureMetadataOutput *metadataOutput = [[AVCaptureMetadataOutput alloc] init]; - [metadataOutput setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()]; - - // 配置扫描区域 - metadataOutput.rectOfInterest = CGRectMake(_scanView.scanner_y / self.view.frame.size.height, _scanView.scanner_x / self.view.frame.size.width, _scanView.scanner_width / self.view.frame.size.height, _scanView.scanner_width / self.view.frame.size.width); - - self.session = [[AVCaptureSession alloc] init]; - - [self.session canSetSessionPreset:AVCaptureSessionPresetHigh]; - if ([self.session canAddInput:deviceInput]) { - [self.session addInput:deviceInput]; - } - - if ([self.session canAddOutput:metadataOutput]) { - [self.session addOutput:metadataOutput]; - } - - metadataOutput.metadataObjectTypes = @[AVMetadataObjectTypeQRCode]; - - AVCaptureVideoPreviewLayer *videoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.session]; - videoPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill; - videoPreviewLayer.frame = self.view.layer.bounds; - [self.view.layer insertSublayer:videoPreviewLayer atIndex:0]; - - [self.session startRunning]; -} - -- (void)p_showAlert:(NSString *)title btnTitle:(NSString *)btnTitle -{ - UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:title style:UIAlertActionStyleCancel handler:nil]; - [alertVC addAction:cancelAction]; - [self presentViewController:alertVC animated:YES completion:nil]; -} - -- (void)p_checkCameraStatus:(void (^)(BOOL granted))completion -{ - AVAuthorizationStatus cameraStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; - - switch (cameraStatus) { - case AVAuthorizationStatusAuthorized: - { - if (completion) { - completion(true); - } - } - break; - case AVAuthorizationStatusNotDetermined: - { - if (completion) { - completion(true); - } - } - break; - default: - { - if (completion) { - completion(false); - } - } - break; - } -} - -/// 恢复扫一扫功能 -- (void)p_resumeScanning -{ - [self.session startRunning]; - [self.scanView p_startScannerLineAnimation]; -} - -/// 暂停扫一扫功能 -- (void)p_pauseScanning -{ - [self.session stopRunning]; - [self.scanView p_pauseScannerLineAnimation]; -} - -#pragma mark - QRCode handler -- (void)handleQrCode:(NSString *)qrCode -{ - [self.navigationController popViewControllerAnimated:YES]; - - if (self.scanCompletion) { - self.scanCompletion(qrCode); - } -} - -#pragma mark - notification handler -- (void)appDidBecomeActive -{ - [self p_resumeScanning]; -} - -- (void)appWillResignActive -{ - [self p_pauseScanning]; -} - -#pragma mark - AVCaptureMetadataOutputObjectsDelegate --(void)captureOutput:(AVCaptureOutput *)output didOutputMetadataObjects:(NSArray<__kindof AVMetadataObject *> *)metadataObjects fromConnection:(AVCaptureConnection *)connection -{ - if (metadataObjects != nil && metadataObjects.count > 0) { - - [self p_pauseScanning]; - - AVMetadataMachineReadableCodeObject *obj = metadataObjects[0]; - [self handleQrCode:[obj stringValue]]; - } else { - - } -} - -#pragma mark - setter && getter - -- (FCQRScanView *)scanView -{ - if (!_scanView) { - _scanView = [[FCQRScanView alloc] initWithFrame:self.view.bounds]; - } - return _scanView; -} - - - -@end diff --git a/demo/Scan/View/FCQRScanView.h b/demo/Scan/View/FCQRScanView.h deleted file mode 100644 index 767779e..0000000 --- a/demo/Scan/View/FCQRScanView.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// FCQRScanView.h -// FinoSprite -// -// Created by Haley on 2019/12/6. -// Copyright © 2019 finogeeks. All rights reserved. -// - -#import - -@interface FCQRScanView : UIView - -@property (nonatomic, assign) CGFloat scanner_width; -@property (nonatomic, assign) CGFloat scanner_x; -@property (nonatomic, assign) CGFloat scanner_y; - -- (void)p_startScannerLineAnimation; - -- (void)p_pauseScannerLineAnimation; - -- (void)p_addActivityIndicator; - -- (void)p_removeActivityIndicator; - -@end - diff --git a/demo/demo.entitlements b/demo/demo.entitlements deleted file mode 100644 index 1c0a022..0000000 --- a/demo/demo.entitlements +++ /dev/null @@ -1,10 +0,0 @@ - - - - - com.apple.developer.associated-domains - - applinks:www.finclip.com - - - diff --git a/demo/demo.plist b/demo/demo.plist deleted file mode 100644 index 3981c80..0000000 --- a/demo/demo.plist +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - appId - 5facb3a52dcbff00017469bd - title - 绘图小程序 - startParams - - - - appId - 5fa214a29a6a7900019b5cc1 - title - 官方示例小程序 - startParams - - - - appId - 5fa215459a6a7900019b5cc3 - title - 对账单 - startParams - - - - appId - 5fc8934aefb8c600019e9747 - title - 自定义小程序API示例 - startParams - - - - appId - 5fc8934aefb8c600019e9747 - title - 自定义H5 API示例 - startParams - - path - /pages/webview/webview - - - - appId - 60c5bbf99e094f00015079ee - title - 原生向小程序发送事件 - startParams - - - - appId - 60f051ea525ea10001c0bd22 - title - 小程序登录授权示例 - startParams - - - - diff --git a/demo/servers.plist b/demo/servers.plist deleted file mode 100644 index 4d1f1f9..0000000 --- a/demo/servers.plist +++ /dev/null @@ -1,29 +0,0 @@ - - - - - com.finogeeks.finclip.demo - - - appKey - 22LyZEib0gLTQdU3MUauATBwgfnTCJjdr7FCnywmAEM= - appSecret - bdfd76cae24d4313 - apiServer - https://api.finclip.com - cryptType - MD5 - - - appKey - 22LyZEib0gLTQdU3MUauAUJPk2mIMV4Hq+tBzQxTSqhndG2JOPsS9yA5fww36gSp - appSecret - 1e9b3d1693d06fa1 - apiServer - https://finclip-testing.finogeeks.club - cryptType - SM - - - - diff --git a/doc/mop_ios_demo.gif b/doc/mop_ios_demo.gif deleted file mode 100644 index 9631347..0000000 Binary files a/doc/mop_ios_demo.gif and /dev/null differ