CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

Webcom 1.1.9

Webcom 1.1.9

License Commercial
ReleasedLast Release Dec 2019

Maintained by Christophe AZEMAR, Xavier LELEU, Sylvain Camus, Gaël Bréard.



Webcom 1.1.9

  • By
  • Webcom

Create an account

  1. Create an account on http://datasync.orange.com
  2. Once you're logged, create a namespace

Setup your project

You can configure your project manually or with CocoaPods

  • Manual Configuration
  • Download the Webcom framework.
  • Copy the framework in your project.
  • Add the framework dependency to project's target.

  • Cocoapods setup

  • Add Webcom to your project's Podfile
target :MyProject do
pod 'Webcom'
end

Start coding

  • Include Webcom header in your app :
#import <Webcom/Webcom.h>
import Webcom
  • Create a reference to your Flexible Datasync database.
/// Webcom reference
WCWebcom * webcomRef = [[WCWebcom alloc] initWithURL:@"https://io.datasync.orange.com/base/{your-webcom-app}"];
/// Webcom reference
let webcomRef = webcom = WCWebcom(URL: "https://io.datasync.orange.com/base/{your-webcom-app}")
  • Write data
/// Say Hello
[webcomRef set:@"Hello World!"];
/// Say Hello
webcomRef.set("Hello World!")
  • Read data
/// Read
[webcomRef onEventType:WCEventTypeValue withCallback:^(WCDataSnapshot * _Nullable snapshot, NSString * _Nullable prevKey)
{
NSString * value = (NSString *)snapshot.value;
NSLog(@"%@", value);
}];
/// Read
webcomRef.onEventType(.Value , withCallback:
{
(snapshot: WCDataSnapshot?, prevKey: String?) -> Void in
if let message = snapshot?.value as? String
{
print(message)
}
}

Release

In order to publish your application to AppStore you need to add a script to your project.

  1. Go to "Build Phases" pane in your project Target
  2. Add a "Run script phase"
  3. Copy paste this script

More