重构demo,逻辑更清晰
|
@ -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 = "<group>"; };
|
||||||
|
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 = "<group>"; };
|
||||||
|
D60E44C12A25BFF500F256B1 /* FinCustomUIViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinCustomUIViewController.h; sourceTree = "<group>"; };
|
||||||
|
D60E44C22A25BFF500F256B1 /* FinCustomUIViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinCustomUIViewController.m; sourceTree = "<group>"; };
|
||||||
|
D60E44C42A25C2E600F256B1 /* finclipLogin.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = finclipLogin.zip; sourceTree = "<group>"; };
|
||||||
|
D60E44C62A25C56600F256B1 /* FinDelegateViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinDelegateViewController.h; sourceTree = "<group>"; };
|
||||||
|
D60E44C72A25C56600F256B1 /* FinDelegateViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinDelegateViewController.m; sourceTree = "<group>"; };
|
||||||
|
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 = "<group>"; };
|
||||||
|
D6471C002A2485AC0054EF34 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||||
|
D6471C052A2485AC0054EF34 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
|
||||||
|
D6471C062A2485AC0054EF34 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
|
||||||
|
D6471C092A2485AC0054EF34 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||||
|
D6471C0B2A2485AF0054EF34 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
|
D6471C0E2A2485AF0054EF34 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||||
|
D6471C102A2485AF0054EF34 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
D6471C112A2485AF0054EF34 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||||
|
D6471C222A2496B60054EF34 /* FinStartAppletViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinStartAppletViewController.h; sourceTree = "<group>"; };
|
||||||
|
D6471C232A2496B70054EF34 /* FinStartAppletViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinStartAppletViewController.m; sourceTree = "<group>"; };
|
||||||
|
D6471C252A2496E30054EF34 /* FinManageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinManageViewController.h; sourceTree = "<group>"; };
|
||||||
|
D6471C262A2496E30054EF34 /* FinManageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinManageViewController.m; sourceTree = "<group>"; };
|
||||||
|
D6471C282A2595000054EF34 /* FinNormalStartViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinNormalStartViewController.h; sourceTree = "<group>"; };
|
||||||
|
D6471C292A2595000054EF34 /* FinNormalStartViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinNormalStartViewController.m; sourceTree = "<group>"; };
|
||||||
|
D6471C2B2A25955C0054EF34 /* FinScanStartViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinScanStartViewController.h; sourceTree = "<group>"; };
|
||||||
|
D6471C2C2A25955C0054EF34 /* FinScanStartViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinScanStartViewController.m; sourceTree = "<group>"; };
|
||||||
|
D6471C2E2A2598150054EF34 /* FinQRCodeScanViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinQRCodeScanViewController.h; sourceTree = "<group>"; };
|
||||||
|
D6471C2F2A2598150054EF34 /* FinQRCodeScanViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinQRCodeScanViewController.m; sourceTree = "<group>"; };
|
||||||
|
D6471C312A25A36F0054EF34 /* FinCustomApiViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinCustomApiViewController.h; sourceTree = "<group>"; };
|
||||||
|
D6471C322A25A36F0054EF34 /* FinCustomApiViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinCustomApiViewController.m; sourceTree = "<group>"; };
|
||||||
|
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 = "<group>";
|
||||||
|
};
|
||||||
|
D6471BF32A2485AC0054EF34 = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D6471BFE2A2485AC0054EF34 /* FinDemo */,
|
||||||
|
D6471BFD2A2485AC0054EF34 /* Products */,
|
||||||
|
4986B21812B70137AECC9394 /* Pods */,
|
||||||
|
F49530F1C3FD683C1294DECF /* Frameworks */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D6471BFD2A2485AC0054EF34 /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D6471BFC2A2485AC0054EF34 /* FinDemo.app */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
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 = "<group>";
|
||||||
|
};
|
||||||
|
D6471C182A2492340054EF34 /* 功能演示 */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D6471C1C2A2492340054EF34 /* 1.打开小程序 */,
|
||||||
|
D6471C1A2A2492340054EF34 /* 2.日志管理 */,
|
||||||
|
D6471C1B2A2492340054EF34 /* 3.UI样式自定义 */,
|
||||||
|
D6471C212A2492340054EF34 /* 4.api自定义 */,
|
||||||
|
D6471C192A2492340054EF34 /* 5.代理方法 */,
|
||||||
|
);
|
||||||
|
path = "功能演示";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D6471C192A2492340054EF34 /* 5.代理方法 */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D60E44C62A25C56600F256B1 /* FinDelegateViewController.h */,
|
||||||
|
D60E44C72A25C56600F256B1 /* FinDelegateViewController.m */,
|
||||||
|
);
|
||||||
|
path = "5.代理方法";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D6471C1A2A2492340054EF34 /* 2.日志管理 */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D6471C252A2496E30054EF34 /* FinManageViewController.h */,
|
||||||
|
D6471C262A2496E30054EF34 /* FinManageViewController.m */,
|
||||||
|
);
|
||||||
|
path = "2.日志管理";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D6471C1B2A2492340054EF34 /* 3.UI样式自定义 */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D60E44C12A25BFF500F256B1 /* FinCustomUIViewController.h */,
|
||||||
|
D60E44C22A25BFF500F256B1 /* FinCustomUIViewController.m */,
|
||||||
|
);
|
||||||
|
path = "3.UI样式自定义";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D6471C1C2A2492340054EF34 /* 1.打开小程序 */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D6471C1D2A2492340054EF34 /* 2.扫码打开小程序 */,
|
||||||
|
D6471C1E2A2492340054EF34 /* 1.普通打开小程序 */,
|
||||||
|
D6471C222A2496B60054EF34 /* FinStartAppletViewController.h */,
|
||||||
|
D6471C232A2496B70054EF34 /* FinStartAppletViewController.m */,
|
||||||
|
);
|
||||||
|
path = "1.打开小程序";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D6471C1D2A2492340054EF34 /* 2.扫码打开小程序 */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D6471C2B2A25955C0054EF34 /* FinScanStartViewController.h */,
|
||||||
|
D6471C2C2A25955C0054EF34 /* FinScanStartViewController.m */,
|
||||||
|
D6471C2E2A2598150054EF34 /* FinQRCodeScanViewController.h */,
|
||||||
|
D6471C2F2A2598150054EF34 /* FinQRCodeScanViewController.m */,
|
||||||
|
);
|
||||||
|
path = "2.扫码打开小程序";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D6471C1E2A2492340054EF34 /* 1.普通打开小程序 */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D6471C282A2595000054EF34 /* FinNormalStartViewController.h */,
|
||||||
|
D6471C292A2595000054EF34 /* FinNormalStartViewController.m */,
|
||||||
|
);
|
||||||
|
path = "1.普通打开小程序";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D6471C212A2492340054EF34 /* 4.api自定义 */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
D60E44C42A25C2E600F256B1 /* finclipLogin.zip */,
|
||||||
|
D6471C312A25A36F0054EF34 /* FinCustomApiViewController.h */,
|
||||||
|
D6471C322A25A36F0054EF34 /* FinCustomApiViewController.m */,
|
||||||
|
);
|
||||||
|
path = "4.api自定义";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F49530F1C3FD683C1294DECF /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
F92103C497B51062D53EACA4 /* libPods-FinDemo.a */,
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* 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 = "<group>";
|
||||||
|
};
|
||||||
|
D6471C0D2A2485AF0054EF34 /* LaunchScreen.storyboard */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
D6471C0E2A2485AF0054EF34 /* Base */,
|
||||||
|
);
|
||||||
|
name = LaunchScreen.storyboard;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* 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 */;
|
||||||
|
}
|
|
@ -1,9 +1,8 @@
|
||||||
//
|
//
|
||||||
// AppDelegate.h
|
// AppDelegate.h
|
||||||
// demo
|
// FinDemo
|
||||||
//
|
//
|
||||||
// Created by 杨涛 on 2020/2/6.
|
// Created by 胡健辉 on 2023/5/29.
|
||||||
// Copyright © 2020 finogeeks. All rights reserved.
|
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
|
@ -0,0 +1,55 @@
|
||||||
|
//
|
||||||
|
// AppDelegate.m
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/29.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "AppDelegate.h"
|
||||||
|
#import <FinApplet/FinApplet.h>
|
||||||
|
|
||||||
|
|
||||||
|
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
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"colors" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 682 KiB |
After Width: | Height: | Size: 947 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 14 KiB |
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||||
|
<dependencies>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||||
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||||
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--View Controller-->
|
||||||
|
<scene sceneID="tne-QT-ifu">
|
||||||
|
<objects>
|
||||||
|
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
|
||||||
|
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||||
|
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
</document>
|
|
@ -0,0 +1,82 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleURLTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Editor</string>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>weixin</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>wx85663af68a0cbbc8</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>LSApplicationQueriesSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>weixin</string>
|
||||||
|
<string>weixinULAPI</string>
|
||||||
|
</array>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>NSAppTransportSecurity</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSAllowsArbitraryLoads</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
<key>NSBluetoothPeripheralUsageDescription</key>
|
||||||
|
<string>是否允许【FinApplet】使用蓝牙?</string>
|
||||||
|
<key>NSCalendarsUsageDescription</key>
|
||||||
|
<string>是否允许【FinApplet】使用日历?</string>
|
||||||
|
<key>NSCameraUsageDescription</key>
|
||||||
|
<string>是否允许【FinApplet】使用你的相机?</string>
|
||||||
|
<key>NSContactsUsageDescription</key>
|
||||||
|
<string>开启同步通讯录信息,可智能补全客户资料。如果系统提示确认权限,请点击“好”。</string>
|
||||||
|
<key>NSLocationAlwaysUsageDescription</key>
|
||||||
|
<string>我们需要通过您的地理位置信息获取您周边的相关数据</string>
|
||||||
|
<key>NSLocationWhenInUseUsageDescription</key>
|
||||||
|
<string>我们需要通过您的地理位置信息获取您周边的相关数据</string>
|
||||||
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
|
<string>是否允许【FinApplet】使用你的麦克风?</string>
|
||||||
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
|
<string>是否允许【FinApplet】使用语相册?</string>
|
||||||
|
<key>UILaunchStoryboardName</key>
|
||||||
|
<string>LaunchScreen</string>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>armv7</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -0,0 +1,14 @@
|
||||||
|
//
|
||||||
|
// ViewController.h
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/29.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
@interface ViewController : UITableViewController
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
|
@ -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
|
|
@ -1,9 +1,8 @@
|
||||||
//
|
//
|
||||||
// main.m
|
// main.m
|
||||||
// demo
|
// FinDemo
|
||||||
//
|
//
|
||||||
// Created by 杨涛 on 2020/2/6.
|
// Created by 胡健辉 on 2023/5/29.
|
||||||
// Copyright © 2020 finogeeks. All rights reserved.
|
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
|
@ -0,0 +1,16 @@
|
||||||
|
//
|
||||||
|
// FinNormalStartViewController.h
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface FinNormalStartViewController : UIViewController
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,37 @@
|
||||||
|
//
|
||||||
|
// FinNormalStartViewController.m
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "FinNormalStartViewController.h"
|
||||||
|
#import <FinApplet/FinApplet.h>
|
||||||
|
|
||||||
|
@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
|
|
@ -0,0 +1,35 @@
|
||||||
|
//
|
||||||
|
// FinQRCodeScanViewController.h
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
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
|
|
@ -1,12 +1,225 @@
|
||||||
//
|
//
|
||||||
// FCQRScanView.m
|
// FinQRCodeScanViewController.m
|
||||||
// FinoSprite
|
// FinDemo
|
||||||
//
|
//
|
||||||
// Created by Haley on 2019/12/6.
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
// Copyright © 2019 finogeeks. All rights reserved.
|
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "FCQRScanView.h"
|
#import "FinQRCodeScanViewController.h"
|
||||||
|
|
||||||
|
#import <Photos/Photos.h>
|
||||||
|
#import <AVFoundation/AVFoundation.h>
|
||||||
|
#import <FinApplet/FinApplet.h>
|
||||||
|
|
||||||
|
@interface FinQRCodeScanViewController ()<AVCaptureMetadataOutputObjectsDelegate>
|
||||||
|
@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_borderWidth = 1.0; /** 扫描器边框宽度 */
|
||||||
const CGFloat scanner_cornerWidth = 3.0; /** 扫描器棱角宽度 */
|
const CGFloat scanner_cornerWidth = 3.0; /** 扫描器棱角宽度 */
|
||||||
|
@ -16,7 +229,7 @@ const CGFloat tipLab_height = 50.0; /** 扫描器下方提示文字高度 */
|
||||||
|
|
||||||
static NSString *scannerLineAnmationKey = @"ScannerLineAnmationKey"; /** 扫描线条动画Key值 */
|
static NSString *scannerLineAnmationKey = @"ScannerLineAnmationKey"; /** 扫描线条动画Key值 */
|
||||||
|
|
||||||
@interface FCQRScanView ()
|
@interface FinQRScanView ()
|
||||||
|
|
||||||
@property (nonatomic, strong) UIColor *scannerBorderColor;
|
@property (nonatomic, strong) UIColor *scannerBorderColor;
|
||||||
|
|
||||||
|
@ -30,7 +243,7 @@ static NSString *scannerLineAnmationKey = @"ScannerLineAnmationKey"; /** 扫描
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation FCQRScanView
|
@implementation FinQRScanView
|
||||||
|
|
||||||
- (instancetype)initWithFrame:(CGRect)frame
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
{
|
{
|
|
@ -0,0 +1,16 @@
|
||||||
|
//
|
||||||
|
// FinScanStartViewController.h
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface FinScanStartViewController : UIViewController
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,46 @@
|
||||||
|
//
|
||||||
|
// FinScanStartViewController.m
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "FinScanStartViewController.h"
|
||||||
|
#import <FinApplet/FinApplet.h>
|
||||||
|
#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
|
|
@ -0,0 +1,16 @@
|
||||||
|
//
|
||||||
|
// FinStartAppletViewController.h
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/29.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface FinStartAppletViewController : UITableViewController
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
|
@ -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
|
|
@ -0,0 +1,16 @@
|
||||||
|
//
|
||||||
|
// FinManageViewController.h
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/29.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface FinManageViewController : UIViewController
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,66 @@
|
||||||
|
//
|
||||||
|
// FinManageViewController.m
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/29.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "FinManageViewController.h"
|
||||||
|
#import <FinApplet/FinApplet.h>
|
||||||
|
|
||||||
|
@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
|
|
@ -0,0 +1,19 @@
|
||||||
|
//
|
||||||
|
// FinCustomUIViewController.h
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface FinCustomUIViewController : UIViewController
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,68 @@
|
||||||
|
//
|
||||||
|
// FinCustomUIViewController.m
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "FinCustomUIViewController.h"
|
||||||
|
#import <FinApplet/FinApplet.h>
|
||||||
|
|
||||||
|
//需要继承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
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
//
|
||||||
|
// FinCustomApiViewController.h
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface FinCustomApiViewController : UIViewController
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,71 @@
|
||||||
|
//
|
||||||
|
// FinCustomApiViewController.m
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "FinCustomApiViewController.h"
|
||||||
|
#import <FinApplet/FinApplet.h>
|
||||||
|
|
||||||
|
@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
|
|
@ -0,0 +1,16 @@
|
||||||
|
//
|
||||||
|
// FinDelegateViewController.h
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface FinDelegateViewController : UIViewController
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
|
@ -0,0 +1,116 @@
|
||||||
|
//
|
||||||
|
// FinDelegateViewController.m
|
||||||
|
// FinDemo
|
||||||
|
//
|
||||||
|
// Created by 胡健辉 on 2023/5/30.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "FinDelegateViewController.h"
|
||||||
|
#import <FinApplet/FinApplet.h>
|
||||||
|
|
||||||
|
@interface FinDelegateViewController ()<FATAppletLifeCycleDelegate>
|
||||||
|
|
||||||
|
@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
|
|
@ -1,19 +1,17 @@
|
||||||
platform :ios, "9.0"
|
source 'https://github.com/CocoaPods/Specs.git'
|
||||||
|
#国内的源
|
||||||
|
#source 'https://cdn.cocoapods.org/'
|
||||||
|
|
||||||
|
target 'FinDemo' do
|
||||||
|
|
||||||
|
#FinClip核心SDK,必集成(其他子SDK都是可选)。最低支持iOS9.0系统
|
||||||
|
#pod 'FinApplet'
|
||||||
|
|
||||||
|
#如小程序中用到chooseLocation、getLocation、openLocation、choosePoi、startRecord、stopRecord、RecorderManager这些api,可集成该子SDK
|
||||||
|
#pod 'FinAppletExt'
|
||||||
|
|
||||||
source 'https://cdn.cocoapods.org/'
|
|
||||||
|
|
||||||
|
|
||||||
inhibit_all_warnings!
|
|
||||||
|
|
||||||
target "demo" do
|
|
||||||
pod 'FinApplet'
|
|
||||||
pod 'FinAppletExt'
|
|
||||||
pod 'FinAppletWebRTC'
|
|
||||||
pod 'FinAppletBDMap'
|
|
||||||
pod 'FinAppletGDMap'
|
|
||||||
pod 'FinAppletBLE'
|
|
||||||
pod 'WechatOpenSDK'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
#
|
|
|
@ -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 = "<group>"; };
|
|
||||||
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 = "<group>"; };
|
|
||||||
9DD565BD23EC45080011FC4A /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
|
||||||
9DD565C223EC45080011FC4A /* MainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
|
|
||||||
9DD565C323EC45080011FC4A /* MainViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
|
|
||||||
9DD565C823EC450A0011FC4A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
|
||||||
9DD565CB23EC450A0011FC4A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
|
||||||
9DD565CD23EC450A0011FC4A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
|
||||||
9DD565CE23EC450A0011FC4A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
|
||||||
A0E041B826CE6DAD00D58D47 /* demo.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = demo.plist; sourceTree = "<group>"; };
|
|
||||||
A0E041BC26CE720900D58D47 /* servers.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = servers.plist; sourceTree = "<group>"; };
|
|
||||||
A823321D258C3B7000C1B2D5 /* FINDemoClientHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FINDemoClientHelper.m; sourceTree = "<group>"; };
|
|
||||||
A823321E258C3B7000C1B2D5 /* FINDemoClientHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FINDemoClientHelper.h; sourceTree = "<group>"; };
|
|
||||||
A863B743257A09A200959AA1 /* FINExtensionHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FINExtensionHelper.h; sourceTree = "<group>"; };
|
|
||||||
A863B744257A09A300959AA1 /* FINExtensionHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FINExtensionHelper.m; sourceTree = "<group>"; };
|
|
||||||
A8BC0978258BA095001289A3 /* FINCustomMenuModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FINCustomMenuModel.h; sourceTree = "<group>"; };
|
|
||||||
A8BC0979258BA095001289A3 /* FINCustomMenuModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FINCustomMenuModel.m; sourceTree = "<group>"; };
|
|
||||||
A8CE73512810F8C800965B7E /* FCQRCodeScanViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FCQRCodeScanViewController.m; sourceTree = "<group>"; };
|
|
||||||
A8CE73522810F8C800965B7E /* FCQRCodeScanViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FCQRCodeScanViewController.h; sourceTree = "<group>"; };
|
|
||||||
A8CE73542810F8C800965B7E /* FCQRScanView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FCQRScanView.m; sourceTree = "<group>"; };
|
|
||||||
A8CE73552810F8C800965B7E /* FCQRScanView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FCQRScanView.h; sourceTree = "<group>"; };
|
|
||||||
D6278645283CC38F001270F1 /* demo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = demo.entitlements; sourceTree = "<group>"; };
|
|
||||||
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 = "<group>"; };
|
|
||||||
/* 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 = "<group>";
|
|
||||||
};
|
|
||||||
9DD565BA23EC45080011FC4A /* Products */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
9DD565B923EC45080011FC4A /* demo.app */,
|
|
||||||
);
|
|
||||||
name = Products;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
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 = "<group>";
|
|
||||||
};
|
|
||||||
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 = "<group>";
|
|
||||||
};
|
|
||||||
A8CE734F2810F8C800965B7E /* Scan */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
A8CE73502810F8C800965B7E /* Controller */,
|
|
||||||
A8CE73532810F8C800965B7E /* View */,
|
|
||||||
);
|
|
||||||
path = Scan;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
A8CE73502810F8C800965B7E /* Controller */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
A8CE73522810F8C800965B7E /* FCQRCodeScanViewController.h */,
|
|
||||||
A8CE73512810F8C800965B7E /* FCQRCodeScanViewController.m */,
|
|
||||||
);
|
|
||||||
path = Controller;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
A8CE73532810F8C800965B7E /* View */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
A8CE73552810F8C800965B7E /* FCQRScanView.h */,
|
|
||||||
A8CE73542810F8C800965B7E /* FCQRScanView.m */,
|
|
||||||
);
|
|
||||||
path = View;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
ACE3AE3120D1733A6BB38C8A /* Frameworks */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
28A582EE796CD12C1FF4F5DB /* libPods-demo.a */,
|
|
||||||
);
|
|
||||||
name = Frameworks;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
F230DA512C0C77A07ACE5BB1 /* Pods */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
FBEBA7E73B95B66C846E76FF /* Pods-demo.debug.xcconfig */,
|
|
||||||
3F2BFD149B6F799A303A07B3 /* Pods-demo.release.xcconfig */,
|
|
||||||
);
|
|
||||||
path = Pods;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
/* 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 = "<group>";
|
|
||||||
};
|
|
||||||
/* 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 */;
|
|
||||||
}
|
|
|
@ -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 <FinApplet/FinApplet.h>
|
|
||||||
#import <FinAppletBDMap/FinAppletBDMap.h>
|
|
||||||
#import <FinAppletGDMap/FinAppletGDMap.h>
|
|
||||||
|
|
||||||
@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<NSString*, id> *)options {
|
|
||||||
return [WXApi handleOpenURL:url delegate:[FINExtensionHelper sharedHelper]];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
|
@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.2 KiB |
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.2 KiB |
|
@ -1,18 +0,0 @@
|
||||||
//
|
|
||||||
// FINCustomMenuModel.h
|
|
||||||
// demo
|
|
||||||
//
|
|
||||||
// Created by Haley on 2020/12/17.
|
|
||||||
// Copyright © 2020 finogeeks. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import <FinApplet/FinApplet.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
@interface FINCustomMenuModel : NSObject<FATAppletMenuProtocol>
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
|
@ -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
|
|
|
@ -1,17 +0,0 @@
|
||||||
//
|
|
||||||
// FINClientHelper.h
|
|
||||||
// demo
|
|
||||||
//
|
|
||||||
// Created by Haley on 2020/12/17.
|
|
||||||
// Copyright © 2020 finogeeks. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import <FinApplet/FinApplet.h>
|
|
||||||
|
|
||||||
@interface FINDemoClientHelper : NSObject<FATAppletDelegate>
|
|
||||||
|
|
||||||
+ (instancetype)sharedHelper;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
|
@ -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<id<FATAppletMenuProtocol>> *)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<FATAppletMenuProtocol>)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
|
|
|
@ -1,18 +0,0 @@
|
||||||
//
|
|
||||||
// FINExtensionHelper.h
|
|
||||||
// finclip_custom_demo
|
|
||||||
//
|
|
||||||
// Created by Haley on 2020/12/3.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import <WechatOpenSDK/WXApi.h>
|
|
||||||
|
|
||||||
@interface FINExtensionHelper : NSObject<WXApiDelegate>
|
|
||||||
|
|
||||||
+ (instancetype)sharedHelper;
|
|
||||||
|
|
||||||
- (void)registerCustomApis;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
|
@ -1,229 +0,0 @@
|
||||||
//
|
|
||||||
// FINExtensionHelper.m
|
|
||||||
// finclip_custom_demo
|
|
||||||
//
|
|
||||||
// Created by Haley on 2020/12/3.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "FINExtensionHelper.h"
|
|
||||||
#import <FinApplet/FinApplet.h>
|
|
||||||
#import <WechatOpenSDK/WXApi.h>
|
|
||||||
#import <CommonCrypto/CommonDigest.h>
|
|
||||||
#import <CommonCrypto/CommonHMAC.h>
|
|
||||||
|
|
||||||
@interface FINExtensionHelper () <WXApiDelegate>
|
|
||||||
|
|
||||||
// 支付时,支付的回调是异步的,故这里将小程序的回调持有,在适当的时机调用(用户可根据自己的场景自行实现自己调用的逻辑)
|
|
||||||
@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
|
|
|
@ -1,82 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
||||||
<key>CFBundleExecutable</key>
|
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
|
||||||
<key>CFBundleIdentifier</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
|
||||||
<string>6.0</string>
|
|
||||||
<key>CFBundleName</key>
|
|
||||||
<string>$(PRODUCT_NAME)</string>
|
|
||||||
<key>CFBundlePackageType</key>
|
|
||||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
|
||||||
<key>CFBundleShortVersionString</key>
|
|
||||||
<string>1.0</string>
|
|
||||||
<key>CFBundleURLTypes</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>CFBundleTypeRole</key>
|
|
||||||
<string>Editor</string>
|
|
||||||
<key>CFBundleURLName</key>
|
|
||||||
<string>weixin</string>
|
|
||||||
<key>CFBundleURLSchemes</key>
|
|
||||||
<array>
|
|
||||||
<string>wx85663af68a0cbbc8</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>CFBundleVersion</key>
|
|
||||||
<string>1</string>
|
|
||||||
<key>LSApplicationQueriesSchemes</key>
|
|
||||||
<array>
|
|
||||||
<string>weixin</string>
|
|
||||||
<string>weixinULAPI</string>
|
|
||||||
</array>
|
|
||||||
<key>LSRequiresIPhoneOS</key>
|
|
||||||
<true/>
|
|
||||||
<key>NSAppTransportSecurity</key>
|
|
||||||
<dict>
|
|
||||||
<key>NSAllowsArbitraryLoads</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
<key>NSBluetoothPeripheralUsageDescription</key>
|
|
||||||
<string>是否允许【FinApplet】使用蓝牙?</string>
|
|
||||||
<key>NSCalendarsUsageDescription</key>
|
|
||||||
<string>是否允许【FinApplet】使用日历?</string>
|
|
||||||
<key>NSCameraUsageDescription</key>
|
|
||||||
<string>是否允许【FinApplet】使用你的相机?</string>
|
|
||||||
<key>NSContactsUsageDescription</key>
|
|
||||||
<string>开启同步通讯录信息,可智能补全客户资料。如果系统提示确认权限,请点击“好”。</string>
|
|
||||||
<key>NSLocationAlwaysUsageDescription</key>
|
|
||||||
<string>我们需要通过您的地理位置信息获取您周边的相关数据</string>
|
|
||||||
<key>NSLocationWhenInUseUsageDescription</key>
|
|
||||||
<string>我们需要通过您的地理位置信息获取您周边的相关数据</string>
|
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
|
||||||
<string>是否允许【FinApplet】使用你的麦克风?</string>
|
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
|
||||||
<string>是否允许【FinApplet】使用语相册?</string>
|
|
||||||
<key>UILaunchStoryboardName</key>
|
|
||||||
<string>LaunchScreen</string>
|
|
||||||
<key>UIRequiredDeviceCapabilities</key>
|
|
||||||
<array>
|
|
||||||
<string>armv7</string>
|
|
||||||
</array>
|
|
||||||
<key>UISupportedInterfaceOrientations</key>
|
|
||||||
<array>
|
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
||||||
</array>
|
|
||||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
|
||||||
<array>
|
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
|
||||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
|
@ -1,15 +0,0 @@
|
||||||
//
|
|
||||||
// MainViewController.h
|
|
||||||
// demo
|
|
||||||
//
|
|
||||||
// Created by 杨涛 on 2020/2/6.
|
|
||||||
// Copyright © 2020 finogeeks. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
@interface MainViewController : UIViewController
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
|
@ -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 <FinApplet/FinApplet.h>
|
|
||||||
#import <WechatOpenSDK/WXApi.h>
|
|
||||||
|
|
||||||
@interface MainViewController ()<UITableViewDelegate, UITableViewDataSource>
|
|
||||||
|
|
||||||
@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
|
|
|
@ -1,18 +0,0 @@
|
||||||
//
|
|
||||||
// FCQRCodeScanViewController.h
|
|
||||||
// FinoSprite
|
|
||||||
//
|
|
||||||
// Created by Haley on 2019/12/6.
|
|
||||||
// Copyright © 2019 finogeeks. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
typedef void(^ScanCompletion)(NSString *qrcode);
|
|
||||||
|
|
||||||
@interface FCQRCodeScanViewController : UIViewController
|
|
||||||
|
|
||||||
@property (nonatomic, copy) ScanCompletion scanCompletion;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
|
@ -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 <Photos/Photos.h>
|
|
||||||
#import <AVFoundation/AVFoundation.h>
|
|
||||||
#import <FinApplet/FinApplet.h>
|
|
||||||
|
|
||||||
@interface FCQRCodeScanViewController ()<AVCaptureMetadataOutputObjectsDelegate>
|
|
||||||
|
|
||||||
@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
|
|
|
@ -1,26 +0,0 @@
|
||||||
//
|
|
||||||
// FCQRScanView.h
|
|
||||||
// FinoSprite
|
|
||||||
//
|
|
||||||
// Created by Haley on 2019/12/6.
|
|
||||||
// Copyright © 2019 finogeeks. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
@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
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>com.apple.developer.associated-domains</key>
|
|
||||||
<array>
|
|
||||||
<string>applinks:www.finclip.com</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
|
@ -1,65 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>appId</key>
|
|
||||||
<string>5facb3a52dcbff00017469bd</string>
|
|
||||||
<key>title</key>
|
|
||||||
<string>绘图小程序</string>
|
|
||||||
<key>startParams</key>
|
|
||||||
<dict/>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>appId</key>
|
|
||||||
<string>5fa214a29a6a7900019b5cc1</string>
|
|
||||||
<key>title</key>
|
|
||||||
<string>官方示例小程序</string>
|
|
||||||
<key>startParams</key>
|
|
||||||
<dict/>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>appId</key>
|
|
||||||
<string>5fa215459a6a7900019b5cc3</string>
|
|
||||||
<key>title</key>
|
|
||||||
<string>对账单</string>
|
|
||||||
<key>startParams</key>
|
|
||||||
<dict/>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>appId</key>
|
|
||||||
<string>5fc8934aefb8c600019e9747</string>
|
|
||||||
<key>title</key>
|
|
||||||
<string>自定义小程序API示例</string>
|
|
||||||
<key>startParams</key>
|
|
||||||
<dict/>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>appId</key>
|
|
||||||
<string>5fc8934aefb8c600019e9747</string>
|
|
||||||
<key>title</key>
|
|
||||||
<string>自定义H5 API示例</string>
|
|
||||||
<key>startParams</key>
|
|
||||||
<dict>
|
|
||||||
<key>path</key>
|
|
||||||
<string>/pages/webview/webview</string>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>appId</key>
|
|
||||||
<string>60c5bbf99e094f00015079ee</string>
|
|
||||||
<key>title</key>
|
|
||||||
<string>原生向小程序发送事件</string>
|
|
||||||
<key>startParams</key>
|
|
||||||
<dict/>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>appId</key>
|
|
||||||
<string>60f051ea525ea10001c0bd22</string>
|
|
||||||
<key>title</key>
|
|
||||||
<string>小程序登录授权示例</string>
|
|
||||||
<key>startParams</key>
|
|
||||||
<dict/>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
</plist>
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>com.finogeeks.finclip.demo</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>appKey</key>
|
|
||||||
<string>22LyZEib0gLTQdU3MUauATBwgfnTCJjdr7FCnywmAEM=</string>
|
|
||||||
<key>appSecret</key>
|
|
||||||
<string>bdfd76cae24d4313</string>
|
|
||||||
<key>apiServer</key>
|
|
||||||
<string>https://api.finclip.com</string>
|
|
||||||
<key>cryptType</key>
|
|
||||||
<string>MD5</string>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>appKey</key>
|
|
||||||
<string>22LyZEib0gLTQdU3MUauAUJPk2mIMV4Hq+tBzQxTSqhndG2JOPsS9yA5fww36gSp</string>
|
|
||||||
<key>appSecret</key>
|
|
||||||
<string>1e9b3d1693d06fa1</string>
|
|
||||||
<key>apiServer</key>
|
|
||||||
<string>https://finclip-testing.finogeeks.club</string>
|
|
||||||
<key>cryptType</key>
|
|
||||||
<string>SM</string>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
Before Width: | Height: | Size: 4.6 MiB |