Author: Erik Jan de Wit
Level: Intermediate
Technologies: C# xamarin, iOS, android, RHMAP
Summary: A demonstration of how to get started with remote cloud call in RHMAP.
Community Project : Feed Henry
Target Product: RHMAP
Product Versions: RHMAP 3.7.0+
Source: https://github.com/feedhenry-templates/helloworld-xamarin
Prerequisites: fh-dotnet-sdk : 3.+, Visual Studio: 2015, Xamarin Studio: 5.3, iOS SDK : iOS7+, android sdk 23
Simple native iOS app and Android app based on Xamarin, to test your remote cloud connection in RHMAP. Its server side companion app: HelloWorld Cloud App. This template app demos how to intialize a cloud call and make calls to cloud endpoints. The app uses fh-dotnet-sdk.
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 Xamarin Hello World 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
helloworld-ios/fhconfig.plist
for iOS orhelloworld-android/Assets/fhconfig.properties
with your values as explained in our documentation. -
Open helloworld-xamarin.sln
-
Run the project
When the view has loaded the FH.init call is done:
await FHClient.Init();
That initialize the cloud connection.
In iOS-Template-App/HomeViewController.m
the FH.init call is done:
var response = await FH.Cloud ("hello", "GET", null, new Dictionary<string, string> () { { "hello", name.Text } });
if (response.Error == null) {
// cloudCall - success
Console.WriteLine(response.GetResponseAsDictionary () ["msg"]);
} else {
//cloudCall - fail
}