phizclip-ios-demo/README.md

43 lines
1.5 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 五行代码让你的App运行小程序
## 1、 修改Podfile文件增加FinApplet依赖
```
source 'https://github.com/CocoaPods/Specs.git'
pod 'FinApplet'
```
## 2、初始化 SDK **五行代码完成初始化**
AppDelegate SDK
```
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSString *appKey = @"SDKKEY";
FATConfig *config = [FATConfig configWithAppSecret:@"SECRET" appKey:appKey];
config.apiServer = @"https://mp.finogeeks.com";
config.apiPrefix = @"/api/v1/mop";
[[FATClient sharedClient] initWithConfig:config error:nil];
return YES;
}
```
## 3、打开小程序
```
NSString *appId = @"小程序id";
// 打开小程序
[[FATClient sharedClient] startRemoteApplet:appId startParams:nil InParentViewController:self completion:^(BOOL result, NSError *error) {
NSLog(@"result:%d---error:%@", result, error);
}];
```
* **SDKKEY** **Secret**
* **apiServer** **IP:**
* **id** appid
* [https://mp.finogeeks.com](https://mp.finogeeks.com)快速注册,免费获取。
* [iOS](https://mp.finogeeks.com/mop/document/runtime-sdk/sdk-integrate/ios.html)