This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The function below is used for notification/subscription processing of the position of the note. | |
// When the position of the note is moved across one device, all other devices connected to Syncano will real-time sync to the same position. | |
updatePosition: function (element) { | |
var self = this; | |
var position = element.position(); | |
var xPos = Math.round(position.left); | |
var yPos = Math.round(position.top); | |
var noteId = self.findNote(element.attr('id')); | |
self.syncano.sendRequest({ | |
type: 'call', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface SyncanoCommunication : NSObject | |
@property (strong, nonatomic) Syncano *syncano; | |
- (void)sendText:(NSString *)text image:(UIImage *)image; | |
@end | |
@implementation SyncanoCommunication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface SyncanoCommunication : NSObject | |
@property (strong, nonatomic) SyncanoSyncServer *syncServer; | |
- (void)openSyncServerConnection; | |
- (void)subscribeToCollectionChanges; | |
- (void)sendMessage:(NSString *)message; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SYNViewController.h | |
// syncserver-ios-test | |
// | |
#import <UIKit/UIKit.h> | |
@interface SYNViewController : UIViewController | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) | |
var syncano = SyncanoConnector.getInstance(); | |
syncano.connect( {instance: 'YOUR-INSTANCE-NAME', api_key: 'YOUR-API-KEY'}, function(auth) { | |
console.log("Connected") | |
}); | |
2) | |
syncano.Data.new( PROJECT-ID, 'Default', {title: "My title"}, function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<script src="http://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js"></script> | |
<script src="http://cdn.jsdelivr.net/syncanojs/3.1.3beta/syncano.min.js"></script> | |
<script src="http://cdn.jsdelivr.net/jquery/2.1.1/jquery.min.js"></script> | |
<head></head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetOne(DATA_ID) { | |
var callback = {}; | |
callback.success = function(data) { | |
console.log('Get one with ID ' + DATA_ID + ' titled: ' + data.title); | |
}; | |
callback.error = function(data) { | |
console.log('Get One Fail! - ' + data); | |
console.log(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this function uses callback object, containing sucess and error functions inside it | |
function GetOne_Callback_Object(DATA_ID) { | |
//define callback object | |
var callback = {}; | |
//add to id success function - will be called on succesful calls | |
callback.success = function(data) { | |
console.log('Get one with ID ' + DATA_ID + ' titled: ' + data.title); | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//following defined in SCConstants.h | |
typedef NS_ENUM(NSUInteger, SCDataObjectPermissionType) { | |
SCDataObjectPermissionTypeNone, | |
SCDataObjectPermissionTypeRead, | |
SCDataObjectPermissionTypeWrite, | |
SCDataObjectPermissionTypeFull, | |
}; | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//need to add this: | |
<key>NSAppTransportSecurity</key> | |
<dict> | |
<key>NSExceptionDomains</key> | |
<dict> | |
<key>cloudfront.net</key> | |
<dict> | |
<!--Include to allow subdomains--> | |
<key>NSIncludesSubdomains</key> |
OlderNewer