Swift version of Blank iOS app is available here. ObjC/CocoaPods 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 : 3.+, Xcode : 7.2+, iOS SDK : iOS7+, CocoaPods: 1.0.1+
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/.
This application and its cloud services are available as a project template in RHMAP as part of the "Native iOS Blank Project" template.
If you wish to contribute to this template, the following information may be helpful; otherwise, RHMAP and its build facilities are the preferred solution.
-
Clone this project
-
Populate
blank-ios-app/fhconfig.plist
with your values as explained here. -
Run
Pod install
NOTE: If you clone it manually to make the app buildable in RHMAP Build farm, replace the templating
%id%
inblank-ios-app\blank-ios-app-Info.plist
in the following block:
<key>CFBundleIdentifier</key>
<string>%id%</string>
-
Open blank-ios-app.xcworkspace
-
Run the project
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.
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>
-->