Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

feedhenry-templates/blank-ios-app

Repository files navigation

blank-ios-app

circle-ci

Swift version of Blank iOS app is available here.

Author: Corinne Krych
Level: Intermediate
Technologies: Objective-C, iOS, RHMAP, CocoaPods.
Summary: A demonstration of how to get started with RHMAP.
Community Project: Feed Henry
Target Product: RHMAP
Product Versions: RHMAP 3.7.0+
Source: https://github.com/feedhenry-templates/blank-ios-app
Prerequisites: fh-ios-sdk: 5.+, Xcode: 9+, iOS SDK: iOS 9+, CocoaPods: 1.3.0+

What is it?

Simple native iOS app to get you started with fh-ios-sdk in RHMAP.

If you do not have access to a RHMAP instance, you can sign up for a free instance at https://openshift.feedhenry.com/.

How do I run it?

RHMAP Studio

This application and its cloud services are available as a project template in RHMAP as part of the "Native iOS Blank Project" template.

Local Clone (ideal for Open Source Development)

If you wish to contribute to this template, the following information may be helpful; otherwise, RHMAP and its build facilities are the preferred solution.

Build instructions

  1. Clone this project

  2. Populate blank-ios-app/fhconfig.plist with your values as explained on section 2.1.4. Setup.

  3. Run Pod install

NOTE: If you clone it manually to make the app buildable in RHMAP Build farm, replace the templating %id% in blank-ios-app\blank-ios-app-Info.plist in the following block:

<key>CFBundleIdentifier</key>
<string>%id%</string>
  1. Open blank-ios-app.xcworkspace

  2. Run the project

How does it work?

FH init

In blank-ios-app/ViewController.m the synchronization loop is started.

- (void)viewDidLoad {
  [super viewDidLoad];
  [FH initWithSuccess:^(FHResponse *response) { // [1]
    NSLog(@"initialized OK");
    self.statusLabel.text = @"FH init successful";
  } AndFailure:^(FHResponse *response) { // [2]
    NSLog(@"initialize fail, %@", response.rawResponseAsString);
    self.statusLabel.text = @"FH init in error";
  }];
}

Initialize FH with success [1] and failure [2] callbacks.

iOS9 and non TLS1.2 backend

If your RHMAP is depoyed without TLS1.2 support, open as source blank-ios-app/blank-ios-app-Info.plist.plist uncomment the exception lines:

  <!--
  <key>NSAppTransportSecurity</key>
  <dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
  </dict>
   -->