{"id":19149925,"url":"https://github.com/harness/ff-xamarin-client-sample","last_synced_at":"2026-06-15T06:32:12.591Z","repository":{"id":42438289,"uuid":"461793367","full_name":"harness/ff-xamarin-client-sample","owner":"harness","description":"Xamarin SDK sample app to integrate with Harness Feature Flag service","archived":false,"fork":false,"pushed_at":"2022-04-21T11:13:37.000Z","size":919,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T20:41:55.725Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harness.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-21T09:38:52.000Z","updated_at":"2022-02-24T11:38:32.000Z","dependencies_parsed_at":"2022-08-24T13:37:56.634Z","dependency_job_id":null,"html_url":"https://github.com/harness/ff-xamarin-client-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/harness/ff-xamarin-client-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harness%2Fff-xamarin-client-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harness%2Fff-xamarin-client-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harness%2Fff-xamarin-client-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harness%2Fff-xamarin-client-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harness","download_url":"https://codeload.github.com/harness/ff-xamarin-client-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harness%2Fff-xamarin-client-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34351427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T08:10:02.825Z","updated_at":"2026-06-15T06:32:12.556Z","avatar_url":"https://github.com/harness.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example App using Harness Xamaring Binding SDK (ff-xamarin-client-sample) for Demo purposes\n\nThis Demo App will demonstrate the usage and capabilities of Xamarin client SDK for iOS and Android platform.\n\n## Setup\n\nXamarin client uses Harness Binding library NuGet package for iOS and Android application.\n\nTo reference Android binding library add package:\n```\nInstall-Package ff-android-xamarin-client-sdk -Version 0.5.2\n```\n\nTo reference iOS binding library add package:\n```\nInstall-Package ff-ios-xamarin-client-sdk -Version 0.5.0\n```\n\n## Usage\n\n### iOS library\n\nLibrary Initialization snippet\n```\n\n    //create configuration\n    var config = new CfConfigurationProxy\n    {\n        StreamEnabled = true,\n        AnalyticsEnabled = true,\n        ConfigUrl = \"https://config.feature-flags.uat.harness.io/api/1.0\",\n        EventUrl = \"https://event.feature-flags.uat.harness.io/api/1.0\",\n        StreamUrl = \"https://config.feature-flags.uat.harness.io/api/1.0/stream\"\n    };\n\n    // set selected identifer\n    var target = new CfTargetProxy\n    {\n        Identifier = \"target_identifier\",\n        Name = \"target_name\"\n    };\n\n    // Initialize authentication. Update API_KEY with your key.\n    CfClientProxy.Shared.InitializeWithApiKey(API_KEY, config, target);\n```\n\nSubscribing on receiving library events.\n\n```\nusing System;\nusing ff_ios_client_sdk_proxy;\n\npublic class CfListener : CfClientDelegate\n{\n\n    public CfListener()\n    {\n        // Subscribe on getting events from native iOS library\n        CfClientProxy.Shared.Delegate = this;\n    }\n    // Received in case of error\n    public override void OnErrorWithError(CfErrorProxy error){}\n\n    // Contains array with flags received each pooling interval\n    public override void OnPollingEventReceivedWithEvaluations(CxEvaluation[] evaluations){}\n\n    // Event when flag value is changed\n    public override void OnStreamEventReceivedWithEvaluation(CxEvaluation evaluation){}\n\n    // Message received from library event\n    public override void OnMessageReceivedWithMessage(CxMessage message){}\n\n    // On Stream opened event\n    public override void OnStreamOpened() {}\n\n    // On Stream closed event\n    public override void OnStreamCompleted() {}\n}\n```\n\n### Android library\n\nLibrary Initialization snippet\n\n```\n    CfConfiguration configuration = new CfConfiguration.Builder()\n        .EnableStream(true)\n        .EnableAnalytics(true)\n        .EventUrl(\"https://event.feature-flags.uat.harness.io/api/1.0\")\n        .StreamUrl(\"https://config.feature-flags.uat.harness.io/api/1.0/stream\")\n        .BaseUrl(\"https://config.feature-flags.uat.harness.io/api/1.0\")\n        .Build();\n\n    Target target = new Target()\n        .InvokeName(account)\n        .InvokeIdentifier(account);\n\n     // Initialize authentication. Update API_KEY with your key. Listener object should implement IAuthCallback interface.\n    CfClient.Instance.Initialize(this.context, API_KEY, configuration, target, listener);\n```\n\nSubscribing on receiving library events.\n\n```\nusing System;\nusing System.Linq;\nusing IO.Harness.Cfsdk.Cloud.Events;\nusing IO.Harness.Cfsdk.Cloud.Model;\nusing IO.Harness.Cfsdk.Cloud.Oksse;\nusing IO.Harness.Cfsdk.Cloud.Oksse.Model;\nusing Java.Interop;\nusing Java.Util;\nusing IO.Harness.Cfsdk;\n\npublic class CfListener : Java.Lang.Object, IAuthCallback, IEventsListener\n{\n\n    public CfListener()\n    {\n         // Subscribe on getting events from native Android library\n        CfClient.Instance.RegisterEventsListener(this);\n    }\n    public void AuthorizationSuccess(AuthInfo p0, AuthResult p1)\n    {\n        // p1.Success contains status of authorization\n        // In case of error p1.Error contains error message\n    }\n    public void OnEventReceived(StatusEvent p0)\n    {\n        var eventType = p0.EventType;\n        if(StatusEvent.EVENT_TYPE.SseStart == eventType)\n        {\n            // Stream started\n        }\n        else if( StatusEvent.EVENT_TYPE.SseEnd == eventType)\n        {\n            // Stream Ended\n        }\n        else if (StatusEvent.EVENT_TYPE.EvaluationChange == eventType)\n        {\n            Java.Lang.Object payload = p0.ExtractPayload();\n            var ev = payload as IO.Harness.Cfsdk.Cloud.Core.Model.Evaluation;\n            // Flag changed event\n        }\n        else if (StatusEvent.EVENT_TYPE.EvaluationReload == eventType)\n        {\n            Java.Lang.Object payload = p0.ExtractPayload();\n\n            var t = payload.JavaCast\u003cArrayList\u003e();\n            var arr = t.ToEnumerable\u003cIO.Harness.Cfsdk.Cloud.Core.Model.Evaluation\u003e().ToArray();\n\n            // Each pulling interval we will receive array of available flags.\n\n        }\n    }\n\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharness%2Fff-xamarin-client-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharness%2Fff-xamarin-client-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharness%2Fff-xamarin-client-sample/lists"}