FirehoseCocoa 0.0.1

FirehoseCocoa 0.0.1

测试测试结果
语言编程语言 Obj-CObjective C
许可 MIT
发布时间上次发布2014年12月

Adam Kirk 维护。



 
依赖项
MTPocket~> 1.1.0
MTDates~> 0.9.2
 

  • 作者
  • Adam Kirk

用于与 Firehose 客户服务 API 交互的库。

注意:该库所交互的服务尚未推出,请勿使用此库。目前仅限于 Mysterious Trousers 团队。

安装

  1. 将此仓库 [某处克隆](https://)
  2. 在您的 Podfile 中添加以下行
pod "FirehoseCocoa", local: "[somewhere]"

pod? => https://github.com/CocoaPods/CocoaPods/

示例用法

设置环境

[[FHClient sharedClient] setEnvironment:FHEnvironmentTesting];

注册代理人

FHAgent *agent = [FHAgent agentWithEmail:[MTFaker email] password:[MTFaker password]];
MTPocketResponse *response = [agent signupWithFirstName:[MTFaker name] lastName:[MTFaker name]];

查看代理人的公司

FHCompany *company = [agent.companies lastObject];
company.title;    // => @"My Company"

获取公司的客户

FHRemoteArray *customers = [_company customersMatchingResolvedFilter:FHCustomerResolvedFilterEverything
                                                   channelFilter:FHCustomerChannelFilterAll
                                                    searchString:nil
                                                            sort:FHCustomerSortNewestFirst];
MTPocketResponse *response = [customers next];
if (response.success) {
  for (FHCustomer *customer in customers) {
    customer.name;    // => @"Adam Kirk"
  }
}

获取客户的交互

FHRemoteArray *interactions = customer.interactions;
MTPocketResponse *response = [interactions next];
if (response.success) {
  for (FHInteraction *interaction in interactions) {
    interaction.body;   // => @"Hi there, I need help with something...""

    for (FHNote *note in interaction.notes) {
      note.body;  // => @"This is a note about this interaction"
    }
  }
}

测试

首先初始化子模块

git submodule update --init --recursive

注意:如果您不是 Mysterious Trousers 的程序员,请不要尝试现在对单元测试进行操作。仍在优化让任何人都可以测试的方法。

用以下内容替换缺失的 constants.h 文件:

#define BASE_URL_LOCAL        @""
#define BASE_URL_TESTING      @""
#define BASE_URL_TUNNEL       @""
#define BASE_URL_STAGING      @"https://firehosestaging.herokuapp.com/"
#define BASE_URL_PRODUCTION   @"https://api.firehoseapp.com/"
#define ENV_ENUM              FHEnvironmentStaging