ApigeeiOSSDK 2.0.21

ApigeeiOSSDK 2.0.21

许可证 自定义
发布最新发布2016年11月

Robert WalshRobert Walsh维护。



Apigee iOS SDK 概述

提供两个主要功能区域:(1) 应用服务(Usergrid),和 (2) 应用监控。应用服务提供服务器端存储功能。应用监控提供崩溃报告、错误跟踪、应用程序配置管理和网络性能监控。您可以使用这两个区域,或者只选择使用其中一个。

安装 SDK

  1. ApigeeiOSSDK.framework 添加到您的项目中。

  2. 将以下 iOS 框架添加到您的项目中

    CoreLocation.framework
    Security.framework
    CoreTelephony.framework
    QuartzCore.framework
    SystemConfiguration.framework
    UIKit.framework
  3. 向“构建设置”中的“其他链接器标志”添加以下标志

    -ObjC -all_load

    请确认已为“DEBUG”和“RELEASE”都设置了标志。

  4. 在您的代码中导入 SDK

    #import <ApigeeiOSSDK/Apigee.h>
  5. AppDelegate.h 中声明以下属性

    @property (strong, nonatomic) ApigeeClient *apigeeClient; //object for initializing the App Services SDK
    @property (strong, nonatomic) ApigeeMonitoringClient *monitoringClient; //client object for Apigee App Monitoring methods
    @property (strong, nonatomic) ApigeeDataClient *dataClient; //client object for App Services data methods
  6. AppDelegate.m 中的 'didFinishLaunching' 方法内实例化 'ApigeeClient' 类

    //Instantiate the AppDelegate
    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    //Sepcify your App Services organization and application names
    NSString *orgName = @"YOUR-ORG";
    NSString *appName = @"YOUR-APP";
    //Instantiate ApigeeClient to initialize the SDK
    appDelegate.apigeeClient = [[ApigeeClient alloc]
                                initWithOrganizationId:orgName
                                applicationId:appName];
    //Retrieve instances of ApigeeClient.monitoringClient and ApigeeClient.dataClient
    self.monitoringClient = [appDelegate.apigeeClient monitoringClient]; //used to call App Monitoring methods
    self.dataClient = [appDelegate.apigeeClient dataClient]; //used to call data methods

技术详情

  • 大多数 Objective-C 类使用了自动引用计数 (ARC)。
  • 针对 iOS 5.0 及以上版本。
  • 需要 Xcode 5.0.2(或更高版本)才能从源代码构建。

从源代码构建

要从源代码构建,请从您的存储库的 /source 目录中运行此命令

    ./Scripts/framework.sh

运行单元测试

要运行单元测试,您可以使用 Xcode IDE 或 Xcode 的命令行工具

- From within the Xcode IDE, under the Product menu select Test.

- Using the command line issue the following command from the `\source` directory of your repository:

```xcodebuild -project ApigeeiOSSDK.xcodeproj -scheme “ApigeeiOSSDK Tests” -configuration Debug -sdk iphonesimulator clean build test```

IOS 7 兼容性

  • 我们已经测试过 iOS 7,没有已知的不兼容问题。
  • 在网络性能指标捕获中,我们支持 NSURLSession。

显式设置 Xcode 版本

构建脚本使用了 Xcode 的默认安装。如果您需要配置构建以使用不同的 Xcode 版本,请在 source/Scripts/dist.sh 中取消注释为 DEVELOPER_DIR 分配路径的代码。

Usergrid 的新功能

新增类(ApigeeCollectionApigeeEntityApigeeDeviceApigeeGroup),以便更容易地处理实体和集合。其功能已根据我们的 JavaScript 和 PHP SDK 进行建模。

从 Usergrid 迁移

  1. 所有以 'UG' 前缀命名的类现在将以 'Apigee' 前缀命名 (UGClassName 变为 ApigeeClassName)
  2. UGClient 现在命名为 ApigeeDataClient
  3. 使用 ApigeeClient(新类)进行初始化