From bd20f3c556021ee6809d8ac90d8442bf7274c766 Mon Sep 17 00:00:00 2001 From: wanghualei Date: Wed, 3 Aug 2022 11:54:58 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E7=99=BE=E5=BA=A6=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E3=80=81=E9=AB=98=E5=BE=B7=E5=9C=B0=E5=9B=BE=E7=9A=84=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E4=BB=A3=E7=A0=81=EF=BC=8C=E4=BB=A5=E5=8F=8Aupdate=20?= =?UTF-8?q?readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Podfile | 1 + README.md | 36 +++++++++++++++++++++++++++----- demo.xcodeproj/project.pbxproj | 14 ++++--------- demo/AppDelegate.m | 8 +++++++ demo/Common/FINExtensionHelper.m | 1 + 5 files changed, 45 insertions(+), 15 deletions(-) diff --git a/Podfile b/Podfile index f2b576e..8da4ca9 100644 --- a/Podfile +++ b/Podfile @@ -11,6 +11,7 @@ target "demo" do pod 'FinAppletWebRTC' pod 'FinAppletBDMap' pod 'FinAppletGDMap' + pod 'FinAppletBLE' pod 'WechatOpenSDK' end diff --git a/README.md b/README.md index 43b5d06..8cdec63 100644 --- a/README.md +++ b/README.md @@ -53,16 +53,23 @@ source 'https://github.com/CocoaPods/Specs.git' pod 'FinApplet' ``` -### 第二步 五行代码完成SDK初始化 +### 第二步 完成SDK初始化 在工程的 `AppDelegate` 中的以下方法中,调用 SDK 的初始化方法。 ```objc - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - NSString *appKey = @"SDKKEY"; - FATConfig *config = [FATConfig configWithAppSecret:@"SECRET" appKey:appKey]; - config.apiServer = @"https://api.finclip.com"; - config.apiPrefix = @"/api/v1/mop"; + // 需要添加至App中的代码--start + NSMutableArray *storeArrayM = [NSMutableArray array]; + FATStoreConfig *storeConfig = [[FATStoreConfig alloc] init]; + storeConfig.sdkKey = @"您的sdkKey信息"; + storeConfig.sdkSecret = @"您的sdkSecret信息"; + storeConfig.apiServer = @"服务器域名"; + storeConfig.apmServer = @"apm统计事件的域名"; + [storeArrayM addObject:storeConfig]; + + FATConfig *config = [FATConfig configWithStoreConfigs:storeArrayM]; [[FATClient sharedClient] initWithConfig:config error:nil]; + // 需要添加至App中的代码--end return YES; } @@ -83,6 +90,25 @@ NSString *appId = @"小程序id"; - **小程序 ID** 是管理后台上架的小程序 APP ID,需要在「小程序管理」中创建并在「应用管理」中关联; > 小程序 ID 与 微信小程序ID 不一样哦!(这里是特指 FinClip 平台的 ID ) +## 📋 Demo功能介绍 +**微信登录** +微信登录是通过自定义api注入`login`来实现的,需要依赖微信开放SDK。 +可参考`FINExtensionHelper` 中 注册的`login`的逻辑。 + +**微信支付** +微信支付也是通过自定义api注入`requestPayment`来实现的,需要依赖微信开放SDK。 +可参考`FINExtensionHelper` 中 注册的`requestPayment`的逻辑。 + +**百度地图** +小程序中的Map组件默认是使用系统的Map以及相关api来实现的。您也可以选择使用百度地图的Map组件。我们在Demo里已经添加了`FinAppletBDMap`的依赖,它是我们基于百度地图做的扩展SDK。 +如果要使用百度地图版本的Map组件,则只需要在初始化FinClip SDK成功后,调用`[FATBDMapComponent setBDMapAppKey:@"申请的key"];`即可。 +可参考`AppDelegate`的`application:didFinishLaunchingWithOptions:`方法里的注册百度地图。 + +**高德地图** +同理,如果选择使用高德地图的Map组件。我们在Demo里也已经添加了`FinAppletGDMap`的依赖,它是我们基于高德地图做的扩展SDK。 +如果要使用高德地图版本的Map组件,则只需要在初始化FinClip SDK成功后,调用`[FATGDMapComponent setGDMapAppKey:@"申请的key"];`即可。 +可参考`AppDelegate`的`application:didFinishLaunchingWithOptions:`方法里的注册高德地图。 + ## 📋 集成文档 [点击这里](https://www.finclip.com/mop/document/introduce/quickStart/intergration-guide.html#_1-ios-%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90) 查看 iOS 快速集成文档 diff --git a/demo.xcodeproj/project.pbxproj b/demo.xcodeproj/project.pbxproj index 4f84d3e..52859e2 100644 --- a/demo.xcodeproj/project.pbxproj +++ b/demo.xcodeproj/project.pbxproj @@ -172,7 +172,7 @@ 9DD565B623EC45080011FC4A /* Frameworks */, 9DD565B723EC45080011FC4A /* Resources */, DFB054DF507DE3B18CCCE932 /* [CP] Embed Pods Frameworks */, - 74745716D7A4B2CB6E4BC657 /* [CP] Copy Pods Resources */, + 33C306F0B0B6C469FD078FB0 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -231,7 +231,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 74745716D7A4B2CB6E4BC657 /* [CP] Copy Pods Resources */ = { + 33C306F0B0B6C469FD078FB0 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -441,10 +441,7 @@ ENABLE_BITCODE = NO; INFOPLIST_FILE = demo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.finogeeks.finclip.demo; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -464,10 +461,7 @@ ENABLE_BITCODE = NO; INFOPLIST_FILE = demo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + 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; diff --git a/demo/AppDelegate.m b/demo/AppDelegate.m index 4727484..4e38006 100644 --- a/demo/AppDelegate.m +++ b/demo/AppDelegate.m @@ -10,7 +10,10 @@ #import "MainViewController.h" #import "FINExtensionHelper.h" #import "FINDemoClientHelper.h" + #import +#import +#import @interface AppDelegate () @@ -49,6 +52,11 @@ // 注入自定义api [[FINExtensionHelper sharedHelper] registerCustomApis]; +// // 注册百度地图 +// [FATBDMapComponent setBDMapAppKey:@"申请的key"]; +// // 注册高德地图 +// [FATGDMapComponent setGDMapAppKey:@"申请的key"]; + if ([bundleId isEqualToString:@"com.finogeeks.mop.finosprite"]) { // 该appID【wx85663af68a0cbbc8】绑定的应用为凡泰助手,若要生效,请修改BundleID为com.finogeeks.mop.finosprite [WXApi registerApp:@"wx85663af68a0cbbc8" universalLink:@"https://www.finclip.com/finosprite/"]; diff --git a/demo/Common/FINExtensionHelper.m b/demo/Common/FINExtensionHelper.m index d839fe7..eb44105 100644 --- a/demo/Common/FINExtensionHelper.m +++ b/demo/Common/FINExtensionHelper.m @@ -60,6 +60,7 @@ static FINExtensionHelper *instance = nil; NSDictionary *resDic = @{@"userInfo":userInfo}; callback(FATExtensionCodeSuccess,resDic); }]; + // 注入登录方法 [[FATClient sharedClient] registerExtensionApi:@"login" handler:^(FATAppletInfo *appletInfo, id param, FATExtensionApiCallback callback) { // 处理小程序登录逻辑后,调用小程序回调