Add Kettle
Preqrequisites
The following criterias must be fulfilled to implement the SDK:
- Minimum iOS target: 11.0
- CocoaPods installed on target machine
Install Kettle
Nuget
No nuget package is available due to issues with XCFramework support.
Project reference
Clone the Xamarin bindings offered by Kogenta:
$ git clone git@github.com:fluxloop/kettle-sdk-ios-xamarin.git
Install the required dependencies by running the bootstrap shell script included in the project. Essentially, it runs a pod install to fetch the latest version of the native SDK. Verify the script before running if neccessary.
$ cd kettle-sdk-ios-xamarin/src
$ sh bootstrapper.sh
In the event that the script is missing permissions to execute, do the following prior to running the bootstrapper:
$ chmod +x bootstrapper.sh
Add the Kettle.iOS.csproj
project as an existing project to your projects solution file, and use it via local project reference.
Background modes
Add the following background modes to your application:
- bluetooth-central
Initialize Kettle
AppDelegate.cs
using Kettle.iOS;
...
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
KTLConfig config = KTLConfig.KTLDefaultConfig();
config.ProductionApiKey = "<PRODUCTION-API-KEY>";
config.DevelopmentApiKey = "<DEVELOPMENT-API-KEY>";
KTLXamarin.Register();
KTLKettle.Prepare(config, options);
}